[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

New key binding syntax

From: Richard Stallman
Subject: New key binding syntax
Date: Mon, 01 Nov 2021 23:54:17 -0400

[[[ To any NSA and FBI agents reading my email: please consider    ]]]
[[[ whether defending the US Constitution against all enemies,     ]]]
[[[ foreign or domestic, requires you to follow Snowden's example. ]]]

  > Have a look at the kbd-valid-p doc string on the current trunk for a
  > definition.

I've included that text below, because now is the time
for people to look at and comment on it.

Should the syntax Emacs adopts for the next 20 years be this one?
This one with some changes?
Any other proposal?

If we use this syntax, the text we use to define it in the Emacs Lisp
Ref Manual should cover valid cases not mentioned in this text.
We don't use them in normal Emacs bindings, but they are valid
so they should be documented.

Say whether KEYS is a valid `kbd' sequence.
A `kbd' sequence is a string consisting of one and more key
strokes.  The key strokes are separated by a space character.

Each key stroke is either a single character, or the name of an
event, surrounded by angle brackets.  In addition, any key stroke
may be preceded by one or more modifier keys.  Finally, a limited
number of characters have a special shorthand syntax.

Here's some example key sequences.

  \"f\"           (the key 'f')
  \"S o m\"       (a three key sequence of the keys 'S', 'o' and 'm')
  \"C-c o\"       (a two key sequence of the keys 'c' with the control modifier
                 and then the key 'o')
  \"H-<left>\"    (the key named \"left\" with the hyper modifier)
  \"M-RET\"       (the \"return\" key with a meta modifier)
  \"C-M-<space>\" (the \"space\" key with both the control and meta modifiers)

These are the characters that have shorthand syntax:

Modifiers have to be specified in this order:


which is


Dr Richard Stallman (https://stallman.org)
Chief GNUisance of the GNU Project (https://gnu.org)
Founder, Free Software Foundation (https://fsf.org)
Internet Hall-of-Famer (https://internethalloffame.org)

reply via email to

[Prev in Thread] Current Thread [Next in Thread]