ruler-mode

Homepage: https://www.gnu.org/software/emacs

Author: David Ponce

Summary

Display a ruler in the header line

Commentary

This library provides a minor mode to display a ruler in the header
line.

You can use the mouse to change the `fill-column' `comment-column',
`goal-column', `window-margins' and `tab-stop-list' settings:

[header-line (shift down-mouse-1)] set left margin end to the ruler
graduation where the mouse pointer is on.

[header-line (shift down-mouse-3)] set right margin beginning to
the ruler graduation where the mouse pointer is on.

[header-line down-mouse-2] Drag the `fill-column', `comment-column'
or `goal-column' to a ruler graduation.

[header-line (control down-mouse-1)] add a tab stop to the ruler
graduation where the mouse pointer is on.

[header-line (control down-mouse-3)] remove the tab stop at the
ruler graduation where the mouse pointer is on.

[header-line (control down-mouse-2)] or M-x
`ruler-mode-toggle-show-tab-stops' toggle showing and visually
editing `tab-stop-list' setting.  The `ruler-mode-show-tab-stops'
option controls if the ruler shows tab stops by default.

In the ruler the character `ruler-mode-current-column-char' shows
the `current-column' location, `ruler-mode-fill-column-char' shows
the `fill-column' location, `ruler-mode-comment-column-char' shows
the `comment-column' location, `ruler-mode-goal-column-char' shows
the `goal-column' and `ruler-mode-tab-stop-char' shows tab stop
locations.  Graduations in `window-margins' and `window-fringes'
areas are shown with a different foreground color.

It is also possible to customize the following characters:

- `ruler-mode-basic-graduation-char' character used for basic
  graduations ('.' by default).
- `ruler-mode-inter-graduation-char' character used for
  intermediate graduations ('!' by default).

The following faces are customizable:

- `ruler-mode-default' the ruler default face.
- `ruler-mode-fill-column' the face used to highlight the
  `fill-column' character.
- `ruler-mode-comment-column' the face used to highlight the
  `comment-column' character.
- `ruler-mode-goal-column' the face used to highlight the
  `goal-column' character.
- `ruler-mode-current-column' the face used to highlight the
  `current-column' character.
- `ruler-mode-tab-stop' the face used to highlight tab stop
  characters.
- `ruler-mode-margins' the face used to highlight graduations
  in the `window-margins' areas.
- `ruler-mode-fringes' the face used to highlight graduations
  in the `window-fringes' areas.
- `ruler-mode-column-number' the face used to highlight the
  numbered graduations.

`ruler-mode-default' inherits from the built-in `default' face.
All `ruler-mode' faces inherit from `ruler-mode-default'.

WARNING: To keep ruler graduations aligned on text columns it is
important to use the same font family and size for ruler and text
areas.

You can override the ruler format by defining an appropriate
function as the buffer-local value of `ruler-mode-ruler-function'.

Installation

To automatically display the ruler in specific major modes use:

   (add-hook '-hook 'ruler-mode)

Dependencies

Reverse dependencies