1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2025-02-02 20:16:25 +00:00

Fix "M-x man RET [ RET"

* lisp/man.el (Man-completion-table): Quote special characters
before passing them to the shell.
(Man-name-regexp): Allow '@' and '[' in man-page names.  (Bug#64795)
This commit is contained in:
Eli Zaretskii 2023-07-26 17:30:21 +03:00
parent 8abe4ca83a
commit 4ef9cc5a5d

View File

@ -315,7 +315,7 @@ If this is nil, `man' will use `locale-coding-system'."
:type 'hook
:group 'man)
(defvar Man-name-regexp "[-[:alnum:]_­+][-[:alnum:]_.:­+]*"
(defvar Man-name-regexp "[-[:alnum:]_­+[@][-[:alnum:]_.:­+]*"
"Regular expression describing the name of a manpage (without section).")
(defvar Man-section-regexp "[0-9][a-zA-Z0-9+]*\\|[LNln]"
@ -937,7 +937,16 @@ foo(sec)[, bar(sec) [, ...]] [other stuff] - description"
"-k" (concat (when (or Man-man-k-use-anchor
(string-equal prefix ""))
"^")
prefix))))
(if (string-equal prefix "")
prefix
;; FIXME: shell-quote-argument
;; is not entirely
;; appropriate: we actually
;; need to quote ERE here.
;; But we don't have that, and
;; shell-quote-argument does
;; the job...
(shell-quote-argument prefix))))))
(setq table (Man-parse-man-k)))))
;; Cache the table for later reuse.
(when table