unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* Popping up a buffer of certain width without making current windows too narrow
@ 2022-07-26 16:09 Tassilo Horn
  2022-07-26 17:24 ` Tassilo Horn
  0 siblings, 1 reply; 2+ messages in thread
From: Tassilo Horn @ 2022-07-26 16:09 UTC (permalink / raw)
  To: gnu-emacs-help

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



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-07-26 17:24 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-07-26 16:09 Popping up a buffer of certain width without making current windows too narrow Tassilo Horn
2022-07-26 17:24 ` Tassilo Horn

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).