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


View this message in rfc822 format

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: bug#33007: 27.0.50; Proposal for function to edit and return string
Date: Mon, 25 Apr 2022 18:42:53 +0300
>> 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).




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

Previous Next


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