File: hl-line.el.html
Provides a local minor mode (toggled by M-x hl-line-mode) and
a global minor mode (toggled by M-x global-hl-line-mode) to
highlight, on a suitable terminal, the line on which point is. The
global mode highlights the current line in the selected window only
(except when the minibuffer window is selected). This was
implemented to satisfy a request for a feature of Lesser Editors.
The local mode is sticky: it highlights the line about the buffer's
point even if the buffer's window is not selected. Caveat: the
buffer's point might be different from the point of a non-selected
window. Set the variable hl-line-sticky-flag to nil to make the
local mode behave like the global mode.
You probably don't really want to use the global mode; if the
cursor is difficult to spot, try changing its color, relying on
blink-cursor-mode(var)/blink-cursor-mode(fun) or both. The hookery used might affect
response noticeably on a slow machine. The local mode may be
useful in non-editing buffers such as Gnus or PCL-CVS though.
An overlay is used. In the non-sticky cases, this overlay is
active only on the selected window. A hook is added to
post-command-hook to activate the overlay and move it to the line
about point.
You could make variable global-hl-line-mode(var)/global-hl-line-mode(fun) buffer-local and set
it to nil to avoid highlighting specific buffers, when the global
mode is used.
By default the whole line is highlighted. The range of highlighting
can be changed by defining an appropriate function as the
buffer-local value of hl-line-range-function.
Defined variables (14)
global-hl-line-buffers | Whether the Global HL-Line mode should be enabled in a buffer. |
global-hl-line-mode | Non-nil if Global Hl-Line mode is enabled. |
global-hl-line-mode-hook | Hook run after entering or leaving ‘global-hl-line-mode’. |
global-hl-line-overlay | Overlay used by Global-Hl-Line mode to highlight the current line. |
global-hl-line-overlays | Overlays used by Global-Hl-Line mode in various buffers. |
global-hl-line-sticky-flag | Non-nil means the Global HL-Line mode highlight appears in all windows. |
hl-line-face | Face with which to highlight the current line in Hl-Line mode. |
hl-line-mode | Non-nil if Hl-Line mode is enabled. |
hl-line-mode-hook | Hook run after entering or leaving ‘hl-line-mode’. |
hl-line-overlay | Overlay used by Hl-Line mode to highlight the current line. |
hl-line-overlay-buffer | Most recently visited buffer in which Hl-Line mode is enabled. |
hl-line-overlay-priority | Priority used on the overlay used by hl-line. |
hl-line-range-function | If non-nil, function to call to return highlight range. |
hl-line-sticky-flag | Non-nil means the HL-Line mode highlight appears in all windows. |
Defined functions (13)
Defined faces (2)
hl-line | Default face for highlighting the current line in Hl-Line mode. |
hl-line-nonselected | Face for highlighting the line with non-selected window’s point. Used only when the value of ‘global-hl-line-sticky-flag’ is ‘window’. |