GNU bug report logs - #54173
28.0.91; Training wheels for query-replace

Previous Next

Package: emacs;

Reported by: Augusto Stoffel <arstoffel <at> gmail.com>

Date: Sat, 26 Feb 2022 22:16:02 UTC

Severity: normal

Tags: wontfix

Found in version 28.0.91

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 54173 in the body.
You can then email your comments to 54173 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#54173; Package emacs. (Sat, 26 Feb 2022 22:16:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Augusto Stoffel <arstoffel <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Sat, 26 Feb 2022 22:16:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Augusto Stoffel <arstoffel <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 28.0.91; Training wheels for query-replace
Date: Sat, 26 Feb 2022 23:15:12 +0100
[Message part 1 (text/plain, inline)]
I've been using query-replace for years but still seem to have trouble
remembering some of the keys.  How about making the help message next to
the prompt “(? for help)” customizable, with an option to include an
extra summary line?

See patch attached (note that it also slightly changes the faces of the
prompt).

[0001-Make-perform-replace-prompt-help-customizable.patch (text/x-patch, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#54173; Package emacs. (Sun, 27 Feb 2022 06:55:02 GMT) Full text and rfc822 format available.

Message #8 received at 54173 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Augusto Stoffel <arstoffel <at> gmail.com>
Cc: 54173 <at> debbugs.gnu.org
Subject: Re: bug#54173: 28.0.91; Training wheels for query-replace
Date: Sun, 27 Feb 2022 08:54:22 +0200
> From: Augusto Stoffel <arstoffel <at> gmail.com>
> Date: Sat, 26 Feb 2022 23:15:12 +0100
> 
> I've been using query-replace for years but still seem to have trouble
> remembering some of the keys.  How about making the help message next to
> the prompt “(? for help)” customizable, with an option to include an
> extra summary line?

I don't think it's a good idea to leave documentation and help to
users.  I'd rather we made the help text better, or maybe introduce a
key to display a more detailed help text.  Emacs should not have
sub-optimal help text.

Can you tell why you have trouble remembering some of the keys, and
how changing the help message could countermand that?

Thanks.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#54173; Package emacs. (Sun, 27 Feb 2022 07:56:01 GMT) Full text and rfc822 format available.

Message #11 received at 54173 <at> debbugs.gnu.org (full text, mbox):

From: Augusto Stoffel <arstoffel <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 54173 <at> debbugs.gnu.org
Subject: Re: bug#54173: 28.0.91; Training wheels for query-replace
Date: Sun, 27 Feb 2022 08:55:51 +0100
On Sun, 27 Feb 2022 at 08:54, Eli Zaretskii <eliz <at> gnu.org> wrote:

>> From: Augusto Stoffel <arstoffel <at> gmail.com>
>> Date: Sat, 26 Feb 2022 23:15:12 +0100
>> 
>> I've been using query-replace for years but still seem to have trouble
>> remembering some of the keys.  How about making the help message next to
>> the prompt “(? for help)” customizable, with an option to include an
>> extra summary line?
>
> I don't think it's a good idea to leave documentation and help to
> users.  I'd rather we made the help text better, or maybe introduce a
> key to display a more detailed help text.  Emacs should not have
> sub-optimal help text.

I agree, and I suggested a defcustom here so the user can choose between
two predefined options, the default prompt:

```
Query replacing a with b: (‘?’ for help)
```

and a two-line prompt including a little summary:

```
Query replacing a with b: (‘?’ for help)
Replace ‘y’ once, ‘.’ and exit, ‘!’ all; skip to ‘n’ next, ‘^’ previous; ‘U’ undo all.
```

(The quotation marks are not actually used, they are just representing
the help-key-keybinding face.  I choose this particular message because
it's the best I can fit in 80 columns.)

> Can you tell why you have trouble remembering some of the keys, and
> how changing the help message could countermand that?

My issue is mainly with '.' and '^'.  I rarely need those operations, so
by the time I do I already forgot the keys.  With a summary help line
below the prompt, it's very hard to not be reminded.

PS: Should we define 'p' as a synonym for '^' in 'query-replace-map'?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#54173; Package emacs. (Sun, 27 Feb 2022 08:24:02 GMT) Full text and rfc822 format available.

Message #14 received at 54173 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Augusto Stoffel <arstoffel <at> gmail.com>
Cc: 54173 <at> debbugs.gnu.org
Subject: Re: bug#54173: 28.0.91; Training wheels for query-replace
Date: Sun, 27 Feb 2022 10:23:37 +0200
> From: Augusto Stoffel <arstoffel <at> gmail.com>
> Cc: 54173 <at> debbugs.gnu.org
> Date: Sun, 27 Feb 2022 08:55:51 +0100
> 
> On Sun, 27 Feb 2022 at 08:54, Eli Zaretskii <eliz <at> gnu.org> wrote:
> 
> > I don't think it's a good idea to leave documentation and help to
> > users.  I'd rather we made the help text better, or maybe introduce a
> > key to display a more detailed help text.  Emacs should not have
> > sub-optimal help text.
> 
> I agree, and I suggested a defcustom here so the user can choose between
> two predefined options, the default prompt:
> 
> ```
> Query replacing a with b: (‘?’ for help)
> ```
> 
> and a two-line prompt including a little summary:
> 
> ```
> Query replacing a with b: (‘?’ for help)
> Replace ‘y’ once, ‘.’ and exit, ‘!’ all; skip to ‘n’ next, ‘^’ previous; ‘U’ undo all.

But since '?' produces a more detailed help, and that help text stays
on display thereafter, do we really need one more variant?  Maybe the
default message could be expanded instead (but not to such a long
text, which would resize the mini-window in many cases)?

> > Can you tell why you have trouble remembering some of the keys, and
> > how changing the help message could countermand that?
> 
> My issue is mainly with '.' and '^'.  I rarely need those operations, so
> by the time I do I already forgot the keys.  With a summary help line
> below the prompt, it's very hard to not be reminded.

Then how about adding '.' and '^' to the default help text?

> PS: Should we define 'p' as a synonym for '^' in 'query-replace-map'?

Probably.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#54173; Package emacs. (Sun, 27 Feb 2022 08:52:01 GMT) Full text and rfc822 format available.

Message #17 received at 54173 <at> debbugs.gnu.org (full text, mbox):

From: Augusto Stoffel <arstoffel <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 54173 <at> debbugs.gnu.org
Subject: Re: bug#54173: 28.0.91; Training wheels for query-replace
Date: Sun, 27 Feb 2022 09:51:42 +0100
On Sun, 27 Feb 2022 at 10:23, Eli Zaretskii <eliz <at> gnu.org> wrote:

>> From: Augusto Stoffel <arstoffel <at> gmail.com>
>> Cc: 54173 <at> debbugs.gnu.org
>> Date: Sun, 27 Feb 2022 08:55:51 +0100
>> 
>> On Sun, 27 Feb 2022 at 08:54, Eli Zaretskii <eliz <at> gnu.org> wrote:
>> 
>> > I don't think it's a good idea to leave documentation and help to
>> > users.  I'd rather we made the help text better, or maybe introduce a
>> > key to display a more detailed help text.  Emacs should not have
>> > sub-optimal help text.
>> 
>> I agree, and I suggested a defcustom here so the user can choose between
>> two predefined options, the default prompt:
>> 
>> ```
>> Query replacing a with b: (‘?’ for help)
>> ```
>> 
>> and a two-line prompt including a little summary:
>> 
>> ```
>> Query replacing a with b: (‘?’ for help)
>> Replace ‘y’ once, ‘.’ and exit, ‘!’ all; skip to ‘n’ next, ‘^’ previous; ‘U’ undo all.
>
> But since '?' produces a more detailed help, and that help text stays
> on display thereafter, do we really need one more variant?  Maybe the
> default message could be expanded instead (but not to such a long
> text, which would resize the mini-window in many cases)?

I think ‘y’ and ‘n’ are intuitive enough that they don't need a
reminder.  But mentioning the more uncommon ones (‘.’ and so on) without
talking about ‘y’ and ‘n’ is weird.

So I can't see any meaningful options between the status quo and my
suggestion above.

The way I use Emacs, this would be a perfectly fine message with no risk
of resizing the mini-window:

```
Query replacing a with b: (replace ‘y’ once, ‘.’ and exit, ‘!’ all; skip to ‘n’ next, ‘^’ previous; ‘U’ undo all; ‘?’ help)
```

One idea would be to choose between the short and long messages based on
the size of the miniwindow as well as the length regexp and replacement
text.

>> > Can you tell why you have trouble remembering some of the keys, and
>> > how changing the help message could countermand that?
>> 
>> My issue is mainly with '.' and '^'.  I rarely need those operations, so
>> by the time I do I already forgot the keys.  With a summary help line
>> below the prompt, it's very hard to not be reminded.
>
> Then how about adding '.' and '^' to the default help text?
>
>> PS: Should we define 'p' as a synonym for '^' in 'query-replace-map'?
>
> Probably.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#54173; Package emacs. (Sun, 27 Feb 2022 09:26:02 GMT) Full text and rfc822 format available.

Message #20 received at 54173 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Augusto Stoffel <arstoffel <at> gmail.com>
Cc: 54173 <at> debbugs.gnu.org
Subject: Re: bug#54173: 28.0.91; Training wheels for query-replace
Date: Sun, 27 Feb 2022 11:24:53 +0200
> From: Augusto Stoffel <arstoffel <at> gmail.com>
> Cc: 54173 <at> debbugs.gnu.org
> Date: Sun, 27 Feb 2022 09:51:42 +0100
> 
> > But since '?' produces a more detailed help, and that help text stays
> > on display thereafter, do we really need one more variant?  Maybe the
> > default message could be expanded instead (but not to such a long
> > text, which would resize the mini-window in many cases)?
> 
> I think ‘y’ and ‘n’ are intuitive enough that they don't need a
> reminder.  But mentioning the more uncommon ones (‘.’ and so on) without
> talking about ‘y’ and ‘n’ is weird.

How about the below?

  (‘y’/‘n’, ‘.’ replace & exit, ‘^’ back up, ‘?’ help)

An alternative is to have C-h and F1 temporarily show a longer line
with more commands.

> One idea would be to choose between the short and long messages based on
> the size of the miniwindow as well as the length regexp and replacement
> text.

That could also be a possibility.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#54173; Package emacs. (Sun, 27 Feb 2022 10:18:01 GMT) Full text and rfc822 format available.

Message #23 received at 54173 <at> debbugs.gnu.org (full text, mbox):

From: Augusto Stoffel <arstoffel <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 54173 <at> debbugs.gnu.org
Subject: Re: bug#54173: 28.0.91; Training wheels for query-replace
Date: Sun, 27 Feb 2022 11:17:08 +0100
[Message part 1 (text/plain, inline)]
On Sun, 27 Feb 2022 at 11:24, Eli Zaretskii <eliz <at> gnu.org> wrote:

>> From: Augusto Stoffel <arstoffel <at> gmail.com>
>> Cc: 54173 <at> debbugs.gnu.org
>> Date: Sun, 27 Feb 2022 09:51:42 +0100
>> 
>> > But since '?' produces a more detailed help, and that help text stays
>> > on display thereafter, do we really need one more variant?  Maybe the
>> > default message could be expanded instead (but not to such a long
>> > text, which would resize the mini-window in many cases)?
>> 
>> I think ‘y’ and ‘n’ are intuitive enough that they don't need a
>> reminder.  But mentioning the more uncommon ones (‘.’ and so on) without
>> talking about ‘y’ and ‘n’ is weird.
>
> How about the below?
>
>   (‘y’/‘n’, ‘.’ replace & exit, ‘^’ back up, ‘?’ help)

I find this better than the status quo.  I've attached the patch.

[0001-Expand-help-string-in-perform-replace-prompt.patch (text/x-patch, attachment)]
[Message part 3 (text/plain, inline)]

> An alternative is to have C-h and F1 temporarily show a longer line
> with more commands.
>
>> One idea would be to choose between the short and long messages based on
>> the size of the miniwindow as well as the length regexp and replacement
>> text.
>
> That could also be a possibility.

Between this and your suggestion, I'm undecided what's better.  Perhaps
this is more complicated than necessary.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#54173; Package emacs. (Sun, 27 Feb 2022 10:56:01 GMT) Full text and rfc822 format available.

Message #26 received at 54173 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Augusto Stoffel <arstoffel <at> gmail.com>
Cc: 54173 <at> debbugs.gnu.org
Subject: Re: bug#54173: 28.0.91; Training wheels for query-replace
Date: Sun, 27 Feb 2022 12:55:12 +0200
> From: Augusto Stoffel <arstoffel <at> gmail.com>
> Cc: 54173 <at> debbugs.gnu.org
> Date: Sun, 27 Feb 2022 11:17:08 +0100
> 
> >> I think ‘y’ and ‘n’ are intuitive enough that they don't need a
> >> reminder.  But mentioning the more uncommon ones (‘.’ and so on) without
> >> talking about ‘y’ and ‘n’ is weird.
> >
> > How about the below?
> >
> >   (‘y’/‘n’, ‘.’ replace & exit, ‘^’ back up, ‘?’ help)
> 
> I find this better than the status quo.  I've attached the patch.

Thanks.  Let's wait a bit to let others chime in and express their
opinions.

> >> One idea would be to choose between the short and long messages based on
> >> the size of the miniwindow as well as the length regexp and replacement
> >> text.
> >
> > That could also be a possibility.
> 
> Between this and your suggestion, I'm undecided what's better.  Perhaps
> this is more complicated than necessary.

Let's see what others think.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#54173; Package emacs. (Sun, 27 Feb 2022 13:11:02 GMT) Full text and rfc822 format available.

Message #29 received at 54173 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Augusto Stoffel <arstoffel <at> gmail.com>
Cc: 54173 <at> debbugs.gnu.org, Eli Zaretskii <eliz <at> gnu.org>
Subject: Re: bug#54173: 28.0.91; Training wheels for query-replace
Date: Sun, 27 Feb 2022 14:10:13 +0100
Augusto Stoffel <arstoffel <at> gmail.com> writes:

> -    (define-key map "y" 'act)
> -    (define-key map "n" 'skip)
>      (define-key map "Y" 'act)
> +    (define-key map "y" 'act)
>      (define-key map "N" 'skip)
> -    (define-key map "e" 'edit-replacement)
> +    (define-key map "n" 'skip)
>      (define-key map "E" 'edit-replacement)
> +    (define-key map "e" 'edit-replacement)

This seems unrelated, and just moves bindings around?

>> >   (‘y’/‘n’, ‘.’ replace & exit, ‘^’ back up, ‘?’ help)
>> 
>> I find this better than the status quo.  I've attached the patch.
>
> Thanks.  Let's wait a bit to let others chime in and express their
> opinions.

I'm not sure I understood the patch.  Is the proposal to append all that
to "Query replacing foo with bar"?  It'll make prompts commonly be
longer than a line, and it's pretty noisy, so if that's the proposal,
I'm against it.

The help is on `?', so I don't see the point, either.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#54173; Package emacs. (Sun, 27 Feb 2022 13:47:01 GMT) Full text and rfc822 format available.

Message #32 received at 54173 <at> debbugs.gnu.org (full text, mbox):

From: Augusto Stoffel <arstoffel <at> gmail.com>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: 54173 <at> debbugs.gnu.org, Eli Zaretskii <eliz <at> gnu.org>
Subject: Re: bug#54173: 28.0.91; Training wheels for query-replace
Date: Sun, 27 Feb 2022 14:46:18 +0100
On Sun, 27 Feb 2022 at 14:10, Lars Ingebrigtsen <larsi <at> gnus.org> wrote:

> Augusto Stoffel <arstoffel <at> gmail.com> writes:
>
>> -    (define-key map "y" 'act)
>> -    (define-key map "n" 'skip)
>>      (define-key map "Y" 'act)
>> +    (define-key map "y" 'act)
>>      (define-key map "N" 'skip)
>> -    (define-key map "e" 'edit-replacement)
>> +    (define-key map "n" 'skip)
>>      (define-key map "E" 'edit-replacement)
>> +    (define-key map "e" 'edit-replacement)
>
> This seems unrelated, and just moves bindings around?

This is so that 'substitute-command-keys' pick up the right key for each
command, that is, the lower cased ones.

>>> >   (‘y’/‘n’, ‘.’ replace & exit, ‘^’ back up, ‘?’ help)
>>> 
>>> I find this better than the status quo.  I've attached the patch.
>>
>> Thanks.  Let's wait a bit to let others chime in and express their
>> opinions.
>
> I'm not sure I understood the patch.  Is the proposal to append all that
> to "Query replacing foo with bar"?  It'll make prompts commonly be
> longer than a line, and it's pretty noisy, so if that's the proposal,
> I'm against it.

Well, yes, that's the proposal...

At least now that string is a defvar that you can set to nil if you want
to save some columns :-)

> The help is on `?', so I don't see the point, either.

I think it's just nice to have a constant reminder of ‘.’ and ‘^’.  Of
course I'll remember them after all this discussion, but until now I
could never quite recall them when the occasion arose.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#54173; Package emacs. (Sun, 27 Feb 2022 16:12:02 GMT) Full text and rfc822 format available.

Message #35 received at 54173 <at> debbugs.gnu.org (full text, mbox):

From: Drew Adams <drew.adams <at> oracle.com>
To: Eli Zaretskii <eliz <at> gnu.org>, Augusto Stoffel <arstoffel <at> gmail.com>
Cc: "54173 <at> debbugs.gnu.org" <54173 <at> debbugs.gnu.org>
Subject: RE: [External] : bug#54173: 28.0.91; Training wheels for query-replace
Date: Sun, 27 Feb 2022 16:11:33 +0000
> > > How about the below?
> > >
> > >   (‘y’/‘n’, ‘.’ replace & exit, ‘^’ back up, ‘?’ help)
> >
> > I find this better than the status quo.  I've attached the patch.
> 
> Thanks.  Let's wait a bit to let others chime in and express their
> opinions.

Just a quick nit about the proposed prompt text.  (Not
commenting on the rest of your exchange; you seem to
be discussing it fruitfully.)

My comment on that text: The clauses separated by
commas each show a key followed by a brief description
of what the key does.  _Except_ for "`y'/`n'".  It's
not necessarily obvious what the y/n behaviors are.

And even if you think the y/n behaviors are obvious,
it's not so easy to parse the message, splitting it
properly at commas - especially given the inconsistent
treatment of y/n.

1. Consider adding at least some text after `y'/`n'
(maybe "replace this" or just "this" or just "here"?).

2. I wonder if it also might be clearer to drop the
quotes, add a colon, and perhaps to use a semicolon
or slash as separator:

(y/n: replace here / .: replace & exit / ^: back up / ?: help)

versus

(‘y’/‘n’ <what?>, ‘.’ replace & exit, ‘^’ back up, ‘?’ help)

Just a suggestion, to consider both y/n action and
better separation.  You may well find other/better
ways to address those two questions.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#54173; Package emacs. (Thu, 03 Mar 2022 16:43:02 GMT) Full text and rfc822 format available.

Message #38 received at 54173 <at> debbugs.gnu.org (full text, mbox):

From: Augusto Stoffel <arstoffel <at> gmail.com>
To: Juri Linkov <juri <at> linkov.net>
Cc: 54173 <at> debbugs.gnu.org, Lars Ingebrigtsen <larsi <at> gnus.org>,
 Eli Zaretskii <eliz <at> gnu.org>, Drew Adams <drew.adams <at> oracle.com>
Subject: Re: bug#54173: 28.0.91; Training wheels for query-replace
Date: Thu, 03 Mar 2022 17:41:55 +0100
>> I'm not sure I understood the patch.  Is the proposal to append all that
>> to "Query replacing foo with bar"?  It'll make prompts commonly be
>> longer than a line, and it's pretty noisy, so if that's the proposal,
>> I'm against it.
>
> Well, yes, that's the proposal...
>
> At least now that string is a defvar that you can set to nil if you want
> to save some columns :-)

I'm including Juri in this thread so maybe we can get one more opinion.

Let me also say that we could modify the patch so that the help message
remains the same, i.e., just “(? for help)”.  Then at least it's not
hardcoded anymore.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#54173; Package emacs. (Thu, 10 Mar 2022 19:26:01 GMT) Full text and rfc822 format available.

Message #41 received at 54173 <at> debbugs.gnu.org (full text, mbox):

From: Juri Linkov <juri <at> linkov.net>
To: Augusto Stoffel <arstoffel <at> gmail.com>
Cc: 54173 <at> debbugs.gnu.org, Eli Zaretskii <eliz <at> gnu.org>
Subject: Re: bug#54173: 28.0.91; Training wheels for query-replace
Date: Thu, 10 Mar 2022 21:20:17 +0200
> PS: Should we define 'p' as a synonym for '^' in 'query-replace-map'?

In my config I rebound '^' to 'C-r' to be like in isearch-mode,
so 'C-r' goes backward, 'C-s' forward, and 'M-e' is like
'isearch-edit-string':

  (define-key query-replace-map "\C-s" 'skip)
  (define-key query-replace-map "\C-r" 'backup)
  (define-key query-replace-map "\M-e" 'edit-replacement)
  (define-key query-replace-map "\M-\C-r" 'edit)




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#54173; Package emacs. (Thu, 10 Mar 2022 19:26:02 GMT) Full text and rfc822 format available.

Message #44 received at 54173 <at> debbugs.gnu.org (full text, mbox):

From: Juri Linkov <juri <at> linkov.net>
To: Augusto Stoffel <arstoffel <at> gmail.com>
Cc: 54173 <at> debbugs.gnu.org, Lars Ingebrigtsen <larsi <at> gnus.org>,
 Eli Zaretskii <eliz <at> gnu.org>, Drew Adams <drew.adams <at> oracle.com>
Subject: Re: bug#54173: 28.0.91; Training wheels for query-replace
Date: Thu, 10 Mar 2022 21:24:05 +0200
>>> I'm not sure I understood the patch.  Is the proposal to append all that
>>> to "Query replacing foo with bar"?  It'll make prompts commonly be
>>> longer than a line, and it's pretty noisy, so if that's the proposal,
>>> I'm against it.
>>
>> Well, yes, that's the proposal...
>>
>> At least now that string is a defvar that you can set to nil if you want
>> to save some columns :-)
>
> I'm including Juri in this thread so maybe we can get one more opinion.
>
> Let me also say that we could modify the patch so that the help message
> remains the same, i.e., just “(? for help)”.  Then at least it's not
> hardcoded anymore.

Please don't change the default succinct prompt.

If you think someone might want to display reminders for some rarely used
keys, then a variable with a help string would be fine.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#54173; Package emacs. (Thu, 10 Mar 2022 19:30:02 GMT) Full text and rfc822 format available.

Message #47 received at 54173 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Juri Linkov <juri <at> linkov.net>
Cc: 54173 <at> debbugs.gnu.org, Eli Zaretskii <eliz <at> gnu.org>,
 Augusto Stoffel <arstoffel <at> gmail.com>, Drew Adams <drew.adams <at> oracle.com>
Subject: Re: bug#54173: 28.0.91; Training wheels for query-replace
Date: Thu, 10 Mar 2022 20:28:49 +0100
Juri Linkov <juri <at> linkov.net> writes:

> If you think someone might want to display reminders for some rarely used
> keys, then a variable with a help string would be fine.

I think the likelihood of a user customising such a string is pretty
much nil -- if they're able to formulate a longer help string here, then
they'll remember the options they typed out.

So I don't think a variable here would be generally useful.  If the
original submitter wants to change the string for themselves, they can
advise the function for themselves, or use `set-message-function' to
alter the prompt.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#54173; Package emacs. (Thu, 10 Mar 2022 19:56:01 GMT) Full text and rfc822 format available.

Message #50 received at 54173 <at> debbugs.gnu.org (full text, mbox):

From: Juri Linkov <juri <at> linkov.net>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: 54173 <at> debbugs.gnu.org, Eli Zaretskii <eliz <at> gnu.org>,
 Augusto Stoffel <arstoffel <at> gmail.com>, Drew Adams <drew.adams <at> oracle.com>
Subject: Re: bug#54173: 28.0.91; Training wheels for query-replace
Date: Thu, 10 Mar 2022 21:44:32 +0200
>> If you think someone might want to display reminders for some rarely used
>> keys, then a variable with a help string would be fine.
>
> I think the likelihood of a user customising such a string is pretty
> much nil -- if they're able to formulate a longer help string here, then
> they'll remember the options they typed out.

I agree that probability tends to zero.

OTOH, there is already such a const:

  (defconst query-replace-help "...")

that is used in:

  (substitute-command-keys query-replace-help)

So the same way a new const makes sense:

  (defconst query-replace-prompt-help "(\\<query-replace-map>\\[help] for help) ")

to be used like this:

  (substitute-command-keys query-replace-prompt-help)

that will help Augusto to solve this problem.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#54173; Package emacs. (Sat, 12 Mar 2022 17:00:02 GMT) Full text and rfc822 format available.

Message #53 received at 54173 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Juri Linkov <juri <at> linkov.net>
Cc: 54173 <at> debbugs.gnu.org, Eli Zaretskii <eliz <at> gnu.org>,
 Augusto Stoffel <arstoffel <at> gmail.com>, Drew Adams <drew.adams <at> oracle.com>
Subject: Re: bug#54173: 28.0.91; Training wheels for query-replace
Date: Sat, 12 Mar 2022 17:58:55 +0100
Juri Linkov <juri <at> linkov.net> writes:

>> I think the likelihood of a user customising such a string is pretty
>> much nil -- if they're able to formulate a longer help string here, then
>> they'll remember the options they typed out.
>
> I agree that probability tends to zero.
>
> OTOH, there is already such a const:
>
>   (defconst query-replace-help "...")
>
> that is used in:
>
>   (substitute-command-keys query-replace-help)
>
> So the same way a new const makes sense:
>
>   (defconst query-replace-prompt-help "(\\<query-replace-map>\\[help]
> for help) ")
>
> to be used like this:
>
>   (substitute-command-keys query-replace-prompt-help)
>
> that will help Augusto to solve this problem.

I suspect that the former is just a const because people don't like to
put walls of texts inside function definitions because it makes it more
difficult to read the code, not because they thought anybody would want
to change it.

And that's not really the case with the prompt.

So I'm leaning towards us not wanting to change anything here, and I'm
therefore closing this bug report.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Added tag(s) wontfix. Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Sat, 12 Mar 2022 17:00:03 GMT) Full text and rfc822 format available.

bug closed, send any further explanations to 54173 <at> debbugs.gnu.org and Augusto Stoffel <arstoffel <at> gmail.com> Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Sat, 12 Mar 2022 17:00:03 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sun, 10 Apr 2022 11:24:08 GMT) Full text and rfc822 format available.

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

Previous Next


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