]> git.eshelyaron.com Git - emacs.git/commitdiff
Don't assume window-point and point are the same
authorNoam Postavsky <npostavs@gmail.com>
Sun, 4 Dec 2016 06:06:52 +0000 (01:06 -0500)
committerNoam Postavsky <npostavs@gmail.com>
Wed, 7 Dec 2016 03:36:12 +0000 (22:36 -0500)
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

index 2231179de1cd4ff2d449cf5778f0040be08f70fd..28b61880d0a30eccbc66d409ac2fac5e233fceee 100644 (file)
            ;; 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))