GNU bug report logs - #45536
[PATCH] Pretty-print keys without <> around modifiers

Previous Next

Package: emacs;

Reported by: Mattias Engdegård <mattiase <at> acm.org>

Date: Tue, 29 Dec 2020 16:42:02 UTC

Severity: normal

Tags: fixed, patch

Fixed in version 28.1

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 45536 in the body.
You can then email your comments to 45536 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#45536; Package emacs. (Tue, 29 Dec 2020 16:42:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Mattias Engdegård <mattiase <at> acm.org>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Tue, 29 Dec 2020 16:42:02 GMT) Full text and rfc822 format available.

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

From: Mattias Engdegård <mattiase <at> acm.org>
To: bug-gnu-emacs <at> gnu.org
Subject: [PATCH] Pretty-print keys without <> around modifiers
Date: Tue, 29 Dec 2020 17:21:03 +0100
[Message part 1 (text/plain, inline)]
It is a bit inconsistent that keys are described as C-x and <return> but <C-return>. It would be more logical to write C-<return>. The key parser will happily accept either, but descriptions without modifiers in <> brackets are more legible, and the result is easier to understand and explain.

Attached is a patch which adapts the code that pretty-prints keys. This is a change for human consumption only; it seems unlikely to affect compatibility. With the patch, <C-M-backspace> is now printed as C-M-<backspace>.

I'd be happy to update the manuals accordingly, and add a NEWS entry if required.

[0001-Pretty-print-keys-without-around-modifiers.patch (application/octet-stream, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#45536; Package emacs. (Tue, 29 Dec 2020 18:34:01 GMT) Full text and rfc822 format available.

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

From: Drew Adams <drew.adams <at> oracle.com>
To: Mattias Engdegård <mattiase <at> acm.org>,
 45536 <at> debbugs.gnu.org
Subject: RE: bug#45536: [PATCH] Pretty-print keys without <> around modifiers
Date: Tue, 29 Dec 2020 10:31:45 -0800 (PST)
> It is a bit inconsistent that keys are described as C-x and <return> but <C-
> return>. It would be more logical to write C-<return>. The key parser will
> happily accept either, but descriptions without modifiers in <> brackets are
> more legible, and the result is easier to understand and explain.
> 
> Attached is a patch which adapts the code that pretty-prints keys. This is a
> change for human consumption only; it seems unlikely to affect compatibility.
> With the patch, <C-M-backspace> is now printed as C-M-<backspace>.
> 
> I'd be happy to update the manuals accordingly, and add a NEWS entry if
> required.

Related:

https://www.emacswiki.org/emacs/NaKeD

https://www.emacswiki.org/emacs/download/naked.el




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#45536; Package emacs. (Tue, 29 Dec 2020 19:51:01 GMT) Full text and rfc822 format available.

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

From: Mattias Engdegård <mattiase <at> acm.org>
To: Drew Adams <drew.adams <at> oracle.com>
Cc: 45536 <at> debbugs.gnu.org
Subject: Re: bug#45536: [PATCH] Pretty-print keys without <> around modifiers
Date: Tue, 29 Dec 2020 20:50:15 +0100
29 dec. 2020 kl. 19.31 skrev Drew Adams <drew.adams <at> oracle.com>:

> Related:
> 
> https://www.emacswiki.org/emacs/NaKeD
> 
> https://www.emacswiki.org/emacs/download/naked.el

Thank you. This proposal is not nearly as radical (or opinionated) but aims to bring back logic and consistency to the notation.
In particular, it carefully preserves round-trip compatibility with `kbd` (which remains unchanged).

It is good that you posted the links, because it indicates that more people have desired something similar, and the existence of such attempts gives some reassurance that the presented more timid patch would not cause any problems.





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#45536; Package emacs. (Tue, 29 Dec 2020 20:02:01 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Mattias Engdegård <mattiase <at> acm.org>
Cc: 45536 <at> debbugs.gnu.org
Subject: Re: bug#45536: [PATCH] Pretty-print keys without <> around modifiers
Date: Tue, 29 Dec 2020 22:01:41 +0200
> From: Mattias Engdegård <mattiase <at> acm.org>
> Date: Tue, 29 Dec 2020 17:21:03 +0100
> 
> It is a bit inconsistent that keys are described as C-x and <return> but <C-return>. It would be more logical to write C-<return>. The key parser will happily accept either, but descriptions without modifiers in <> brackets are more legible, and the result is easier to understand and explain.
> 
> Attached is a patch which adapts the code that pretty-prints keys. This is a change for human consumption only; it seems unlikely to affect compatibility. With the patch, <C-M-backspace> is now printed as C-M-<backspace>.

IMO, making this kind of changes is just asking for trouble: the gains
are null and void (I don't see why we should care about consistency
here), while the potential for breaking something out there is very
real.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#45536; Package emacs. (Tue, 29 Dec 2020 20:15:02 GMT) Full text and rfc822 format available.

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

From: Drew Adams <drew.adams <at> oracle.com>
To: Mattias Engdegård <mattiase <at> acm.org>
Cc: 45536 <at> debbugs.gnu.org
Subject: RE: bug#45536: [PATCH] Pretty-print keys without <> around modifiers
Date: Tue, 29 Dec 2020 12:14:33 -0800 (PST)
> Thank you. This proposal is not nearly as radical (or opinionated) but aims
> to bring back logic and consistency to the notation.
> In particular, it carefully preserves round-trip compatibility with `kbd`
> (which remains unchanged).

`kbd' remains unchanged with `naked.el' as well.
The library just provides function `naked' as
an addition - an alternative to `kbd'.

And `naked.el' nevertheless lets you use angle
brackets, even with its own functions, whenever
you still might want to for some reason.  It
does that with an optional arg.

And even without providing the optional arg,
`naked' accepts angle-bracketed key descriptions
on input, e.g. (naked "M-<foobar>") returns the
same thing as (naked "M-foobar"): [M-foobar].

Prior to Emacs 21, Emacs itself never bothered
with angle brackets - no need.  But someone
around the turn of the century got the idea
that Emacs could not do without them.  Now
they're apparently believed to be indispensable,
because their use is enforced.

> It is good that you posted the links, because it indicates that more people
> have desired something similar, and the existence of such attempts gives some
> reassurance that the presented more timid patch would not cause any problems.

I've desired it because I lived it prior to
Emacs 21, and I find it MUCH clearer.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#45536; Package emacs. (Tue, 29 Dec 2020 22:29:02 GMT) Full text and rfc822 format available.

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

From: Mattias Engdegård <mattiase <at> acm.org>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 45536 <at> debbugs.gnu.org
Subject: Re: bug#45536: [PATCH] Pretty-print keys without <> around modifiers
Date: Tue, 29 Dec 2020 23:27:51 +0100
[Message part 1 (text/plain, inline)]
29 dec. 2020 kl. 21.01 skrev Eli Zaretskii <eliz <at> gnu.org>:

> IMO, making this kind of changes is just asking for trouble: the gains
> are null and void (I don't see why we should care about consistency
> here), while the potential for breaking something out there is very
> real.

The gains are not null and void (or the change would not have been proposed).
There is no evidence for it being likely to break anything, but we can make the reform optional and turned off by default. That way, code for which it is desirable and safe could bind a dynamic variable during the pretty-printing.

Updated patch attached.

[0001-Pretty-print-keys-without-around-modifiers-bug-45536.patch (application/octet-stream, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#45536; Package emacs. (Wed, 30 Dec 2020 03:55:01 GMT) Full text and rfc822 format available.

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

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: Mattias Engdegård <mattiase <at> acm.org>,
 45536 <at> debbugs.gnu.org
Subject: Re: bug#45536: [PATCH] Pretty-print keys without <> around modifiers
Date: Wed, 30 Dec 2020 04:54:46 +0100
Eli Zaretskii <eliz <at> gnu.org> writes:

> IMO, making this kind of changes is just asking for trouble: the gains
> are null and void (I don't see why we should care about consistency
> here), while the potential for breaking something out there is very
> real.

I think Mattias' proposed change makes for better readability, so the
gains aren't null...  on the other hand, they aren't huge, and I share
Eli's worry about breaking something.

On the third hand, we could try this out on master for a while and see
whether anything breaks -- my guess would be that nothing will break.

On the fourth hand, I can see people asking "what's the difference
between C-<return> and <C-return>?" on Reddit for decades to come, so it
might just confuse people and waste their time.  So...  I'm leaning
towards not changing this.

I'm running out of hands here.

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




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#45536; Package emacs. (Wed, 30 Dec 2020 09:53:02 GMT) Full text and rfc822 format available.

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

From: Mattias Engdegård <mattiase <at> acm.org>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: Eli Zaretskii <eliz <at> gnu.org>, 45536 <at> debbugs.gnu.org
Subject: Re: bug#45536: [PATCH] Pretty-print keys without <> around modifiers
Date: Wed, 30 Dec 2020 10:52:37 +0100
30 dec. 2020 kl. 04.54 skrev Lars Ingebrigtsen <larsi <at> gnus.org>:

> On the third hand, we could try this out on master for a while and see
> whether anything breaks -- my guess would be that nothing will break.
> 
> On the fourth hand, I can see people asking "what's the difference
> between C-<return> and <C-return>?" on Reddit for decades to come, so it
> might just confuse people and waste their time.  So...  I'm leaning
> towards not changing this.
> 
> I'm running out of hands here.

Let me give you a hand then! The latest patch puts the change under control of a variable, defaulting to off. This should take care of your concerns for compatibility problems, as well as the possibility of confusion (which I think is minuscule).

The variable can be set permanently by users who prefer the new key binding style. It can also be bound temporarily for specific uses. It was a specific use I had in mind, but there is no reason to withhold an improvement from users in general.

Thanks for your careful reasoning. We can all agree that if we included pleasing everybody on Reddit in our design criteria, no progress would ever be made.





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#45536; Package emacs. (Thu, 31 Dec 2020 04:36:02 GMT) Full text and rfc822 format available.

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

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Mattias Engdegård <mattiase <at> acm.org>
Cc: Eli Zaretskii <eliz <at> gnu.org>, 45536 <at> debbugs.gnu.org
Subject: Re: bug#45536: [PATCH] Pretty-print keys without <> around modifiers
Date: Thu, 31 Dec 2020 05:35:43 +0100
Mattias Engdegård <mattiase <at> acm.org> writes:

> Let me give you a hand then! The latest patch puts the change under
> control of a variable, defaulting to off. This should take care of
> your concerns for compatibility problems, as well as the possibility
> of confusion (which I think is minuscule).

The confusion problem is still present, though -- people will see
different ways of representing keystrokes (in examples on the web,
etc). 

> The variable can be set permanently by users who prefer the new key
> binding style. It can also be bound temporarily for specific uses. It
> was a specific use I had in mind, but there is no reason to withhold
> an improvement from users in general.

What's the specific use case?

> Thanks for your careful reasoning. We can all agree that if we
> included pleasing everybody on Reddit in our design criteria, no
> progress would ever be made.

I wasn't worried about pleasing anybody -- I just want to avoid
unnecessary confusion. 

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




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#45536; Package emacs. (Thu, 31 Dec 2020 10:00:02 GMT) Full text and rfc822 format available.

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

From: Mattias Engdegård <mattiase <at> acm.org>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: Eli Zaretskii <eliz <at> gnu.org>, 45536 <at> debbugs.gnu.org
Subject: Re: bug#45536: [PATCH] Pretty-print keys without <> around modifiers
Date: Thu, 31 Dec 2020 10:59:39 +0100
31 dec. 2020 kl. 05.35 skrev Lars Ingebrigtsen <larsi <at> gnus.org>:

> The confusion problem is still present, though -- people will see
> different ways of representing keystrokes (in examples on the web,
> etc). 

Let's not make a mole out of a molehill -- it will be all right. After all, the change is for the better.
Surely we must be able to correct past mistakes?

Remember that this is not a new notation -- 'kbd' has always accepted it, and I'm sure that .emacs files the world over contain instances of it. The manual uses it a bit everywhere, and rightly so. I'm quite sure that nobody ever got confused by it.

Actually it makes sense to let the logical notation be the default, doesn't it? There's no harm in trying it on master.

> What's the specific use case?

The NS port renders <backspace> as the backspace symbol (etc), by convention for that platform. This is done by string replacement and won't work if the key is <M-backspace> instead of M-<backspace>.

Of course we can add messy code to correct for this, but why do that locally in the NS port for this specific purpose when everyone could benefit from a clearer notation in the first place?





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#45536; Package emacs. (Thu, 31 Dec 2020 12:41:02 GMT) Full text and rfc822 format available.

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

From: Mattias Engdegård <mattiase <at> acm.org>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: Eli Zaretskii <eliz <at> gnu.org>, 45536 <at> debbugs.gnu.org
Subject: Re: bug#45536: [PATCH] Pretty-print keys without <> around modifiers
Date: Thu, 31 Dec 2020 13:29:47 +0100
31 dec. 2020 kl. 10.59 skrev Mattias Engdegård <mattiase <at> acm.org>:

> The manual uses it a bit everywhere, and rightly so.

Correction: the manual uses the logical notation almost exclusively.
Perhaps the Reddit crowd has been fuming about this for decades, I wouldn't know.





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#45536; Package emacs. (Fri, 01 Jan 2021 10:47:02 GMT) Full text and rfc822 format available.

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

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Mattias Engdegård <mattiase <at> acm.org>
Cc: Eli Zaretskii <eliz <at> gnu.org>, 45536 <at> debbugs.gnu.org
Subject: Re: bug#45536: [PATCH] Pretty-print keys without <> around modifiers
Date: Fri, 01 Jan 2021 11:46:00 +0100
Mattias Engdegård <mattiase <at> acm.org> writes:

> 31 dec. 2020 kl. 10.59 skrev Mattias Engdegård <mattiase <at> acm.org>:
>
>> The manual uses it a bit everywhere, and rightly so.
>
> Correction: the manual uses the logical notation almost exclusively.
> Perhaps the Reddit crowd has been fuming about this for decades, I
> wouldn't know.

The only instance I could find of "M-<[a-z]" was this from the manual?

(kbd "C-M-<down>") @result{} [C-M-down]

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




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#45536; Package emacs. (Fri, 01 Jan 2021 11:52:01 GMT) Full text and rfc822 format available.

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

From: Mattias Engdegård <mattiase <at> acm.org>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: Eli Zaretskii <eliz <at> gnu.org>, 45536 <at> debbugs.gnu.org
Subject: Re: bug#45536: [PATCH] Pretty-print keys without <> around modifiers
Date: Fri, 1 Jan 2021 12:51:32 +0100
[Message part 1 (text/plain, inline)]
1 jan. 2021 kl. 11.46 skrev Lars Ingebrigtsen <larsi <at> gnus.org>:

> The only instance I could find of "M-<[a-z]" was this from the manual?

Thank you for double-checking! But there are more modifiers than Meta, and there is also @key{...} which expands to <...>.
Here are my grep results:

[logical-style-in-manual.log (application/octet-stream, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#45536; Package emacs. (Fri, 01 Jan 2021 11:55:02 GMT) Full text and rfc822 format available.

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

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Mattias Engdegård <mattiase <at> acm.org>
Cc: Eli Zaretskii <eliz <at> gnu.org>, 45536 <at> debbugs.gnu.org
Subject: Re: bug#45536: [PATCH] Pretty-print keys without <> around modifiers
Date: Fri, 01 Jan 2021 12:54:40 +0100
Mattias Engdegård <mattiase <at> acm.org> writes:

> Thank you for double-checking! But there are more modifiers than Meta,
> and there is also @key{...} which expands to <...>.

Oh, right.  Well, if the manual displays these keys as M-<foo> etc, then
I withdraw all my objections based on possible confusion -- this change
would make things less confusing.  So I'm leaning towards applying the
change and then see whether this breaks anything for anybody.

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




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#45536; Package emacs. (Fri, 01 Jan 2021 12:01:01 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: mattiase <at> acm.org, 45536 <at> debbugs.gnu.org
Subject: Re: bug#45536: [PATCH] Pretty-print keys without <> around modifiers
Date: Fri, 01 Jan 2021 14:00:24 +0200
> From: Lars Ingebrigtsen <larsi <at> gnus.org>
> Cc: Eli Zaretskii <eliz <at> gnu.org>,  45536 <at> debbugs.gnu.org
> Date: Fri, 01 Jan 2021 11:46:00 +0100
> 
> Mattias Engdegård <mattiase <at> acm.org> writes:
> 
> > 31 dec. 2020 kl. 10.59 skrev Mattias Engdegård <mattiase <at> acm.org>:
> >
> >> The manual uses it a bit everywhere, and rightly so.
> >
> > Correction: the manual uses the logical notation almost exclusively.
> > Perhaps the Reddit crowd has been fuming about this for decades, I
> > wouldn't know.
> 
> The only instance I could find of "M-<[a-z]" was this from the manual?
> 
> (kbd "C-M-<down>") @result{} [C-M-down]

What the manual uses is the format makeinfo emits for keys and key
sequences in the Info format.  It is only very loosely related to the
way we format key sequences in Emacs.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#45536; Package emacs. (Fri, 01 Jan 2021 12:11:02 GMT) Full text and rfc822 format available.

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

From: Mattias Engdegård <mattiase <at> acm.org>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: Lars Ingebrigtsen <larsi <at> gnus.org>, 45536 <at> debbugs.gnu.org
Subject: Re: bug#45536: [PATCH] Pretty-print keys without <> around modifiers
Date: Fri, 1 Jan 2021 13:10:28 +0100
1 jan. 2021 kl. 13.00 skrev Eli Zaretskii <eliz <at> gnu.org>:

> What the manual uses is the format makeinfo emits for keys and key
> sequences in the Info format.  It is only very loosely related to the
> way we format key sequences in Emacs.

But it is what users see when they read the manual in Info, so clearly they cannot be surprised or confused by it.

When the manual seeks to make an explicit example (with '<' instead of @key), it uses the logical style as well. See the examples used to illustrate the manual entry for the 'kbd' function itself.





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#45536; Package emacs. (Fri, 01 Jan 2021 12:29:02 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Mattias Engdegård <mattiase <at> acm.org>
Cc: larsi <at> gnus.org, 45536 <at> debbugs.gnu.org
Subject: Re: bug#45536: [PATCH] Pretty-print keys without <> around modifiers
Date: Fri, 01 Jan 2021 14:28:16 +0200
> From: Mattias Engdegård <mattiase <at> acm.org>
> Date: Fri, 1 Jan 2021 13:10:28 +0100
> Cc: Lars Ingebrigtsen <larsi <at> gnus.org>, 45536 <at> debbugs.gnu.org
> 
> 1 jan. 2021 kl. 13.00 skrev Eli Zaretskii <eliz <at> gnu.org>:
> 
> > What the manual uses is the format makeinfo emits for keys and key
> > sequences in the Info format.  It is only very loosely related to the
> > way we format key sequences in Emacs.
> 
> But it is what users see when they read the manual in Info, so clearly they cannot be surprised or confused by it.

The users also see that in Info manuals that have nothing to do with
Emacs, so their surprise, if it exists, is misguided, and if they use
what's in the manual to request that Emacs behaves the same, those
requests are misdirected.

Besides, your suggested changes don't produce results that are 100%
identical with what's in Info manuals, either, so how would you
explain the differences to those users?

> When the manual seeks to make an explicit example (with '<' instead of @key), it uses the logical style as well. See the examples used to illustrate the manual entry for the 'kbd' function itself.

That's the tiny minority of the examples you show, most of them are
unrelated to 'kbd'.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#45536; Package emacs. (Fri, 01 Jan 2021 12:44:02 GMT) Full text and rfc822 format available.

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

From: Mattias Engdegård <mattiase <at> acm.org>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: larsi <at> gnus.org, 45536 <at> debbugs.gnu.org
Subject: Re: bug#45536: [PATCH] Pretty-print keys without <> around modifiers
Date: Fri, 1 Jan 2021 13:43:17 +0100
1 jan. 2021 kl. 13.28 skrev Eli Zaretskii <eliz <at> gnu.org>:

>> But it is what users see when they read the manual in Info, so clearly they cannot be surprised or confused by it.
> 
> The users also see that in Info manuals that have nothing to do with
> Emacs, so their surprise, if it exists, is misguided, and if they use
> what's in the manual to request that Emacs behaves the same, those
> requests are misdirected.

I'm not sure what you mean by this paragraph... but it sounds like we agree, which of course makes me happy!

> Besides, your suggested changes don't produce results that are 100%
> identical with what's in Info manuals, either, so how would you
> explain the differences to those users?

Why do they have to be 100 % identical? That is not the reason for the change. The the manual was brought up to illustrate that the logical style is not foreign or confusing at all. Naturally I shall perform any corrections necessary in the documentation. As we have seen, this will not be much work.

> That's the tiny minority of the examples you show, most of them are
> unrelated to 'kbd'.

Which was precisely my point. The vast majority uses something like C-@key{...}. No change required here.





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#45536; Package emacs. (Fri, 01 Jan 2021 12:56:02 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Mattias Engdegård <mattiase <at> acm.org>
Cc: larsi <at> gnus.org, 45536 <at> debbugs.gnu.org
Subject: Re: bug#45536: [PATCH] Pretty-print keys without <> around modifiers
Date: Fri, 01 Jan 2021 14:54:46 +0200
> From: Mattias Engdegård <mattiase <at> acm.org>
> Date: Fri, 1 Jan 2021 13:43:17 +0100
> Cc: larsi <at> gnus.org, 45536 <at> debbugs.gnu.org
> 
> > Besides, your suggested changes don't produce results that are 100%
> > identical with what's in Info manuals, either, so how would you
> > explain the differences to those users?
> 
> Why do they have to be 100 % identical?

Because you use the differences that exist now as argument for the
change you proposed.  If the differences between what we have in Info
and what we have in describe-key are not important, then let's stop
using what the Info manual shows in this discussion.

> Naturally I shall perform any corrections necessary in the documentation. As we have seen, this will not be much work.

What do you mean?  The way @key and @kbd are rendered in an Info
manual are completely outside our control.

> > That's the tiny minority of the examples you show, most of them are
> > unrelated to 'kbd'.
> 
> Which was precisely my point. The vast majority uses something like C-@key{...}. No change required here.

But @key doesn't produce what your changes will produce, not exactly
anyway.  So why we are talking about @key as something related to the
issue at hand?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#45536; Package emacs. (Fri, 01 Jan 2021 13:31:02 GMT) Full text and rfc822 format available.

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

From: Mattias Engdegård <mattiase <at> acm.org>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: larsi <at> gnus.org, 45536 <at> debbugs.gnu.org
Subject: Re: bug#45536: [PATCH] Pretty-print keys without <> around modifiers
Date: Fri, 1 Jan 2021 14:29:53 +0100
1 jan. 2021 kl. 13.54 skrev Eli Zaretskii <eliz <at> gnu.org>:

>> Why do they have to be 100 % identical?
> 
> Because you use the differences that exist now as argument for the
> change you proposed.  If the differences between what we have in Info
> and what we have in describe-key are not important, then let's stop
> using what the Info manual shows in this discussion.

We have been talking past one another; I am partly to blame. Please allow me to recap:

It was suggested earlier in the discussion that people might be confused about the meaning of M-<return> and that it therefore would be better to keep the old style <M-return> despite its shortcomings. The Info manual's apparent and pervasive use of the logical style indicates that such concerns are unlikely to be well-founded.

It is not an argument about how the manual (in any format) should present key bindings. Nor is the Info manual's style the reason for the change; it merely supports the claim that the logical style is well-understood and not controversial in the least.

The improvement demands no change from the users at all. Their code and init files will continue to work as before. They will occasionally see keys pretty-printed in a more logical way, in help screens and menus. It is not a momentous change but there is benefit, and no harm.





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#45536; Package emacs. (Fri, 01 Jan 2021 13:36:01 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Mattias Engdegård <mattiase <at> acm.org>
Cc: larsi <at> gnus.org, 45536 <at> debbugs.gnu.org
Subject: Re: bug#45536: [PATCH] Pretty-print keys without <> around modifiers
Date: Fri, 01 Jan 2021 15:34:54 +0200
> From: Mattias Engdegård <mattiase <at> acm.org>
> Date: Fri, 1 Jan 2021 14:29:53 +0100
> Cc: larsi <at> gnus.org, 45536 <at> debbugs.gnu.org
> 
> It was suggested earlier in the discussion that people might be confused about the meaning of M-<return> and that it therefore would be better to keep the old style <M-return> despite its shortcomings. The Info manual's apparent and pervasive use of the logical style indicates that such concerns are unlikely to be well-founded.
> 
> It is not an argument about how the manual (in any format) should present key bindings. Nor is the Info manual's style the reason for the change; it merely supports the claim that the logical style is well-understood and not controversial in the least.

I therefore suggest not to mention the Info manual's representation of
key sequences in this discussion at all.  The Info rendering of key
sequences is almost entirely unrelated to what Emacs does, and can
only confuse and muddy the waters (as it did here).




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#45536; Package emacs. (Fri, 01 Jan 2021 19:43:01 GMT) Full text and rfc822 format available.

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

From: Drew Adams <drew.adams <at> oracle.com>
To: Lars Ingebrigtsen <larsi <at> gnus.org>, Mattias Engdegård
 <mattiase <at> acm.org>
Cc: 45536 <at> debbugs.gnu.org
Subject: RE: bug#45536: [PATCH] Pretty-print keys without <> around modifiers
Date: Fri, 1 Jan 2021 11:41:21 -0800 (PST)
> The only instance I could find of "M-<[a-z]" was this from the manual?
> (kbd "C-M-<down>") @result{} [C-M-down]

Which manual are we talking about?  And are we
talking about Info or a printed manual?

With Info:

In the Elisp manual, I see `M-<end>' and an
occurrence of (kbd "C-M-<down>").

In the Emacs manual, I see `C-<Delete>',
`M-<PageUp>, `M-<PageDown>', `M-<prior>',
`M-<next>', `M-<kp-8>', ...

(OK, some of those also have an uppercase
letter or a numeral.)




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#45536; Package emacs. (Sat, 02 Jan 2021 17:21:02 GMT) Full text and rfc822 format available.

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

From: Mattias Engdegård <mattiase <at> acm.org>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: Eli Zaretskii <eliz <at> gnu.org>, 45536 <at> debbugs.gnu.org
Subject: Re: bug#45536: [PATCH] Pretty-print keys without <> around modifiers
Date: Sat, 2 Jan 2021 18:20:52 +0100
[Message part 1 (text/plain, inline)]
1 jan. 2021 kl. 12.54 skrev Lars Ingebrigtsen <larsi <at> gnus.org>:

> Oh, right.  Well, if the manual displays these keys as M-<foo> etc, then
> I withdraw all my objections based on possible confusion -- this change
> would make things less confusing.  So I'm leaning towards applying the
> change and then see whether this breaks anything for anybody.

Good, here is the elaborated patch, complete with NEWS entry, a few doc fixes, and tests.

[0001-Pretty-print-keys-without-around-modifiers-bug-45536.patch (application/octet-stream, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#45536; Package emacs. (Sat, 02 Jan 2021 18:26:02 GMT) Full text and rfc822 format available.

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

From: Drew Adams <drew.adams <at> oracle.com>
To: Mattias Engdegård <mattiase <at> acm.org>, Lars
 Ingebrigtsen <larsi <at> gnus.org>
Cc: 45536 <at> debbugs.gnu.org
Subject: RE: bug#45536: [PATCH] Pretty-print keys without <> around modifiers
Date: Sat, 2 Jan 2021 10:25:48 -0800 (PST)
> > Oh, right.  Well, if the manual displays these keys as M-<foo> etc, then
> > I withdraw all my objections based on possible confusion -- this change
> > would make things less confusing.  So I'm leaning towards applying the
> > change and then see whether this breaks anything for anybody.
> 
> Good, here is the elaborated patch, complete with NEWS entry, a few doc
> fixes, and tests.

FWIW, I think the manuals and Emacs help (`*Help*')
should use the same syntax.  What you see when you
ask Emacs for help interactively should be what
you see when you access the manuals.  And that same
syntax should be what `kbd' accepts as input.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#45536; Package emacs. (Tue, 05 Jan 2021 10:48:01 GMT) Full text and rfc822 format available.

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

From: Mattias Engdegård <mattiase <at> acm.org>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: Eli Zaretskii <eliz <at> gnu.org>, 45536 <at> debbugs.gnu.org
Subject: Re: bug#45536: [PATCH] Pretty-print keys without <> around modifiers
Date: Tue, 5 Jan 2021 11:47:03 +0100
2 jan. 2021 kl. 18.20 skrev Mattias Engdegård <mattiase <at> acm.org>:

> Good, here is the elaborated patch, complete with NEWS entry, a few doc fixes, and tests.

Not much of contention here; pushed. As always, I'm happy to carry out any necessary changes.





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#45536; Package emacs. (Tue, 05 Jan 2021 10:53:01 GMT) Full text and rfc822 format available.

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

From: Mattias Engdegård <mattiase <at> acm.org>
To: Drew Adams <drew.adams <at> oracle.com>
Cc: Lars Ingebrigtsen <larsi <at> gnus.org>, 45536 <at> debbugs.gnu.org
Subject: Re: bug#45536: [PATCH] Pretty-print keys without <> around modifiers
Date: Tue, 5 Jan 2021 11:52:00 +0100
2 jan. 2021 kl. 19.25 skrev Drew Adams <drew.adams <at> oracle.com>:

> FWIW, I think the manuals and Emacs help (`*Help*')
> should use the same syntax.  What you see when you
> ask Emacs for help interactively should be what
> you see when you access the manuals.  And that same
> syntax should be what `kbd' accepts as input.

Most people would probably agree to something along those lines, but then one realises that there are other constraints that forces us to compromise. In any case, this strays beyond the deliberately narrow scope of this bug.





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#45536; Package emacs. (Mon, 17 May 2021 15:12:02 GMT) Full text and rfc822 format available.

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

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Mattias Engdegård <mattiase <at> acm.org>
Cc: Eli Zaretskii <eliz <at> gnu.org>, 45536 <at> debbugs.gnu.org
Subject: Re: bug#45536: [PATCH] Pretty-print keys without <> around modifiers
Date: Mon, 17 May 2021 17:11:20 +0200
Mattias Engdegård <mattiase <at> acm.org> writes:

> 2 jan. 2021 kl. 18.20 skrev Mattias Engdegård <mattiase <at> acm.org>:
>
>> Good, here is the elaborated patch, complete with NEWS entry, a few
>> doc fixes, and tests.
>
> Not much of contention here; pushed. As always, I'm happy to carry out
> any necessary changes.

Looks good to me, and this was many months ago, so I guess there wasn't
any outpouring of protests.  :-)  So I'm closing this bug report.

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




Added tag(s) fixed. Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Mon, 17 May 2021 15:12:02 GMT) Full text and rfc822 format available.

bug marked as fixed in version 28.1, send any further explanations to 45536 <at> debbugs.gnu.org and Mattias Engdegård <mattiase <at> acm.org> Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Mon, 17 May 2021 15:12:02 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. (Tue, 15 Jun 2021 11:24:05 GMT) Full text and rfc822 format available.

This bug report was last modified 4 years and 24 days ago.

Previous Next


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