# HG changeset patch # User Chong Yidong # Date 1223580711 0 # Node ID d26dc6b50206eeed396fe89033a5633bd71dce18 # Parent b40f8a9232b9a5bc472fa128196cd34587478127 (command-line): Enable tool-bar-mode as long as it is not suppressed by X resources, regardless of the terminal. diff -r b40f8a9232b9 -r d26dc6b50206 lisp/startup.el --- a/lisp/startup.el Thu Oct 09 19:30:47 2008 +0000 +++ b/lisp/startup.el Thu Oct 09 19:31:51 2008 +0000 @@ -898,14 +898,16 @@ (<= (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.