aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVisuwesh2025-04-07 15:16:38 +0530
committerEli Zaretskii2025-04-12 14:22:55 +0300
commitbf7bcbaa3decf976e9409fe9d3fe183a6e8d6920 (patch)
tree58a459b3f8352340ac9c698983de36ab2bf4c680
parent50531a00b53be7f98a763090331812aae5d3a015 (diff)
downloademacs-bf7bcbaa3decf976e9409fe9d3fe183a6e8d6920.tar.gz
emacs-bf7bcbaa3decf976e9409fe9d3fe183a6e8d6920.zip
Limit fontification of "customize" in setopt suggestion
* 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."
-rw-r--r--lisp/help-fns.el6
1 files changed, 4 insertions, 2 deletions
diff --git a/lisp/help-fns.el b/lisp/help-fns.el
index 6c4c3f4da97..77f1c1e678f 100644
--- a/lisp/help-fns.el
+++ b/lisp/help-fns.el
@@ -1589,7 +1589,9 @@ it is displayed along with the global value."
1589 ;; Make a link to customize if this variable can be customized. 1589 ;; Make a link to customize if this variable can be customized.
1590 (when (custom-variable-p variable) 1590 (when (custom-variable-p variable)
1591 (let ((customize-label "customize") 1591 (let ((customize-label "customize")
1592 (custom-set (get variable 'custom-set))) 1592 (custom-set (get variable 'custom-set))
1593 (opoint (with-current-buffer standard-output
1594 (point))))
1593 (princ (concat " You can " customize-label (or text " this variable."))) 1595 (princ (concat " You can " customize-label (or text " this variable.")))
1594 (when (and custom-set 1596 (when (and custom-set
1595 ;; Don't override manually written documentation. 1597 ;; Don't override manually written documentation.
@@ -1606,7 +1608,7 @@ it is displayed along with the global value."
1606 ".")))) 1608 "."))))
1607 (with-current-buffer standard-output 1609 (with-current-buffer standard-output
1608 (save-excursion 1610 (save-excursion
1609 (while (re-search-backward (concat "\\(" customize-label "\\)") nil t) 1611 (while (re-search-backward (concat "\\(" customize-label "\\)") opoint t)
1610 (help-xref-button 1 'help-customize-variable variable)))) 1612 (help-xref-button 1 'help-customize-variable variable))))
1611 (terpri)))) 1613 (terpri))))
1612 1614