diff options
author | Federico Tedin <federicotedin@gmail.com> | 2020-02-17 21:58:43 +0100 |
---|---|---|
committer | Eli Zaretskii <eliz@gnu.org> | 2020-02-21 11:11:05 +0200 |
commit | d7c22338d2d461e0b55a6628fed1917c08715292 (patch) | |
tree | 7ec937b1b016e12c1fba05ea00761df00d36375c /lisp/emacs-lisp | |
parent | 2e39fc83bba22cefaa29fb8692f992a91119abf5 (diff) | |
download | emacs-d7c22338d2d461e0b55a6628fed1917c08715292.tar.gz emacs-d7c22338d2d461e0b55a6628fed1917c08715292.tar.bz2 emacs-d7c22338d2d461e0b55a6628fed1917c08715292.zip |
Fix cursor-sensor--detect when current buf != selected window's buf
* lisp/emacs-lisp/cursor-sensor.el (cursor-sensor--detect): Avoid
trying to read text properties from position taken from another
buffer. (Bug#38740)
Diffstat (limited to 'lisp/emacs-lisp')
-rw-r--r-- | lisp/emacs-lisp/cursor-sensor.el | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/lisp/emacs-lisp/cursor-sensor.el b/lisp/emacs-lisp/cursor-sensor.el index d8e8eeb16ef..7728e78c471 100644 --- a/lisp/emacs-lisp/cursor-sensor.el +++ b/lisp/emacs-lisp/cursor-sensor.el @@ -146,9 +146,10 @@ By convention, this is a list of symbols where each symbol stands for the ;; It's often desirable to make the cursor-sensor-functions property ;; non-sticky on both ends, but that means get-pos-property might ;; never see it. - (new (or (get-char-property point 'cursor-sensor-functions) - (unless (<= (point-min) point) - (get-char-property (1- point) 'cursor-sensor-functions)))) + (new (and (eq (current-buffer) (window-buffer)) + (or (get-char-property point 'cursor-sensor-functions) + (unless (<= (point-min) point) + (get-char-property (1- point) 'cursor-sensor-functions))))) (old (window-parameter window 'cursor-sensor--last-state)) (oldposmark (car old)) (oldpos (or (if oldposmark (marker-position oldposmark)) |