help-gnu-emacs
[Top][All Lists]
Advanced

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

Popping up a buffer of certain width without making current windows too


From: Tassilo Horn
Subject: Popping up a buffer of certain width without making current windows too narrow
Date: Tue, 26 Jul 2022 18:09:47 +0200
User-agent: mu4e 1.8.6; emacs 29.0.50

Hi all,

I have a situation where I generate a buffer and measure its contents'
width (it's a diff output which might be a side-by-side diff, so can be
probably around 160 columns wide), and then I want to display it.  I use

  (pop-to-buffer
   (current-buffer)
   `(nil (window-width. ,width)))

so that the the resulting window is wide enough to fit the buffer's
contents.

That basically works except it can easily result in an existing window
being split and the buffer of the split window now being much to narrow.

So what I'd actually would like to have is a way to say:

  1. Please show this buffer (no matter how, e.g., existing window or
     new window) and ensure the window that will show it is wide
     enough...

  2. ... while at the same time ensure that no existing window becomes
     resized narrower than, say, 70 columns.

Point 1 is solved but I have no idea about point 2.  I've tried setting
window-min-width to 70 but that didn't seem to have an effect.

As a workaround I'm currently using `display-buffer-at-bottom` as ACTION
entry which has the downside of creating a bottom window where a
side-by-side split would also do.

Bye,
Tassilo



reply via email to

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