all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Stefan Kangas <stefankangas@gmail.com>
To: Robert Pluim <rpluim@gmail.com>
Cc: Lars Ingebrigtsen <larsi@gnus.org>, 59305@debbugs.gnu.org
Subject: bug#59305: 29.0.50; keymap-global-set handling of string bindings different from global-set-key
Date: Fri, 25 Nov 2022 00:25:34 -0800	[thread overview]
Message-ID: <CADwFkmmp_nwiFSzaydskJWSi9uLS8gTJkewvF7cVBK8od6QsHg@mail.gmail.com> (raw)
In-Reply-To: <874junfonc.fsf@gmail.com>

Robert Pluim <rpluim@gmail.com> writes:

>     Stefan> I feel like the second alternative goes against the design of
>     Stefan> `keymap-global-set', where the idea explicitly was to only support a KEY
>     Stefan> argument that is `key-valid-p'.
>
> It was? If so, then it should not have been touted as the replacement
> for `global-set-key' everywhere without a big warning sign.

Yes, see the discussions about it at the time.  The same idea is there
in all the new keybinding functions.

>     Stefan> Could we perhaps introduce a new optional argument to treat the argument
>     Stefan> as a literal string?  Or if really want it to not be `key-valid-p', to
>     Stefan> at least require it to be something like '(literal "foo") ?
>
> (string-to-vector "foo") will do. But that just highlights the problem
> even more: if itʼs that simple, why canʼt `keymap-global-set' do that
> internally instead of forcing users to jump through hoops?

AFAIU, because otherwise we can't have error handling for common typos,
such as:

    (keymap-global-set "xo") ; bad, I actually want "x o"

I think catching this is more important than supporting the somewhat
nicer syntax for inserting strings with a key binding (which you can
still do by other means, as you point out).





  reply	other threads:[~2022-11-25  8:25 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-16  8:47 bug#59305: 29.0.50; keymap-global-set handling of string bindings different from global-set-key Robert Pluim
2022-11-22 16:58 ` Robert Pluim
2022-11-25  0:14 ` Stefan Kangas
2022-11-25  8:01   ` Robert Pluim
2022-11-25  8:25     ` Stefan Kangas [this message]
2022-12-15  8:42       ` Robert Pluim
2024-04-26 14:34         ` Robert Pluim
2024-05-02  9:01           ` Eli Zaretskii
2024-05-02 13:13   ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-05-06 10:03     ` Robert Pluim
2024-05-06 13:24       ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-05-06 14:34         ` Robert Pluim
2024-05-06 15:20           ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors

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

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

  git send-email \
    --in-reply-to=CADwFkmmp_nwiFSzaydskJWSi9uLS8gTJkewvF7cVBK8od6QsHg@mail.gmail.com \
    --to=stefankangas@gmail.com \
    --cc=59305@debbugs.gnu.org \
    --cc=larsi@gnus.org \
    --cc=rpluim@gmail.com \
    /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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.