Next: , Previous: Text Display, Up: Display


19.14 Displaying the Cursor

You can customize the cursor's color, and whether it blinks, using the cursor Custom group (see Easy Customization). On graphical terminals, the command M-x blink-cursor-mode enables or disables the blinking of the cursor. (On text terminals, the terminal itself blinks the cursor, and Emacs has no control over it.) You can control how the cursor appears when it blinks off by setting the variable blink-cursor-alist.

Normally, the cursor appears in non-selected windows in the “off” state, with the same appearance as when the blinking cursor blinks “off”. For a box cursor, this is a hollow box; for a bar cursor, this is a thinner bar. To turn off cursors in non-selected windows, customize the variable cursor-in-non-selected-windows and assign it a nil value.

On graphical terminals, Emacs can optionally draw the block cursor as wide as the character under the cursor—for example, if the cursor is on a tab character, it would cover the full width occupied by that tab character. To enable this feature, set the variable x-stretch-cursor to a non-nil value.

If you find it hard to see the cursor, you might like HL Line mode, a minor mode that highlights the line containing point. Use M-x hl-line-mode to enable or disable it in the current buffer. M-x global-hl-line-mode enables or disables the same mode globally.