]> code.delx.au - gnu-emacs/commitdiff
Document obsoletion of 'intangible' and 'point-entered/left'
authorEli Zaretskii <eliz@gnu.org>
Wed, 13 Jan 2016 19:14:22 +0000 (21:14 +0200)
committerEli Zaretskii <eliz@gnu.org>
Wed, 13 Jan 2016 19:14:22 +0000 (21:14 +0200)
* doc/lispref/text.texi (Special Properties): Document the new
properties 'cursor-intangible' and 'cursor-sensor-functions'.
Document the obsolete status of 'intangible', 'pointer-left',
and 'point-entered' properties, and of 'inhibit-point-motion-hooks'.
* doc/lispref/display.texi (Overlay Properties): Document that
'intangible' overlay property is obsolete.

* lisp/emacs-lisp/cursor-sensor.el (cursor-sensor-mode): Doc fix.

doc/lispref/display.texi
doc/lispref/text.texi
etc/NEWS
lisp/emacs-lisp/cursor-sensor.el

index 1ac0f05c7d49de19b921b4e5c67e900a8dc434ef..d77059916fce0c85ad0a597409c801172370031c 100644 (file)
@@ -1721,7 +1721,8 @@ invisible, which means that it does not appear on the screen.
 @item intangible
 @kindex intangible @r{(overlay property)}
 The @code{intangible} property on an overlay works just like the
-@code{intangible} text property.  @xref{Special Properties}, for details.
+@code{intangible} text property.  It is obsolete.  @xref{Special
+Properties}, for details.
 
 @item isearch-open-invisible
 This property tells incremental search how to make an invisible overlay
index 5d9f192b111f86e4be51a499b1b76e4b7eeb03e8..41991c9482cb46298d96e2271cb6dee6648ab1a4 100644 (file)
@@ -3380,14 +3380,22 @@ If consecutive characters have unequal non-@code{nil}
 @code{intangible} properties, they belong to separate groups; each
 group is separately treated as described above.
 
-When the variable @code{inhibit-point-motion-hooks} is non-@code{nil},
-the @code{intangible} property is ignored.
+When the variable @code{inhibit-point-motion-hooks} is non-@code{nil}
+(as it is by default), the @code{intangible} property is ignored.
 
 Beware: this property operates at a very low level, and affects a lot of code
 in unexpected ways.  So use it with extreme caution.  A common misuse is to put
 an intangible property on invisible text, which is actually unnecessary since
 the command loop will move point outside of the invisible text at the end of
-each command anyway.  @xref{Adjusting Point}.
+each command anyway.  @xref{Adjusting Point}.  For these reasons, this
+property is obsolete; use the @code{cursor-intangible} property instead.
+
+@item cursor-intangible
+@kindex cursor-intangible @r{(text property)}
+@findex cursor-intangible-mode
+When the minor mode @code{cursor-intangible-mode} is turned on, point
+is moved away of any position that has a non-@code{nil}
+@code{cursor-intangible} property, just before redisplay happens.
 
 @item field
 @kindex field @r{(text property)}
@@ -3550,9 +3558,23 @@ It is possible to use @code{char-after} to examine characters at various
 buffer positions without moving point to those positions.  Only an
 actual change in the value of point runs these hook functions.
 
-The variable @code{inhibit-point-motion-hooks} can inhibit running the
-@code{point-left} and @code{point-entered} hooks, see @ref{Inhibit
-point motion hooks}.
+The variable @code{inhibit-point-motion-hooks} by default inhibits
+running the @code{point-left} and @code{point-entered} hooks, see
+@ref{Inhibit point motion hooks}.
+
+These properties are obsolete; please use
+@code{cursor-sensor-functions} instead.
+
+@item cursor-sensor-functions
+@kindex cursor-sensor-functions @r{(text property)}
+@findex cursor-sensor-mode
+This special property records a list of functions that react to cursor
+motion.  Each function in the list is called, just before redisplay,
+with 3 arguments: the affected window, the previous known position of
+the cursor, and one of the symbols @code{entered} or @code{left},
+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.
 
 @item composition
 @kindex composition @r{(text property)}
@@ -3564,10 +3586,12 @@ directly by, for instance, @code{put-text-property}.
 @end table
 
 @defvar inhibit-point-motion-hooks
-@anchor{Inhibit point motion hooks} When this variable is
+@anchor{Inhibit point motion hooks} When this obsolete variable is
 non-@code{nil}, @code{point-left} and @code{point-entered} hooks are
 not run, and the @code{intangible} property has no effect.  Do not set
-this variable globally; bind it with @code{let}.
+this variable globally; bind it with @code{let}.  Since the affected
+properties are obsolete, this variable's default value is @code{t}, to
+effectively disable them.
 @end defvar
 
 @defvar show-help-function
index 7cea0c88da1a0f8e5d360020a976d5ca982cf754..525fa5e4cd4cfa912f6e64a67fc1965677fc4316 100644 (file)
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -1357,12 +1357,16 @@ It is a bit easier to use than `pre-redisplay-function'.
 ** The second arg of `looking-back' should always be provided explicitly.
 Previously, it was an optional argument, now it's mandatory.
 
-** Obsolete text properties `intangible', `point-entered', and `point-left'.
++++
+** Text properties `intangible', `point-entered', and `point-left' are obsolete.
 Replaced by properties `cursor-intangible' and `cursor-sensor-functions',
 implemented by the new `cursor-intangible-mode' and
 `cursor-sensor-mode' minor modes.
 
-** `inhibit-point-motion-hooks' now defaults to t and is obsolete.
++++
+** `inhibit-point-motion-hooks' now defaults to `t' and is obsolete.
+Use the new minor modes `cursor-intangible-mode' and
+`cursor-sensor-mode' instead.
 
 +++
 ** New process type `pipe', which can be used in combination with the
index 70c4458d300ef0d5d9f680c19ee14cc703d88ad1..ac063d4896ad13fe720707c4d7d37044b99a2133 100644 (file)
 This property should hold a list of functions which react to the motion
 of the cursor.  They're called with three arguments (WINDOW OLDPOS DIR)
 where WINDOW is the affected window, OLDPOS is the last known position of
-the cursor and DIR can be `left' or `entered' depending on whether the cursor is
-entering the area covered by the text-property property or leaving it."
+the cursor and DIR can be `entered' or `left' depending on whether the cursor
+is entering the area covered by the text-property property or leaving it."
   nil nil nil
   (if cursor-sensor-mode
       (add-hook 'pre-redisplay-functions #'cursor-sensor--detect