mirror of
https://git.notmuchmail.org/git/notmuch
synced 2025-01-03 15:21:41 +01:00
emacs: help: save-match-data
The routines that construct the help page in notmuch-lib rely on match-data being preserved across some fairly complicated code. This is currently valid but will not be when this series is finished. Thus place everything between the string-match and replace-match inside a save-match-data.
This commit is contained in:
parent
a5ecdf390e
commit
6f616bd733
1 changed files with 7 additions and 5 deletions
|
@ -273,11 +273,13 @@ prefix argument. PREFIX and TAIL are used internally."
|
|||
"Like `substitute-command-keys' but with documentation, not function names."
|
||||
(let ((beg 0))
|
||||
(while (string-match "\\\\{\\([^}[:space:]]*\\)}" doc beg)
|
||||
(let ((desc
|
||||
(save-match-data
|
||||
(let* ((keymap-name (substring doc (match-beginning 1) (match-end 1)))
|
||||
(keymap (symbol-value (intern keymap-name)))
|
||||
(ua-keys (where-is-internal 'universal-argument keymap t))
|
||||
(desc-list (notmuch-describe-keymap keymap ua-keys))
|
||||
(desc (mapconcat #'identity desc-list "\n")))
|
||||
(desc-list (notmuch-describe-keymap keymap ua-keys)))
|
||||
(mapconcat #'identity desc-list "\n")))))
|
||||
(setq doc (replace-match desc 1 1 doc)))
|
||||
(setq beg (match-end 0)))
|
||||
doc))
|
||||
|
|
Loading…
Reference in a new issue