Emacs can display an indication of the
fill-column position (see Fill Commands). The fill-column indicator is a useful functionality especially in
prog-mode and its descendants (see Major Modes) to indicate the position of a specific column that has some special meaning for formatting the source code of a program.
To activate the fill-column indication display, use the minor modes
M-x display-fill-column-indicator-mode and
M-x global-display-fill-column-indicator-mode, which enable the indicator locally or globally, respectively.
Alternatively, you can set the two buffer-local variables
display-fill-column-indicator-character to activate the indicator and control the character used for the indication. Note that both variables must be non-
nil for the indication to be displayed. (Turning on the minor mode sets both these variables.)
There are 2 buffer local variables and a face to customize this mode:
Specifies the column number where the indicator should be set. It can take positive numerical values for the column, or the special value
t, which means that the value of the variable
fill-column will be used.
Any other value disables the indicator. The default value is
Specifies the character used for the indicator. This character can be any valid character including Unicode ones if the font supports them. The value
nil disables the indicator. When the mode is enabled through the functions
global-display-fill-column-indicator-mode, they will use the character specified by this variable, if it is non-
nil; otherwise Emacs will use the character ‘
U+2502 VERTICAL LINE’, falling back to ‘
U+2502 cannot be displayed.
Specifies the face used to display the indicator. It inherits its default values from the face
shadow, but without background color. To change the indicator color, you need only set the foreground color of this face.
On graphical displays, Emacs can indicate the buffer boundaries in the fringes. If you enable this feature, the first line and the last line are marked with angle images in the fringes. This can be combined with up and down arrow images which say whether it is possible to scroll the window.
The buffer-local variable
indicate-buffer-boundaries controls how the buffer boundaries and window scrolling is indicated in the fringes. If the value is
right, both angle and arrow bitmaps are displayed in the left or right fringe, respectively.
If value is an alist (see Association Lists in the Emacs Lisp Reference Manual), each element
(indicator . position) specifies the position of one of the indicators. The
indicator must be one of
t which specifies the default position for the indicators not present in the alist. The
position is one of
nil which specifies not to show this indicator.
((top . left) (t . right)) places the top angle bitmap in left fringe, the bottom angle bitmap in right fringe, and both arrow bitmaps in right fringe. To show just the angle bitmaps in the left fringe, but no arrow bitmaps, use
((top . left) (bottom . left)).