Variable: display-line-numbers-mode-hook
display-line-numbers-mode-hook is a customizable variable defined in
display-line-numbers.el.gz.
Value
(display-line-numbers-mode-set-explicitly(var)/display-line-numbers-mode-set-explicitly(fun))
Documentation
Hook run after entering or leaving display-line-numbers-mode(var)/display-line-numbers-mode(fun).
No problems result if this variable is not bound.
add-hook automatically binds it. (This is true for all hook variables.)
Source Code
;; Defined in /usr/src/emacs/lisp/display-line-numbers.el.gz
;;;###autoload
(define-minor-mode display-line-numbers-mode
"Toggle display of line numbers in the buffer.
This uses `display-line-numbers' internally.
To change the type of line numbers displayed by default,
customize `display-line-numbers-type'. To change the type while
the mode is on, set `display-line-numbers' directly."
:lighter nil
(if display-line-numbers-mode
(progn
(when display-line-numbers-width-start
(setq display-line-numbers-width
(length (number-to-string
(+ (count-lines (point-min) (point-max))
(if (and (numberp display-line-numbers-width-start)
(> display-line-numbers-width-start 0))
display-line-numbers-width-start
0))))))
(when display-line-numbers-grow-only
(add-hook 'pre-command-hook #'display-line-numbers-update-width nil t))
(setq display-line-numbers display-line-numbers-type))
(remove-hook 'pre-command-hook #'display-line-numbers-update-width t)
(setq display-line-numbers nil)))