Variable: linum-mode-hook
linum-mode-hook is a customizable variable defined in linum.el.gz.
Value
(linum-mode-set-explicitly(var)/linum-mode-set-explicitly(fun))
Documentation
Hook run after entering or leaving linum-mode(var)/linum-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/linum.el.gz
;;;###autoload
(define-minor-mode linum-mode
"Toggle display of line numbers in the left margin (Linum mode).
Linum mode is a buffer-local minor mode."
:lighter "" ; for desktop.el
:append-arg-docstring t
(if linum-mode
(progn
(if linum-eager
(add-hook 'post-command-hook (if linum-delay
'linum-schedule
'linum-update-current) nil t)
(add-hook 'after-change-functions 'linum-after-change nil t))
(add-hook 'window-scroll-functions 'linum-after-scroll nil t)
;; Using both window-size-change-functions and
;; window-configuration-change-hook seems redundant. --Stef
;; (add-hook 'window-size-change-functions 'linum-after-size nil t)
(add-hook 'change-major-mode-hook 'linum-delete-overlays nil t)
(add-hook 'window-configuration-change-hook
;; FIXME: If the buffer is shown in N windows, this
;; will be called N times rather than once. We should use
;; something like linum-update-window instead.
'linum-update-current nil t)
(linum-update-current))
(remove-hook 'post-command-hook 'linum-update-current t)
(remove-hook 'post-command-hook 'linum-schedule t)
;; (remove-hook 'window-size-change-functions 'linum-after-size t)
(remove-hook 'window-scroll-functions 'linum-after-scroll t)
(remove-hook 'after-change-functions 'linum-after-change t)
(remove-hook 'window-configuration-change-hook 'linum-update-current t)
(remove-hook 'change-major-mode-hook 'linum-delete-overlays t)
(linum-delete-overlays)))