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: Mon, 09 May 2022 21:52:50 +0300 Organization: LINKOV.NET Message-ID: <86tu9yy1vh.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> <86r15hvelj.fsf@mail.linkov.net> <87fslxpl29.fsf@gnus.org> <86ee13j348.fsf@mail.linkov.net> <87wnevavcq.fsf@gnus.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="37189"; 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 , 33007@debbugs.gnu.org, Jean Louis To: Lars Ingebrigtsen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon May 09 21:03:29 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 1no8fJ-0009ZR-NI for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 09 May 2022 21:03:29 +0200 Original-Received: from localhost ([::1]:50920 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1no8fI-0006lB-Ow for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 09 May 2022 15:03:28 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:60798) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1no8dv-0004zu-JO for bug-gnu-emacs@gnu.org; Mon, 09 May 2022 15:02:05 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:37338) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1no8du-0005GG-U2 for bug-gnu-emacs@gnu.org; Mon, 09 May 2022 15:02:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1no8du-0002om-Rh for bug-gnu-emacs@gnu.org; Mon, 09 May 2022 15:02: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: Mon, 09 May 2022 19:02: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.165212286710735 (code B ref 33007); Mon, 09 May 2022 19:02:02 +0000 Original-Received: (at 33007) by debbugs.gnu.org; 9 May 2022 19:01:07 +0000 Original-Received: from localhost ([127.0.0.1]:59464 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1no8d1-0002n5-A4 for submit@debbugs.gnu.org; Mon, 09 May 2022 15:01:07 -0400 Original-Received: from relay5-d.mail.gandi.net ([217.70.183.197]:56089) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1no8cz-0002lt-RR for 33007@debbugs.gnu.org; Mon, 09 May 2022 15:01:06 -0400 Original-Received: (Authenticated sender: juri@linkov.net) by mail.gandi.net (Postfix) with ESMTPSA id 75BAD1C0003; Mon, 9 May 2022 19:00:56 +0000 (UTC) In-Reply-To: <87wnevavcq.fsf@gnus.org> (Lars Ingebrigtsen's message of "Mon, 09 May 2022 11:49:57 +0200") 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:231777 Archived-At: >> - (pop-to-buffer-same-window (generate-new-buffer "*edit string*")) >> + (pop-to-buffer (generate-new-buffer "*edit string*") >> + '(display-buffer-below-selected >> + (window-height . (lambda (window) >> + (fit-window-to-buffer window nil 10))))) > > Shouldn't it wait to do the fitting until it's prepared the buffer? > I.e., it should create the buffer first, insert all the stuff, and then > pop to it? This is possible by moving `pop-to-buffer' to the end of the function. >> - (kill-buffer (current-buffer)) >> + (quit-window 'kill) > > I think we really want to kill the buffer? It'd be disturbing to leave > thees buffers lying around from a function call like > read-string-from-buffer. The arg `kill' of `quit-window' actually kills the buffer.