From: Visuwesh Date: Mon, 7 Apr 2025 09:46:38 +0000 (+0530) Subject: Limit fontification of "customize" in setopt suggestion X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=2e01bd32db406b682aa99a0aa263e52d6249a9ab;p=emacs.git 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." (cherry picked from commit bf7bcbaa3decf976e9409fe9d3fe183a6e8d6920) --- diff --git a/lisp/help-fns.el b/lisp/help-fns.el index 0eade146ac4..0fd58594289 100644 --- a/lisp/help-fns.el +++ b/lisp/help-fns.el @@ -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))))