GNU bug report logs - #20189
25.0.50; Feature request: Alternative split-window-sensibly functions

Previous Next

Package: emacs;

Reported by: Tassilo Horn <tsdh <at> gnu.org>

Date: Tue, 24 Mar 2015 09:19:01 UTC

Severity: wishlist

Found in version 25.0.50

Full log


Message #47 received at 20189 <at> debbugs.gnu.org (full text, mbox):

From: Tassilo Horn <tsdh <at> gnu.org>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 20189 <at> debbugs.gnu.org
Subject: Re: bug#20189: 25.0.50;
 Feature request: Alternative split-window-sensibly functions
Date: Thu, 26 Mar 2015 05:27:43 +0100
Eli Zaretskii <eliz <at> gnu.org> writes:

>> But for the time being, I prefer some solution which is available
>> right now and good enough for my personal preferences.  And that's
>> the point of the issue.  Window handling is extremely hard to
>> configure in Emacs with the amounts of options we have.  That's why
>> I've suggested to have a small set of alternatives one can choose
>> from without having to dig into the details of window thresholds,
>> window parameters, window combinations, etc.
>
> So how about adding 2 more parameters that we've discussed a few
> messages ago, and then come up with a logic that uses all 4 of them to
> give more "sensible" results?

With the new parameters you mean something like `window-preferred-width'
and `window-preferred-height', right?

Sounds legit to me.  In my case, I'd set the preferred width to 80 but
my preferred height is usually as high as possible or as high as needed
to fit the contents of the buffer we want to show in that new window.

Maybe it would make sense to use the values of these two variables (if
non-nil) as defaults for the `window-width' and `window-height' alist
entries of `display-buffer'.

I'm still a bit unsure how to differentiate "preferred width" from
`window-min-width'.  For me, preferred width means a lower bound for
windows with "normal" buffers.  So maybe I want to set
`window-min-width' to 80 instead of its default of 10?  But what about
special, narrow buffers such as `sr-speedbar' (speedbar shown in a
narrow window instead of an extra frame)?

To answer myself: it seems I actually want to use a minimum width of
80.  That seems to supress any splits that result in windows smaller
than 80 columns unless the width is explicitly given, e.g.,

  (setq window-min-width 80)
  (display-buffer (get-buffer "*Help*")
                  '(display-buffer-pop-up-window
                    (window-width . 10)))

still splits although the new window is just 10 columns wide.

Bye,
Tassilo




This bug report was last modified 10 years and 83 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.