# HG changeset patch # User Jason Rumney # Date 982923982 0 # Node ID a1214381b9e0d153fde9fb46d331aac8eb501347 # Parent 2376959990181f888f1014769b9cdc5d1fad218a (tool-bar-originally-present): New variable. (command-line): Set it if the tool-bar is switched on at startup. diff -r 237695999018 -r a1214381b9e0 lisp/startup.el --- a/lisp/startup.el Fri Feb 23 10:25:34 2001 +0000 +++ b/lisp/startup.el Fri Feb 23 10:26:22 2001 +0000 @@ -532,6 +532,9 @@ (defconst tool-bar-images-pixel-height 24 "Height in pixels of images in the tool bar.") +(defvar tool-bar-originally-present nil + "Non-nil if tool-bars are present before user and site init files are read.") + ;; Handle the X-like command line parameters "-fg", "-bg", "-name", etc. (defun tty-handle-args (args) (let ((rest nil)) @@ -804,6 +807,18 @@ ;; use the right colors, so clear them. (clear-face-cache))) + ;; Record whether the tool-bar is present before the user and site + ;; init files are processed. frame-notice-user-settings uses this + ;; to determine if the tool-bar has been disabled by the init files, + ;; and the frame needs to be resized. + (when (fboundp 'frame-notice-user-settings) + (let ((tool-bar-lines (or (assq 'tool-bar-lines initial-frame-alist) + (assq 'tool-bar-lines default-frame-alist)))) + (setq tool-bar-originally-present + (not (or (null tool-bar-lines) + (null (cdr tool-bar-lines)) + ((eq 0 (cdr tool-bar-lines)))))))) + (run-hooks 'before-init-hook) ;; Run the site-start library if it exists. The point of this file is