el/dot-emacs.el: Remove menu bar from dumb terminals.
authorMark Wooding <mdw@distorted.org.uk>
Thu, 17 Dec 2009 17:52:28 +0000 (17:52 +0000)
committerMark Wooding <mdw@distorted.org.uk>
Thu, 17 Dec 2009 17:53:51 +0000 (17:53 +0000)
Now that Emacs can work on different terminal kinds at the same time,
it seems sensible that one might want different parameters for them.  But
it won't let me.  So I have an alist indexed by `window-system'.

el/dot-emacs.el

index f66b833..df15026 100644 (file)
@@ -742,6 +742,17 @@ doesn't match any of the regular expressions in
       (run-with-idle-timer 0 nil #'x-close-connection frame-display))))
 (add-hook 'delete-frame-functions 'mdw-last-one-out-turn-off-the-lights)
 
+(defvar mdw-frame-parameters-alist
+  '((nil (menu-bar-lines . 0))))
+(defun mdw-set-frame-parameters (frame)
+  (let ((params (assq (if (fboundp 'window-system)
+                         (window-system frame)
+                       window-system)
+                     mdw-frame-parameters-alist)))
+    (when params
+      (modify-frame-parameters frame (cdr params)))))
+(add-hook 'after-make-frame-functions 'mdw-set-frame-parameters)
+
 ;;;--------------------------------------------------------------------------
 ;;; General fontification.