emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] emacs-26 505ac9a: Improve documentation of cursor-sensor.e


From: Stefan Monnier
Subject: [Emacs-diffs] emacs-26 505ac9a: Improve documentation of cursor-sensor.el (bug#33664)
Date: Sun, 9 Dec 2018 08:59:26 -0500 (EST)

branch: emacs-26
commit 505ac9a0b1fcf2aa505ad551911c98761b77b6f8
Author: Stefan Monnier <address@hidden>
Commit: Stefan Monnier <address@hidden>

    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.
---
 doc/lispref/text.texi            |  6 ++++++
 lisp/emacs-lisp/cursor-sensor.el | 26 +++++++++++++++++++-------
 2 files changed, 25 insertions(+), 7 deletions(-)

diff --git a/doc/lispref/text.texi b/doc/lispref/text.texi
index 14cc4fb..78d51c6 100644
--- a/doc/lispref/text.texi
+++ b/doc/lispref/text.texi
@@ -3398,6 +3398,9 @@ When the minor mode @code{cursor-intangible-mode} is 
turned on, point
 is moved away from any position that has a address@hidden
 @code{cursor-intangible} property, just before redisplay happens.
 
+When the variable @code{cursor-sensor-inhibit} is address@hidden, the
address@hidden property is ignored.
+
 @item field
 @kindex field @r{(text property)}
 Consecutive characters with the same @code{field} property constitute a
@@ -3579,6 +3582,9 @@ depending on whether the cursor is entering the text that 
has this
 property or leaving it.  The functions are called only when the minor
 mode @code{cursor-sensor-mode} is turned on.
 
+When the variable @code{cursor-sensor-inhibit} is address@hidden, the
address@hidden property is ignored.
+
 @item composition
 @kindex composition @r{(text property)}
 This text property is used to display a sequence of characters as a
diff --git a/lisp/emacs-lisp/cursor-sensor.el b/lisp/emacs-lisp/cursor-sensor.el
index 7e3088d..21c48f8 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)))



reply via email to

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