From: Mark Wooding Date: Thu, 17 Dec 2009 17:52:28 +0000 (+0000) Subject: el/dot-emacs.el: Remove menu bar from dumb terminals. X-Git-Url: https://git.distorted.org.uk/~mdw/profile/commitdiff_plain/255ee1fce8e9f11d7fa6f477033369fa47539c17?ds=sidebyside el/dot-emacs.el: Remove menu bar from dumb terminals. 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'. --- diff --git a/el/dot-emacs.el b/el/dot-emacs.el index f66b833..df15026 100644 --- a/el/dot-emacs.el +++ b/el/dot-emacs.el @@ -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.