GNU bug report logs - #33007
27.0.50; Proposal for function to edit and return string

Previous Next

Package: emacs;

Reported by: Jean Louis <bugs <at> gnu.support>

Date: Wed, 10 Oct 2018 20:51:02 UTC

Severity: wishlist

Found in version 27.0.50

Fixed in version 29.1

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


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

From: Juri Linkov <juri <at> linkov.net>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: Michael Heerdegen <michael_heerdegen <at> web.de>, 33007 <at> debbugs.gnu.org,
 Jean Louis <bugs <at> gnu.support>
Subject: Re: bug#33007: 27.0.50; Proposal for function to edit and return
 string
Date: Thu, 28 Apr 2022 10:32:16 +0300
>> pop-to-buffer-same-window does allow customization via
>> display-buffer-alist, but -below-selected would be a better default.
>
> This is what could be used:
>
>   (pop-to-buffer (generate-new-buffer "*edit string*")
>                  '(display-buffer-below-selected
>                    (window-min-height . 10)
>                    (window-height . fit-window-to-buffer)))
>
> but currently its window-min-height has no effect.
> Maybe because of a bug?  The docstring of display-buffer-below-selected:
>
>   If ALIST contains a `window-min-height' entry, this function
>   ensures that the window used is or can become at least as high as
>   specified by that entry's value.  Note that such an entry alone
>   will not resize the window per se.  In order to do that, ALIST
>   must also contain a `window-height' entry with the same value.
>
> But still the window height is less than 10 lines.

Maybe a separate bug report is needed?  Because it seems that
the order of processing these parameters should be rather like this:

1. first set window-height with fit-window-to-buffer;
2. then check if the constraint of window-min-height is fulfilled,
   and shrink too high window.

Then 'string-edit' will insert the initial string, and
'fit-window-to-buffer' will fit the window.  If the window height
is less than 10 lines, it will enlarge to 10 lines.  But in case of
too many lines, the window height should not be more than
half of the original window.




This bug report was last modified 3 years and 15 days ago.

Previous Next


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