From: Mark Wooding Date: Thu, 26 Jan 2012 09:59:13 +0000 (+0000) Subject: el/dot-emacs.el: `mdw-kick-menu-bar' function. X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~mdw/git/profile/commitdiff_plain/8183de086176387bea241107f920bc25c42f5ac3?ds=sidebyside el/dot-emacs.el: `mdw-kick-menu-bar' function. Emacs sometimes fails to populate menus, which is annoying. This seems to help. --- diff --git a/el/dot-emacs.el b/el/dot-emacs.el index f229905..503fa37 100644 --- a/el/dot-emacs.el +++ b/el/dot-emacs.el @@ -124,6 +124,14 @@ (defun maybe-autoload (symbol file &optional docstring interactivep type) (and (library-exists-p file) (autoload symbol file docstring interactivep type))) +(defun mdw-kick-menu-bar (&optional frame) + "Regenerate FRAME's menu bar so it doesn't have empty menus." + (interactive) + (unless frame (setq frame (selected-frame))) + (let ((old (frame-parameter frame 'menu-bar-lines))) + (set-frame-parameter frame 'menu-bar-lines 0) + (set-frame-parameter frame 'menu-bar-lines old))) + ;; Splitting windows. (unless (fboundp 'scroll-bar-columns)