From f51f9634788323b3bf2dde59d0d20a8ca8fbfeaf Mon Sep 17 00:00:00 2001 From: "Basil L. Contovounesios" Date: Thu, 4 Jun 2020 23:08:28 +0100 Subject: [PATCH] Fix some side-effecting uses of make-text-button For discussion, see the following thread: https://lists.gnu.org/archive/html/emacs-devel/2020-06/msg00117.html * lisp/apropos.el (apropos-library-button): * lisp/help-fns.el (help-fns--first-release): Return result of make-text-button instead of relying on its side effects. * lisp/ibuf-ext.el (ibuffer-old-saved-filters-warning): Avoid modifying an immutable string. --- lisp/apropos.el | 3 +-- lisp/help-fns.el | 3 +-- lisp/ibuf-ext.el | 2 +- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/lisp/apropos.el b/lisp/apropos.el index 7cbda3cb678..22866cd2cc8 100644 --- a/lisp/apropos.el +++ b/lisp/apropos.el @@ -665,8 +665,7 @@ Return list of symbols and documentation found." (make-text-button name nil 'type 'apropos-library 'face 'apropos-symbol - 'apropos-symbol name) - name))) + 'apropos-symbol name)))) ;;;###autoload (defun apropos-library (file) diff --git a/lisp/help-fns.el b/lisp/help-fns.el index 63b066f3b85..b9536470631 100644 --- a/lisp/help-fns.el +++ b/lisp/help-fns.el @@ -647,8 +647,7 @@ FILE is the file where FUNCTION was probably defined." (setq place (list f pos)) (setq first version))))))))) (when first - (make-text-button first nil 'type 'help-news 'help-args place)) - first)) + (make-text-button first nil 'type 'help-news 'help-args place)))) (add-hook 'help-fns-describe-function-functions #'help-fns--mention-first-release) diff --git a/lisp/ibuf-ext.el b/lisp/ibuf-ext.el index bfb9787a96d..c39000b4886 100644 --- a/lisp/ibuf-ext.el +++ b/lisp/ibuf-ext.el @@ -202,7 +202,7 @@ The format has been repaired and the variable modified accordingly. You can save the current value through the customize system by either clicking or hitting return " (make-text-button - "here" nil + (copy-sequence "here") nil 'face '(:weight bold :inherit button) 'mouse-face '(:weight normal :background "gray50" :inherit button) 'follow-link t -- 2.39.5