emacs-devel
[Top][All Lists]
Advanced

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

Re: Resizing windows after display-buffer


From: martin rudalics
Subject: Re: Resizing windows after display-buffer
Date: Mon, 25 Apr 2011 10:35:18 +0200
User-agent: Thunderbird 2.0.0.21 (Windows/20090302)

> In my everyday use, I display the buffer I'm working on (code, a text
> file, whatever) in a full window; the only time that the window is
> split is for temporary or secondary uses; for example, help windows,
> occur output, ielm, an inferior mode (python, lisp, etc.), re-builder,
> bs-show, etc; and I make sure that the "secondary" buffer goes always
> to the bottom window and that window is resized to fit the buffer or
> have a height limit (typically about a third of the frame height).

I suppose the `fit-window-to-buffer' feature should probably depend on
the buffer name much like the options `same-window-buffer-names' or
`special-display-buffer-names' so a user can choose the set of buffers
where the windows should fit.  (I know that the variable can be made
buffer-local but the customization mechanism doesn't support that.)

> If
> I switch to the bottom window and do something that would cause the
> top window to display another buffer (multi-occur, for example, or
> selecting a new buffer from bs-show), I *don't* want the top window to
> be resized.

This means the `fit-window-to-buffer' scheme should probably only apply
to new windows.  In the case you describe we have also to observe things
like `even-window-heights' whose interaction with `fit-window-to-buffer'
seems yet unresolved at the moment.  Likely `fit-window-to-buffer'
should prevail, but should we, for example, even sizes when both buffers
are to large to fit the window?

> So, in my case, a setting that would make every display-buffer to try
> to fit is much worse than a minor mode that I can call from whatever
> mode hook I like.

We already have a defcustom like `dired-shrink-to-fit'.  Also note that
`temp-buffer-resize-mode' only applies to the `display-buffer' call
itself.  Thereafter, it does not have any effect - changing the size of
characters or the text of the buffer doesn't trigger resizing of the
window.  Hence calling this a mode seems a bit exaggerated.

So the question is why you think that activating a minor mode from a
mode hook is more convenient than setting an option from that hook.

martin



reply via email to

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