Function: which-function-mode
which-function-mode is an autoloaded, interactive and byte-compiled
function defined in which-func.el.gz.
Signature
(which-function-mode &optional ARG)
Documentation
Toggle mode line display of current function (Which Function mode).
This is a minor mode. If called interactively, toggle the
Which-Function 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 \=which-function-mode)'.
The mode's hook is called both when the mode is enabled and when it is disabled.
Which Function mode is a global minor mode. When enabled, the current function name is continuously displayed in the mode line, in certain major modes.
Probably introduced at or before Emacs version 20.3.
Key Bindings
Aliases
which-func-mode(var)/which-func-mode(fun) (obsolete since 24.1)
Source Code
;; Defined in /usr/src/emacs/lisp/progmodes/which-func.el.gz
;; This is the name people would normally expect.
;;;###autoload
(define-minor-mode which-function-mode
"Toggle mode line display of current function (Which Function mode).
Which Function mode is a global minor mode. When enabled, the
current function name is continuously displayed in the mode line,
in certain major modes."
:global t :group 'which-func
(when (timerp which-func-update-timer)
(cancel-timer which-func-update-timer))
(setq which-func-update-timer nil)
(when which-function-mode
;;Turn it on.
(setq which-func-update-timer
(run-with-idle-timer idle-update-delay t #'which-func-update))
(dolist (buf (buffer-list))
(with-current-buffer buf (which-func-try-to-enable)))))