Function: line-number-mode

line-number-mode is an interactive and byte-compiled function defined in simple.el.gz.

Signature

(line-number-mode &optional ARG)

Documentation

Toggle line number display in the mode line (Line Number mode).

This is a minor mode. If called interactively, toggle the Line-Number 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 (default-value \=line-number-mode)'.

The mode's hook is called both when the mode is enabled and when it is disabled.

Line numbers do not appear for very large buffers and buffers with very long lines; see variables line-number-display-limit and line-number-display-limit-width.

See mode-line-position-line-format for how this number is presented.

Probably introduced at or before Emacs version 28.1.

Key Bindings

Source Code

;; Defined in /usr/src/emacs/lisp/simple.el.gz
(define-minor-mode line-number-mode
  "Toggle line number display in the mode line (Line Number mode).

Line numbers do not appear for very large buffers and buffers
with very long lines; see variables `line-number-display-limit'
and `line-number-display-limit-width'.

See `mode-line-position-line-format' for how this number is
presented."
  :init-value t :global t :group 'mode-line)