[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: How to restore the layout?

From: Drew Adams
Subject: RE: How to restore the layout?
Date: Wed, 3 Jul 2013 07:08:50 -0700 (PDT)

Haven't been following this part of the thread; dunno what I missed.

> No.  In a `fit-frame-to-buffer' function you find in my window.el

Where can I find that?

> I use a workaround with a comment going as
>            ;; When tool-bar-mode is enabled and we just created a new
>            ;; frame, reserve lines for toolbar resizing.  Needed
>            ;; because for reasons unknown to me Emacs (1) reserves one
>            ;; line for the toolbar when making the initial frame and
>            ;; toolbars are enabled, and (2) later adds the remaining
>            ;; lines needed.  Our code runs IN BETWEEN (1) and (2).
>            ;; YMMV when you're on a system that behaves differently.
> So this is still an unsolved mystery, probably to straighten out
> differences with external toolbar implementations.  I can look into it
> again but do not expect too much.  Drew should have experienece with
> this problem as well.

I'm afraid I don't have anything to offer here, sorry.  My frame-fitting
code pretty much side-steps handling of the tool bar (and it tries to
DTRT for multiple Emacs versions).  Here is a comment from the code:

;; `extra-lines' for minimum frame height.  Starting with Emacs 21+,
;; `set-frame-size' includes the tool-bar and the minibuffer.  For Emacs
;; without a toolkit, the one-line menu-bar is also included - add 1 line
;; for that.  Add 1 line for the minibuffer, unless it is standalone.
;; Perhaps we should also take into account a possible horizontal scroll
;; bar, but we don't do that.

To allow for the tool bar I just add
(cdr (assq 'tool-bar-lines (frame-parameters frame))) to the needed height.

A bigger problem for me is wrapped menu-bar lines (I guess the same
problem is there for a wrapped tool bar too).  This is my code comment:

;; We can't really know whether menu-bar gets wrapped.
;; Assume it wraps once.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]