diff options
| author | Jared Finder | 2025-12-29 12:35:24 -0800 |
|---|---|---|
| committer | Sean Whitton | 2026-01-10 12:49:43 +0000 |
| commit | 4e779d20f1840fef380f5688ceb2cd80658bde0b (patch) | |
| tree | 79ad054524a73dced6d382a99d0a6a476f7ad1f9 /doc | |
| parent | 88d3101fdd10f5e922aae9d99fcfd103a33747db (diff) | |
| download | emacs-4e779d20f1840fef380f5688ceb2cd80658bde0b.tar.gz emacs-4e779d20f1840fef380f5688ceb2cd80658bde0b.zip | |
Update cursor display using Xterm escape sequences
* lisp/term/xterm.el (xterm-update-cursor): New user option.
(xterm--init): Use it.
(xterm--post-command-hook): New function for all xterm
functionality installed in 'post-command-hook'.
(xterm--init-frame-title): Install it.
(xterm--init-update-cursor, xterm--set-cursor-type)
(xterm--update-cursor-type, xterm--update-cursor-color): New
functions.
(xterm--cursor-type-to-int): New constant.
* doc/emacs/display.texi (Cursor Display):
* etc/NEWS: Document the new feature.
Diffstat (limited to 'doc')
| -rw-r--r-- | doc/emacs/display.texi | 53 |
1 files changed, 33 insertions, 20 deletions
diff --git a/doc/emacs/display.texi b/doc/emacs/display.texi index 05a25323543..d475fc3cfde 100644 --- a/doc/emacs/display.texi +++ b/doc/emacs/display.texi | |||
| @@ -2048,20 +2048,41 @@ variable @code{visible-cursor} is @code{nil} when Emacs starts or | |||
| 2048 | resumes, it uses the normal cursor. | 2048 | resumes, it uses the normal cursor. |
| 2049 | 2049 | ||
| 2050 | @vindex cursor-type | 2050 | @vindex cursor-type |
| 2051 | On a graphical display, many more properties of the text cursor can | 2051 | On a graphical display and many Xterm-compatible text terminals, the |
| 2052 | be altered. To customize its color, change the @code{:background} | 2052 | color and shape of the text cursor can be altered. To customize its |
| 2053 | attribute of the face named @code{cursor} (@pxref{Face | 2053 | color, change the @code{:background} attribute of the face named |
| 2054 | Customization}). (The other attributes of this face have no effect; | 2054 | @code{cursor} (@pxref{Face Customization}). (The other attributes of |
| 2055 | the text shown under the cursor is drawn using the frame's background | 2055 | this face have no effect; the text shown under the cursor is drawn using |
| 2056 | color.) To change its shape, customize the buffer-local variable | 2056 | the frame's background color.) To change its shape, customize the |
| 2057 | @code{cursor-type}; possible values are @code{box} (the default), | 2057 | buffer-local variable @code{cursor-type}; possible values are @code{box} |
| 2058 | @code{(box . @var{size})} (box cursor becoming a hollow box under | 2058 | (the default), @code{(box . @var{size})} (box cursor becoming a hollow |
| 2059 | masked images larger than @var{size} pixels in either dimension), | 2059 | box under masked images larger than @var{size} pixels in either |
| 2060 | @code{hollow} (a hollow box), @code{bar} (a vertical bar), @code{(bar | 2060 | dimension), @code{hollow} (a hollow box), @code{bar} (a vertical bar), |
| 2061 | . @var{n})} (a vertical bar @var{n} pixels wide), @code{hbar} (a | 2061 | @code{(bar . @var{n})} (a vertical bar @var{n} pixels wide), @code{hbar} |
| 2062 | horizontal bar), @code{(hbar . @var{n})} (a horizontal bar @var{n} | 2062 | (a horizontal bar), @code{(hbar . @var{n})} (a horizontal bar @var{n} |
| 2063 | pixels tall), or @code{nil} (no cursor at all). | 2063 | pixels tall), or @code{nil} (no cursor at all). |
| 2064 | 2064 | ||
| 2065 | @vindex xterm-update-cursor | ||
| 2066 | On Xterm-compatible text terminals cursor customiztaion is controlled | ||
| 2067 | by the user option @code{xterm-update-cursor}. Valid values are: | ||
| 2068 | @code{t} to update the cursor's color and shape, @code{type} to update | ||
| 2069 | the cursor's shape only, @code{color} to update the cursor's color only, | ||
| 2070 | and @code{nil} to not update the cursor's appearance. Xterm-compatible | ||
| 2071 | text terminals can not display a hollow box and instead use a filled | ||
| 2072 | box. Similarly, Xterm-compatible text terminals ignore the pixel sizes | ||
| 2073 | for @code{bar} and @code{hbar}. | ||
| 2074 | |||
| 2075 | @findex hl-line-mode | ||
| 2076 | @findex global-hl-line-mode | ||
| 2077 | @cindex highlight current line | ||
| 2078 | To make the cursor even more visible, you can use HL Line mode, a | ||
| 2079 | minor mode that highlights the line containing point. Use @kbd{M-x | ||
| 2080 | hl-line-mode} to enable or disable it in the current buffer. @kbd{M-x | ||
| 2081 | global-hl-line-mode} enables or disables the same mode globally. | ||
| 2082 | |||
| 2083 | The remaining controls only work on graphical displays where Emacs can | ||
| 2084 | fully control the way the cursor appears. | ||
| 2085 | |||
| 2065 | @findex blink-cursor-mode | 2086 | @findex blink-cursor-mode |
| 2066 | @cindex cursor, blinking | 2087 | @cindex cursor, blinking |
| 2067 | @cindex blinking cursor | 2088 | @cindex blinking cursor |
| @@ -2105,14 +2126,6 @@ non-blinking hollow box. (For a bar cursor, it instead appears as a | |||
| 2105 | thinner bar.) To turn off cursors in non-selected windows, change the | 2126 | thinner bar.) To turn off cursors in non-selected windows, change the |
| 2106 | variable @code{cursor-in-non-selected-windows} to @code{nil}. | 2127 | variable @code{cursor-in-non-selected-windows} to @code{nil}. |
| 2107 | 2128 | ||
| 2108 | @findex hl-line-mode | ||
| 2109 | @findex global-hl-line-mode | ||
| 2110 | @cindex highlight current line | ||
| 2111 | To make the cursor even more visible, you can use HL Line mode, a | ||
| 2112 | minor mode that highlights the line containing point. Use @kbd{M-x | ||
| 2113 | hl-line-mode} to enable or disable it in the current buffer. @kbd{M-x | ||
| 2114 | global-hl-line-mode} enables or disables the same mode globally. | ||
| 2115 | |||
| 2116 | @node Line Truncation | 2129 | @node Line Truncation |
| 2117 | @section Line Truncation | 2130 | @section Line Truncation |
| 2118 | 2131 | ||