From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.bugs Subject: bug#33007: 27.0.50; Proposal for function to edit and return string Date: Thu, 28 Apr 2022 10:32:16 +0300 Organization: LINKOV.NET Message-ID: <86r15hvelj.fsf@mail.linkov.net> References: <86pnwh4je8.fsf@protected.rcdrun.com> <83bm81xl84.fsf@gnu.org> <20181011063321.GD27672@protected.rcdrun.com> <87lg74zk2k.fsf@web.de> <87v8uybp1c.fsf@gnus.org> <871qxlj293.fsf@web.de> <875ymx7ga6.fsf@gnus.org> <86pml5gp6m.fsf@mail.linkov.net> <87a6c8jhjb.fsf@gnus.org> <86czh3vp4g.fsf@mail.linkov.net> <87sfpyd8wu.fsf@gnus.org> <86wnfascft.fsf@mail.linkov.net> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="9560"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (x86_64-pc-linux-gnu) Cc: Michael Heerdegen , Jean Louis , 33007@debbugs.gnu.org To: Lars Ingebrigtsen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Apr 28 09:58:17 2022 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1njz2W-0002KD-Uy for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 28 Apr 2022 09:58:16 +0200 Original-Received: from localhost ([::1]:57066 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1njz2V-0006V1-JY for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 28 Apr 2022 03:58:15 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:33030) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1njyok-00005Y-Rg for bug-gnu-emacs@gnu.org; Thu, 28 Apr 2022 03:44:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:51281) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1njyok-0003wz-Hb for bug-gnu-emacs@gnu.org; Thu, 28 Apr 2022 03:44:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1njyok-0007VS-CE for bug-gnu-emacs@gnu.org; Thu, 28 Apr 2022 03:44:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 28 Apr 2022 07:44:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 33007 X-GNU-PR-Package: emacs Original-Received: via spool by 33007-submit@debbugs.gnu.org id=B33007.165113180528804 (code B ref 33007); Thu, 28 Apr 2022 07:44:02 +0000 Original-Received: (at 33007) by debbugs.gnu.org; 28 Apr 2022 07:43:25 +0000 Original-Received: from localhost ([127.0.0.1]:45178 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1njyo9-0007UW-1N for submit@debbugs.gnu.org; Thu, 28 Apr 2022 03:43:25 -0400 Original-Received: from relay8-d.mail.gandi.net ([217.70.183.201]:47649) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1njyo6-0007UH-Sr for 33007@debbugs.gnu.org; Thu, 28 Apr 2022 03:43:23 -0400 Original-Received: (Authenticated sender: juri@linkov.net) by mail.gandi.net (Postfix) with ESMTPSA id E6E7E1BF208; Thu, 28 Apr 2022 07:43:14 +0000 (UTC) In-Reply-To: <86wnfascft.fsf@mail.linkov.net> (Juri Linkov's message of "Wed, 27 Apr 2022 19:44:54 +0300") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:230845 Archived-At: >> 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.