Variable: menu-bar-mode-hook
menu-bar-mode-hook is a customizable variable defined in
menu-bar.el.gz.
Value
nil
Documentation
Hook run after entering or leaving menu-bar-mode(var)/menu-bar-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/menu-bar.el.gz
(define-minor-mode menu-bar-mode
"Toggle display of a menu bar on each frame (Menu Bar mode).
This command applies to all frames that exist and frames to be
created in the future."
:init-value t
:global t
;; It's defined in C/cus-start, this stops the d-m-m macro defining it again.
:variable menu-bar-mode
;; Turn the menu-bars on all frames on or off.
(let ((val (if menu-bar-mode 1 0)))
(dolist (frame (frame-list))
(set-frame-parameter frame 'menu-bar-lines val))
;; If the user has given `default-frame-alist' a `menu-bar-lines'
;; parameter, replace it.
(if (assq 'menu-bar-lines default-frame-alist)
(setq default-frame-alist
(cons (cons 'menu-bar-lines val)
(assq-delete-all 'menu-bar-lines
default-frame-alist)))))
;; Make the message appear when Emacs is idle. We can not call message
;; directly. The minor-mode message "Menu Bar mode disabled" comes
;; after this function returns, overwriting any message we do here.
(when (and (called-interactively-p 'interactive) (not menu-bar-mode))
(run-with-idle-timer 0 nil 'message
(substitute-command-keys
"Menu Bar mode disabled. \
Use \\[menu-bar-mode] to make the menu bar appear."))))