emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master 0bd6ae7: Only treat display strings as buttons if they have 'butt


From: Eli Zaretskii
Subject: master 0bd6ae7: Only treat display strings as buttons if they have 'button' property
Date: Sat, 9 May 2020 03:43:36 -0400 (EDT)

branch: master
commit 0bd6ae773a1ade1bdec2c233df4f260d028fd6c5
Author: Clément Pit-Claudel <address@hidden>
Commit: Eli Zaretskii <address@hidden>

    Only treat display strings as buttons if they have 'button' property
    
    * lisp/button.el (push-button): Use 'posn-point' instead of
    'posn-string' if the string doesn't have the 'button'
    property (Bug#40859).
---
 lisp/button.el | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/lisp/button.el b/lisp/button.el
index b3afc4e..3a6a6de 100644
--- a/lisp/button.el
+++ b/lisp/button.el
@@ -469,10 +469,12 @@ return t."
       ;; POS is a mouse event; switch to the proper window/buffer
       (let ((posn (event-start pos)))
        (with-current-buffer (window-buffer (posn-window posn))
-         (if (posn-string posn)
-             ;; mode-line, header-line, or display string event.
-             (button-activate (posn-string posn) t)
-           (push-button (posn-point posn) t))))
+          (let* ((str (posn-string posn))
+                 (str-button (and str (get-text-property (cdr str) 'button 
(car str)))))
+           (if str-button
+               ;; mode-line, header-line, or display string event.
+               (button-activate str t)
+             (push-button (posn-point posn) t)))))
     ;; POS is just normal position
     (let ((button (button-at (or pos (point)))))
       (when button



reply via email to

[Prev in Thread] Current Thread [Next in Thread]