]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix regexp in help-do-arg-highlight
authorEshel Yaron <me@eshelyaron.com>
Mon, 28 Aug 2023 11:43:52 +0000 (13:43 +0200)
committerStefan Kangas <stefankangas@gmail.com>
Fri, 1 Sep 2023 18:29:27 +0000 (20:29 +0200)
* lisp/help-fns.el (help-do-arg-highlight): Fix regexp.  (Bug#65580)

Avoid highlighting (parts of) the function name as arguments in the
output of 'describe-function' when the function has an argument with
the same name.  To achieve this, refine the regular expression that
'help-do-arg-highlight' uses such that it doesn't match anything in
the function name.

lisp/help-fns.el

index 609bed18f2f9d8476067fc40a625a6345d53f1fc..b34778773a9e2cdd2d0c223edb6e47041c3f65f8 100644 (file)
@@ -369,7 +369,8 @@ if the variable `help-downcase-arguments' is non-nil."
       (setq doc (replace-regexp-in-string
                  ;; This is heuristic, but covers all common cases
                  ;; except ARG1-ARG2
-                 (concat "\\<"                   ; beginning of word
+                 (concat "([^ ]+ .*"             ; skip function name
+                         "\\<"                   ; beginning of word
                          "\\(?:[a-z-]*-\\)?"     ; for xxx-ARG
                          "\\("
                          (regexp-quote arg)