summaryrefslogtreecommitdiff
path: root/lisp/emacs-lisp/cursor-sensor.el
diff options
context:
space:
mode:
authorStefan Monnier <monnier@iro.umontreal.ca>2018-12-09 08:59:20 -0500
committerStefan Monnier <monnier@iro.umontreal.ca>2018-12-09 08:59:20 -0500
commit505ac9a0b1fcf2aa505ad551911c98761b77b6f8 (patch)
tree91f31120490b1840b61d2ce80c99995d77539fd0 /lisp/emacs-lisp/cursor-sensor.el
parentd817d2cfb9bdb71fb3ed540d6601be4577272acc (diff)
downloademacs-505ac9a0b1fcf2aa505ad551911c98761b77b6f8.tar.gz
emacs-505ac9a0b1fcf2aa505ad551911c98761b77b6f8.tar.bz2
emacs-505ac9a0b1fcf2aa505ad551911c98761b77b6f8.zip
Improve documentation of cursor-sensor.el (bug#33664)
* doc/lispref/text.texi (Special Properties): Mention cursor-sensor-inhibit. * lisp/emacs-lisp/cursor-sensor.el (Commentary): Add cursor-sensor-mode. (cursor-sensor-inhibit): Add docstring.
Diffstat (limited to 'lisp/emacs-lisp/cursor-sensor.el')
-rw-r--r--lisp/emacs-lisp/cursor-sensor.el26
1 files changed, 19 insertions, 7 deletions
diff --git a/lisp/emacs-lisp/cursor-sensor.el b/lisp/emacs-lisp/cursor-sensor.el
index 7e3088dd91e..21c48f830f2 100644
--- a/lisp/emacs-lisp/cursor-sensor.el
+++ b/lisp/emacs-lisp/cursor-sensor.el
@@ -22,17 +22,29 @@
;;; Commentary:
-;; This package implements the `cursor-intangible' property, which is
-;; meant to replace the old `intangible' property. To use it, just enable the
-;; `cursor-intangible-mode', after which this package will move point away from
-;; any position that has a non-nil `cursor-intangible' property. This is only
-;; done just before redisplay happens, contrary to the old `intangible'
-;; property which was done at a much lower level.
+;; This package implements the `cursor-intangible' and
+;; `cursor-sensor-functions' properties, which are meant to replace
+;; the old `intangible', `point-entered', and `point-left' properties.
+
+;; To use `cursor-intangible', just enable the
+;; `cursor-intangible-mode' minor mode, after which this package will
+;; move point away from any position that has a non-nil
+;; `cursor-intangible' property. This is only done just before
+;; redisplay happens, contrary to the old `intangible' property which
+;; was done at a much lower level.
+
+;; To use `cursor-sensor-functions', enable the `cursor-sensor-mode'
+;; minor mode, after which the `cursor-sensor-functions' will be
+;; called just before redisplay happens, according to the movement of
+;; the cursor since the last redisplay.
;;; Code:
;;;###autoload
-(defvar cursor-sensor-inhibit nil)
+(defvar cursor-sensor-inhibit nil
+ "When non-nil, suspend `cursor-sensor-mode' and `cursor-intangible-mode'.
+By convention, this is a list of symbols where each symbol stands for the
+\"cause\" of the suspension.")
(defun cursor-sensor--intangible-p (pos)
(let ((p (get-pos-property pos 'cursor-intangible)))