Subject: bug#33007: 27.0.50; Proposal for function to edit and return string

From: Juri Linkov <[email-masked]>
Date: Wed, 27 Apr 2022 19:44:54 +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.

BTW, maybe read-string-from-buffer should have ###autoload cookie?

Also any chance to make it argument-wise compatible with read-string?
Currently:

  (read-string PROMPT &optional INITIAL-INPUT
  (read-string-from-buffer STRING &optional HELP-TEXT

HELP-TEXT could be renamed to PROMPT, and STRING really is INITIAL-INPUT.