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, 25 Apr 2022 18:42:53 +0300 Organization: LINKOV.NET Message-ID: <86pml5gp6m.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> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="14307"; 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 Mon Apr 25 17:47:31 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 1nj0vy-0003ad-VM for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 25 Apr 2022 17:47:30 +0200 Original-Received: from localhost ([::1]:54430 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nj0vx-0004UK-6d for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 25 Apr 2022 11:47:29 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:58650) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nj0uZ-0002zy-BS for bug-gnu-emacs@gnu.org; Mon, 25 Apr 2022 11:46:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:42006) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nj0uY-0001mM-Mf for bug-gnu-emacs@gnu.org; Mon, 25 Apr 2022 11:46:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nj0uY-0006uC-LH for bug-gnu-emacs@gnu.org; Mon, 25 Apr 2022 11:46: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, 25 Apr 2022 15:46: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.165090154026481 (code B ref 33007); Mon, 25 Apr 2022 15:46:02 +0000 Original-Received: (at 33007) by debbugs.gnu.org; 25 Apr 2022 15:45:40 +0000 Original-Received: from localhost ([127.0.0.1]:35897 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nj0uC-0006t1-Bk for submit@debbugs.gnu.org; Mon, 25 Apr 2022 11:45:40 -0400 Original-Received: from relay2-d.mail.gandi.net ([217.70.183.194]:40059) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nj0u8-0006sH-0D for 33007@debbugs.gnu.org; Mon, 25 Apr 2022 11:45:36 -0400 Original-Received: (Authenticated sender: juri@linkov.net) by mail.gandi.net (Postfix) with ESMTPSA id 6BB2A40006; Mon, 25 Apr 2022 15:45:28 +0000 (UTC) In-Reply-To: <875ymx7ga6.fsf@gnus.org> (Lars Ingebrigtsen's message of "Mon, 25 Apr 2022 09:50:41 +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:230661 Archived-At: >> One thing I found: at the end of `string-edit', you have >> >> #+begin_src emacs-lisp >> (message "%S" (substitute-command-keys >> "Type `C-c C-c' when you've finished editing")) >> #+end_src >> >> That should be "%s" - we don't want a quoted, `read'able string >> messaged. > > Yup; fixed now (and I made it use the \[...] thing at the same time). Another problem is that currently the message doesn't say how to abort changes: Type C-c C-c when you’ve finished editing whereas for example the message in Wdired is: Press C-c C-c when finished or C-c ESC to abort changes >> Second: I find the name of `read-string-from-buffer' a bit misleading - >> what about `edit-string-in-buffer'? The emphasis should be on "edit", >> because a string is already present, the function doesn't just prompt >> for a (new) string. > > Yes, I was waffling between various names while I was typing the file, > and renamed the function to read-string-from-buffer while writing the > documentation. :-) I thought it might make sense from a discovery > point of view to have something that people who looked for `read-string' > would find easily (and could plug into existing functions easily). > > But this function will probably mostly be used for editing strings, as > you point out, so `edit-string-in-buffer' sounds like a good idea to me. > Anybody have any further opinions before I rename? I think read-string-from-buffer is already a nice name, and when its default is empty string, then it really reads a new string from scratch. Also it would be nicer to pop up its buffer under the current window (need to play with display-buffer parameters), and a good example is display-buffer-below-selected (e.g. as used in dired-mark-pop-up).