diff options
author | Chong Yidong <[email protected]> | 2008-10-09 19:31:51 +0000 |
---|---|---|
committer | Chong Yidong <[email protected]> | 2008-10-09 19:31:51 +0000 |
commit | 008330eadaa236adb62611f4ad12c944b2309906 (patch) | |
tree | 150789f727a525ef4ab2433574a1690369601146 | |
parent | f3af39b8023d692ae76114d34020d0585c031725 (diff) |
(command-line): Enable tool-bar-mode as long as it is not suppressed
by X resources, regardless of the terminal.
-rw-r--r-- | lisp/startup.el | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/lisp/startup.el b/lisp/startup.el index 11ab159346..0ffb6b8ffe 100644 --- a/lisp/startup.el +++ b/lisp/startup.el @@ -898,14 +898,16 @@ opening the first frame (e.g. open a connection to an X server).") (<= (frame-parameter nil 'menu-bar-lines) 0))))) (menu-bar-mode 1)) - ;; If we run as a daemon or frame was created with a tool bar, - ;; switch tool-bar-mode on. - (when (or (daemonp) - (not (or noninteractive - emacs-basic-display - (not (display-graphic-p)) - (<= (frame-parameter nil 'tool-bar-lines) 0)))) - (tool-bar-mode 1)) + ;; Enable tool-bar-mode if necessary. Note that we might enable it + ;; even in tty frames, which means that there is a tool-bar if Emacs + ;; later opens a graphical frame. + (unless (or noninteractive emacs-basic-display + ;; The tool-bar-lines parameter is nil if starting on a + ;; tty; it is 0 if starting on a graphical display with + ;; the toolbar disabled via X resources. + (and (numberp (frame-parameter nil 'tool-bar-lines)) + (<= (frame-parameter nil 'tool-bar-lines) 0))) + (tool-bar-mode 1)) ;; Can't do this init in defcustom because the relevant variables ;; are not set. |