chiark / gitweb /
el/dot-emacs.el: `mdw-kick-menu-bar' function.
authorMark Wooding <mdw@distorted.org.uk>
Thu, 26 Jan 2012 09:59:13 +0000 (09:59 +0000)
committerMark Wooding <mdw@distorted.org.uk>
Thu, 26 Jan 2012 09:59:13 +0000 (09:59 +0000)
Emacs sometimes fails to populate menus, which is annoying.  This seems
to help.

el/dot-emacs.el

index f2299051e16d487bf3b941ba8d8fa01b8d9d50dd..503fa37f36eaae482a65bfefe00be3d886fc798d 100644 (file)
@@ -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)