Function: ruler-mode
ruler-mode is an autoloaded, interactive and byte-compiled function
defined in ruler-mode.el.gz.
Signature
(ruler-mode &optional ARG)
Documentation
Toggle display of ruler in header line (Ruler mode).
This is a minor mode. If called interactively, toggle the Ruler mode
mode. If the prefix argument is positive, enable the mode, and if it is
zero or negative, disable the mode.
If called from Lisp, toggle the mode if ARG is toggle. Enable the
mode if ARG is nil, omitted, or is a positive number. Disable the mode
if ARG is a negative number.
To check whether the minor mode is enabled in the current buffer,
evaluate the variable ruler-mode(var)/ruler-mode(fun).
The mode's hook is called both when the mode is enabled and when it is disabled.
Probably introduced at or before Emacs version 22.1.
Key Bindings
Source Code
;; Defined in /usr/src/emacs/lisp/ruler-mode.el.gz
;;;###autoload
(define-minor-mode ruler-mode
"Toggle display of ruler in header line (Ruler mode)."
:group 'ruler-mode
:variable (ruler-mode
. (lambda (enable)
(when enable
(ruler--save-header-line-format))
(setq ruler-mode enable)))
(if ruler-mode
(add-hook 'post-command-hook #'force-mode-line-update nil t)
;; When `ruler-mode' is off restore previous header line format if
;; the current one is the ruler header line format.
(when (eq header-line-format ruler-mode-header-line-format)
(kill-local-variable 'header-line-format)
(when (local-variable-p 'ruler-mode-header-line-format-old)
(setq header-line-format ruler-mode-header-line-format-old)
(kill-local-variable 'ruler-mode-header-line-format-old)))
(remove-hook 'post-command-hook #'force-mode-line-update t)))