diff options
| author | Noam Postavsky | 2016-12-04 01:06:52 -0500 |
|---|---|---|
| committer | Noam Postavsky | 2016-12-06 22:36:12 -0500 |
| commit | 35ce3fb141dd72f75408e71f2daba9b513ca89f2 (patch) | |
| tree | 6e21160064cf7ecb906af016fc27cdb3611fa4e9 | |
| parent | a3487a8121e408ee07fe019270b3bdeaac0ee960 (diff) | |
| download | emacs-35ce3fb141dd72f75408e71f2daba9b513ca89f2.tar.gz emacs-35ce3fb141dd72f75408e71f2daba9b513ca89f2.zip | |
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.
| -rw-r--r-- | lisp/emacs-lisp/cursor-sensor.el | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lisp/emacs-lisp/cursor-sensor.el b/lisp/emacs-lisp/cursor-sensor.el index 2231179de1c..28b61880d0a 100644 --- a/lisp/emacs-lisp/cursor-sensor.el +++ b/lisp/emacs-lisp/cursor-sensor.el | |||
| @@ -114,7 +114,7 @@ | |||
| 114 | ;; non-sticky on both ends, but that means get-pos-property might | 114 | ;; non-sticky on both ends, but that means get-pos-property might |
| 115 | ;; never see it. | 115 | ;; never see it. |
| 116 | (new (or (get-char-property point 'cursor-sensor-functions) | 116 | (new (or (get-char-property point 'cursor-sensor-functions) |
| 117 | (unless (bobp) | 117 | (unless (<= (point-min) point) |
| 118 | (get-char-property (1- point) 'cursor-sensor-functions)))) | 118 | (get-char-property (1- point) 'cursor-sensor-functions)))) |
| 119 | (old (window-parameter window 'cursor-sensor--last-state)) | 119 | (old (window-parameter window 'cursor-sensor--last-state)) |
| 120 | (oldposmark (car old)) | 120 | (oldposmark (car old)) |