diff options
| author | Eli Zaretskii | 2021-12-05 16:38:49 +0200 |
|---|---|---|
| committer | Eli Zaretskii | 2021-12-05 16:38:49 +0200 |
| commit | 34f56561372d83b71dcaff1cdf5d9264ba38fa0e (patch) | |
| tree | 90e178feb29dde584c023673e85302bb9f8917ec | |
| parent | c086358574e3671787394c7b9f6069760e7c6b3c (diff) | |
| download | emacs-34f56561372d83b71dcaff1cdf5d9264ba38fa0e.tar.gz emacs-34f56561372d83b71dcaff1cdf5d9264ba38fa0e.zip | |
Document the subtleties of the 'cursor' text property
* doc/lispref/text.texi (Special Properties): Update the
documentation of the 'cursor' property per bug#8627.
| -rw-r--r-- | doc/lispref/text.texi | 41 |
1 files changed, 25 insertions, 16 deletions
diff --git a/doc/lispref/text.texi b/doc/lispref/text.texi index 41b3138a0dd..f66cdfdbd19 100644 --- a/doc/lispref/text.texi +++ b/doc/lispref/text.texi | |||
| @@ -3647,14 +3647,14 @@ Consecutive characters with the same @code{field} property constitute a | |||
| 3647 | @kindex cursor @r{(text property)} | 3647 | @kindex cursor @r{(text property)} |
| 3648 | Normally, the cursor is displayed at the beginning or the end of any | 3648 | Normally, the cursor is displayed at the beginning or the end of any |
| 3649 | overlay and text property strings present at the current buffer | 3649 | overlay and text property strings present at the current buffer |
| 3650 | position. You can place the cursor on any desired character of these | 3650 | position. You can instead tell Emacs to place the cursor on any |
| 3651 | strings by giving that character a non-@code{nil} @code{cursor} text | 3651 | desired character of these strings by giving that character a |
| 3652 | property. In addition, if the value of the @code{cursor} property is | 3652 | non-@code{nil} @code{cursor} text property. In addition, if the value |
| 3653 | an integer, it specifies the number of buffer's character | 3653 | of the @code{cursor} property is an integer, it specifies the number |
| 3654 | positions, starting with the position where the overlay or the | 3654 | of buffer's character positions, starting with the position where the |
| 3655 | @code{display} property begins, for which the cursor should be | 3655 | overlay or the @code{display} property begins, for which the cursor |
| 3656 | displayed on that character. Specifically, if the value of the | 3656 | should be displayed on that character. Specifically, if the value of |
| 3657 | @code{cursor} property of a character is the number @var{n}, the | 3657 | the @code{cursor} property of a character is the number @var{n}, the |
| 3658 | cursor will be displayed on this character for any buffer position in | 3658 | cursor will be displayed on this character for any buffer position in |
| 3659 | the range @code{[@var{ovpos}..@var{ovpos}+@var{n})}, where @var{ovpos} | 3659 | the range @code{[@var{ovpos}..@var{ovpos}+@var{n})}, where @var{ovpos} |
| 3660 | is the overlay's starting position given by @code{overlay-start} | 3660 | is the overlay's starting position given by @code{overlay-start} |
| @@ -3663,14 +3663,23 @@ text property begins in the buffer. | |||
| 3663 | 3663 | ||
| 3664 | In other words, the string character with the @code{cursor} property | 3664 | In other words, the string character with the @code{cursor} property |
| 3665 | of any non-@code{nil} value is the character where to display the | 3665 | of any non-@code{nil} value is the character where to display the |
| 3666 | cursor. The value of the property says for which buffer positions to | 3666 | cursor when the overlay or display string make point not visible on |
| 3667 | display the cursor there. If the value is an integer @var{n}, | 3667 | display. The value of the property says for which buffer positions to |
| 3668 | the cursor is displayed there when point is anywhere between the | 3668 | display the cursor there. If the value is an integer @var{n}, the |
| 3669 | beginning of the overlay or @code{display} property and @var{n} | 3669 | cursor is displayed there when point is anywhere between the beginning |
| 3670 | positions after that. If the value is anything else and | 3670 | of the overlay or @code{display} property and @var{n} positions after |
| 3671 | non-@code{nil}, the cursor is displayed there only when point is at | 3671 | that. If the value is anything else and non-@code{nil}, the cursor is |
| 3672 | the beginning of the @code{display} property or at | 3672 | displayed there only when point is at the buffer position that is the |
| 3673 | @code{overlay-start}. | 3673 | beginning of the @code{display} property, or at @code{overlay-start} |
| 3674 | if that position is not visible on display. Note that an integer | ||
| 3675 | value of the @code{cursor} property could mean that the cursor is | ||
| 3676 | displayed on that character even when point is visible on display. | ||
| 3677 | |||
| 3678 | One subtlety of this property is that it doesn't work to put this | ||
| 3679 | property on a newline character that is part of a display or overlay | ||
| 3680 | string. That's because the newline doesn't have a graphic | ||
| 3681 | representation on the screen for Emacs to find when it looks for a | ||
| 3682 | character on display with that @code{cursor} property. | ||
| 3674 | 3683 | ||
| 3675 | @cindex cursor position for @code{display} properties and overlays | 3684 | @cindex cursor position for @code{display} properties and overlays |
| 3676 | When the buffer has many overlay strings (e.g., @pxref{Overlay | 3685 | When the buffer has many overlay strings (e.g., @pxref{Overlay |