Fix (args-out-of-range 1) error in cursor-sensor--detect

* lisp/emacs-lisp/cursor-sensor.el (cursor-sensor--detect): Don't
  hard-code (point-min) as 1 which fails in narrowed buffers.
This commit is contained in:
Leo Liu 2016-03-21 18:26:10 +08:00
parent 8a35f83c6c
commit 76ef52267c

View file

@ -113,7 +113,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 (= point 1)
(unless (bobp)
(get-char-property (1- point) 'cursor-sensor-functions))))
(old (window-parameter window 'cursor-sensor--last-state))
(oldposmark (car old))