]> git.eshelyaron.com Git - emacs.git/commitdiff
Limit fontification of "customize" in setopt suggestion
authorVisuwesh <visuweshm@gmail.com>
Mon, 7 Apr 2025 09:46:38 +0000 (15:16 +0530)
committerEshel Yaron <me@eshelyaron.com>
Sun, 13 Apr 2025 20:51:44 +0000 (22:51 +0200)
* lisp/help-fns.el (help-fns--customize-variable): Limit the
fontification to newly inserted text to avoid spurious
fontification of other instances of the word "customize."

(cherry picked from commit bf7bcbaa3decf976e9409fe9d3fe183a6e8d6920)

lisp/help-fns.el

index 0eade146ac45734138a70fde7c60c45762f6dcb5..0fd5859428938116169683c320db90bf29dc2772 100644 (file)
@@ -1648,7 +1648,9 @@ This cancels value editing without updating the value."
   ;; Make a link to customize if this variable can be customized.
   (when (custom-variable-p variable)
     (let ((customize-label "customize")
-          (custom-set (get variable 'custom-set)))
+          (custom-set (get variable 'custom-set))
+          (opoint (with-current-buffer standard-output
+                    (point))))
       (princ (concat "  You can " customize-label (or text " this variable.")))
       (when (and custom-set
                  ;; Don't override manually written documentation.
@@ -1665,7 +1667,7 @@ This cancels value editing without updating the value."
                         "."))))
       (with-current-buffer standard-output
        (save-excursion
-          (while (re-search-backward (concat "\\(" customize-label "\\)") nil t)
+          (while (re-search-backward (concat "\\(" customize-label "\\)") opoint t)
            (help-xref-button 1 'help-customize-variable variable))))
       (terpri))))