# HG changeset patch # User Gerd Moellmann # Date 980350589 0 # Node ID 04fd42105e136c9a336753e6ff36a7a276870b6f # Parent a4aec237e8862d5f0bfc1dbdd28d85430d8b2654 (tool-bar-images-pixel-height): New variable. (command-line): After loading the user's init file, when tool-bar-mode is on, increase the frame's size by some lines for the tool-bar. diff -r a4aec237e886 -r 04fd42105e13 lisp/startup.el --- a/lisp/startup.el Wed Jan 24 14:50:08 2001 +0000 +++ b/lisp/startup.el Wed Jan 24 15:36:29 2001 +0000 @@ -529,6 +529,9 @@ ("--foreground-color" . "-fg") ("--background-color" . "-bg"))) +(defconst tool-bar-images-pixel-height 24 + "Height in pixels of images in the tool bar.") + ;; Handle the X-like command line parameters "-fg", "-bg", "-name", etc. (defun tty-handle-args (args) (let ((rest nil)) @@ -758,7 +761,7 @@ (when (and (not noninteractive) (display-graphic-p) (> (frame-parameter nil 'tool-bar-lines) 0)) - (tool-bar-mode t)) + (tool-bar-mode 1)) ;; Can't do this init in defcustom because window-system isn't set. (when (and (not noninteractive) @@ -932,6 +935,23 @@ (run-hooks 'after-init-hook) + ;; When the tool-bar is on, increase the frame's height by the + ;; number of lines it usually occupies. The normal height of images + ;; in the tool bar is assumed to be `tool-bar-images-pixel-height'. + (when tool-bar-mode + (let* ((char-height (frame-char-height)) + (bar-height (+ tool-bar-images-pixel-height + tool-bar-button-margin + tool-bar-button-relief)) + (lines (/ (+ bar-height (1- char-height)) char-height))) + (set-frame-height nil (+ (frame-height) lines)))) + + ;; Now, make the frame visible. If we make it visible before this + ;; point, ugly flickering can happens because of possibly changing + ;; frame heights. Note that any message or error make the frame + ;; visible automatically. + (make-frame-visible) + ;; If *scratch* exists and init file didn't change its mode, initialize it. (if (get-buffer "*scratch*") (save-excursion