diff options
| author | Clément Pit-Claudel | 2020-04-26 12:41:42 -0400 |
|---|---|---|
| committer | Eli Zaretskii | 2020-05-09 10:42:30 +0300 |
| commit | 0bd6ae773a1ade1bdec2c233df4f260d028fd6c5 (patch) | |
| tree | 0db58a4db34a8eb9082df8ff35936d2f82431d26 | |
| parent | 1f149cb392ac4ed99dd1ce2da01178ff0490e746 (diff) | |
| download | emacs-0bd6ae773a1ade1bdec2c233df4f260d028fd6c5.tar.gz emacs-0bd6ae773a1ade1bdec2c233df4f260d028fd6c5.zip | |
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).
| -rw-r--r-- | lisp/button.el | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/lisp/button.el b/lisp/button.el index b3afc4eca25..3a6a6de774c 100644 --- a/lisp/button.el +++ b/lisp/button.el | |||
| @@ -469,10 +469,12 @@ return t." | |||
| 469 | ;; POS is a mouse event; switch to the proper window/buffer | 469 | ;; POS is a mouse event; switch to the proper window/buffer |
| 470 | (let ((posn (event-start pos))) | 470 | (let ((posn (event-start pos))) |
| 471 | (with-current-buffer (window-buffer (posn-window posn)) | 471 | (with-current-buffer (window-buffer (posn-window posn)) |
| 472 | (if (posn-string posn) | 472 | (let* ((str (posn-string posn)) |
| 473 | ;; mode-line, header-line, or display string event. | 473 | (str-button (and str (get-text-property (cdr str) 'button (car str))))) |
| 474 | (button-activate (posn-string posn) t) | 474 | (if str-button |
| 475 | (push-button (posn-point posn) t)))) | 475 | ;; mode-line, header-line, or display string event. |
| 476 | (button-activate str t) | ||
| 477 | (push-button (posn-point posn) t))))) | ||
| 476 | ;; POS is just normal position | 478 | ;; POS is just normal position |
| 477 | (let ((button (button-at (or pos (point))))) | 479 | (let ((button (button-at (or pos (point))))) |
| 478 | (when button | 480 | (when button |