diff --git a/doc/lispref/text.texi b/doc/lispref/text.texi index 22bce370197..7f43c631482 100644 --- a/doc/lispref/text.texi +++ b/doc/lispref/text.texi @@ -3042,6 +3042,7 @@ followed by the text properties. If @var{object} is a string, only text properties are considered, since strings never have overlays. @end defun +@anchor{Boundaries of text and overlay properties} @defun get-pos-property position prop &optional object This function is like @code{get-char-property}, except that it pays attention to properties' stickiness and overlays' advancement settings @@ -4019,6 +4020,10 @@ The movement can be @code{entered} or @code{left}, depending on whether the cursor is entering the text that has this property or leaving it, or @code{moved} when the cursor moved within that text. Other values for the direction should be ignored. +Whether the boundary positions (at the beginning and end of an overlay or +a stretch of text-property) are considered as inside or outside follows +the same rules as for @code{get-pos-property}, see @pxref{Boundaries of +text and overlay properties}. The functions are called only when the minor mode @code{cursor-sensor-mode} is turned on. diff --git a/etc/NEWS b/etc/NEWS index a746ca7b1a3..3021ad42a12 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -3987,6 +3987,21 @@ all versions, sleep events require Windows 8 or later). * Incompatible Lisp Changes in Emacs 31.1 ++++ +** Boundaries of 'cursor-sensor-functions' now obey stickiness. +'cursor-sensor-mode' now uses 'get-pos-property' to decide whether a +boundary is considered as inside or outside. + +This means that by default, the boundaries have changed: the end +position of a stretch of a 'cursor-sensor-functions' text property +used to be considered outside of the stretch whereas it is now +considered as inside. You can recover the previous behavior by +controlling the stickiness, for example with a call like: + + (add-text-properties BEG END + '(cursor-sensor-functions (MY-FUNCTION) + rear-nonsticky (cursor-sensor-functions))) + +++ ** 'makunbound' on a variable alias undoes the alias. Previously, it had the effect of applying the 'makunbound' on the