emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] emacs-25 35ce3fb: Don't assume window-point and point are


From: Noam Postavsky
Subject: [Emacs-diffs] emacs-25 35ce3fb: Don't assume window-point and point are the same
Date: Wed, 7 Dec 2016 03:39:57 +0000 (UTC)

branch: emacs-25
commit 35ce3fb141dd72f75408e71f2daba9b513ca89f2
Author: Noam Postavsky <address@hidden>
Commit: Noam Postavsky <address@hidden>

    Don't assume window-point and point are the same
    
    The function `cursor-sensor--detect' calls `bobp' to decide whether to
    check properties at (1- (window-point)).  However, (window-point) may be
    at beginning of buffer, even if (point) is not.  In this case an
    `args-out-of-range' error will be signaled (Bug#25104).
    
    * lisp/emacs-lisp/cursor-sensor.el (cursor-sensor--detect): Check the
    value of (window-point) against (point-min), rather than (bobp) to
    decide if (1- (window-point)) is accessible.
---
 lisp/emacs-lisp/cursor-sensor.el |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lisp/emacs-lisp/cursor-sensor.el b/lisp/emacs-lisp/cursor-sensor.el
index 2231179..28b6188 100644
--- a/lisp/emacs-lisp/cursor-sensor.el
+++ b/lisp/emacs-lisp/cursor-sensor.el
@@ -114,7 +114,7 @@
            ;; 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 (bobp)
+                    (unless (<= (point-min) point)
                       (get-char-property (1- point) 
'cursor-sensor-functions))))
            (old (window-parameter window 'cursor-sensor--last-state))
            (oldposmark (car old))



reply via email to

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