unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Stefan Kangas <stefan@marxist.se>
To: Lars Ingebrigtsen <larsi@gnus.org>
Cc: 50804@debbugs.gnu.org
Subject: bug#50804: Command substitutions for keys without keymaps
Date: Sat, 20 Nov 2021 16:05:54 +0100	[thread overview]
Message-ID: <CADwFkmnfY9e48LzBg3fKNkeSDgBXrBzoaPd4DdtSH5NDZvDsGw@mail.gmail.com> (raw)
In-Reply-To: <87czotgth0.fsf@gnus.org> (Lars Ingebrigtsen's message of "Tue, 28 Sep 2021 07:27:39 +0200")

Lars Ingebrigtsen <larsi@gnus.org> writes:

> Stefan Kangas <stefan@marxist.se> writes:
>
>> The second one will be printed as "\‘C-h‘" on old versions, which isn't
>> perfect but not too bad.  Even if the extra "\" is distracting, it is at
>> least not actively misleading...
>
> That's a good point.  So perhaps \\`C-h' does make sense in
> `substitute-command-keys'.

I found a patch of mine from March that I had forgotten about.  It uses
the syntax "\\[=y]" to mean the key "y" where, I guess, we could
stipulate that whatever comes after "=" is `key-valid-p'.

However, it breaks backwards incompatibility just as "\\[[y]]" would:

    (substitute-command-keys "\\[=k]")
    => "M-x =k"

    (substitute-command-keys "\\[[y]]")
    => "M-x [y]"

Which is just... wrong.  So either we say that, you know, don't use this
syntax in code intended for use in anything older Emacs 29, or we just
go with the new syntax \\`y`.

Given that I have a seemingly mostly working patch it should be easy to
fix it up whichever way we decide to go.  I hope.





  reply	other threads:[~2021-11-20 15:05 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-25 18:01 bug#50804: Command substitutions for keys without keymaps Stefan Kangas
2021-09-26  6:58 ` Lars Ingebrigtsen
2021-09-28  0:41   ` Stefan Kangas
2021-09-28  5:27     ` Lars Ingebrigtsen
2021-11-20 15:05       ` Stefan Kangas [this message]
2021-11-21  8:26         ` Lars Ingebrigtsen
2021-11-21 13:35           ` Stefan Kangas
2021-11-21 19:56             ` Lars Ingebrigtsen
2021-11-22  5:48               ` Stefan Kangas
2021-11-22 15:10                 ` Eli Zaretskii
2021-11-22 15:15                   ` Eli Zaretskii
2021-11-22 15:29                     ` Stefan Kangas

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CADwFkmnfY9e48LzBg3fKNkeSDgBXrBzoaPd4DdtSH5NDZvDsGw@mail.gmail.com \
    --to=stefan@marxist.se \
    --cc=50804@debbugs.gnu.org \
    --cc=larsi@gnus.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).