unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* double angled brackets in kbd: <<cmd>>
@ 2024-01-31 15:18 Olaf Rogalsky
  2024-02-01  9:11 ` Stephen Berman
  0 siblings, 1 reply; 3+ messages in thread
From: Olaf Rogalsky @ 2024-01-31 15:18 UTC (permalink / raw)
  To: help-gnu-emacs

Hi,

while reading the definition of `key-parse' I noticed, that the `kbd'
function converts strings enclosed in double angled brackets into a
the key strokes for an `execute-extended-command'.

(equal (kbd "<<my-command>>")
       (kbd "M-x my-command\r"))
-> t

I wonder, what is the use-case for these double angled brackets?

Olaf






^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: double angled brackets in kbd: <<cmd>>
  2024-01-31 15:18 double angled brackets in kbd: <<cmd>> Olaf Rogalsky
@ 2024-02-01  9:11 ` Stephen Berman
  2024-02-05 16:25   ` Olaf Rogalsky
  0 siblings, 1 reply; 3+ messages in thread
From: Stephen Berman @ 2024-02-01  9:11 UTC (permalink / raw)
  To: Olaf Rogalsky; +Cc: help-gnu-emacs

On Wed, 31 Jan 2024 16:18:09 +0100 Olaf Rogalsky <olaf.rogalsky@t-online.de> wrote:

> Hi,
>
> while reading the definition of `key-parse' I noticed, that the `kbd'
> function converts strings enclosed in double angled brackets into a
> the key strokes for an `execute-extended-command'.
>
> (equal (kbd "<<my-command>>")
>        (kbd "M-x my-command\r"))
> -> t
>
> I wonder, what is the use-case for these double angled brackets?

They're used when editing keyboard macros, cf. this bit of the doc
string of edmacro-mode: "Double angle brackets enclose command names:
<<next-line>> is shorthand for M-x next-line RET."

Steve Berman



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: double angled brackets in kbd: <<cmd>>
  2024-02-01  9:11 ` Stephen Berman
@ 2024-02-05 16:25   ` Olaf Rogalsky
  0 siblings, 0 replies; 3+ messages in thread
From: Olaf Rogalsky @ 2024-02-05 16:25 UTC (permalink / raw)
  To: Stephen Berman; +Cc: help-gnu-emacs


Stephen Berman <stephen.berman@gmx.net> writes:

> On Wed, 31 Jan 2024 16:18:09 +0100 Olaf Rogalsky <olaf.rogalsky@t-online.de> wrote:
>
>> Hi,
>>
>> while reading the definition of `key-parse' I noticed, that the `kbd'
>> function converts strings enclosed in double angled brackets into a
>> the key strokes for an `execute-extended-command'.
>>
>> (equal (kbd "<<my-command>>")
>>        (kbd "M-x my-command\r"))
>> -> t
>>
>> I wonder, what is the use-case for these double angled brackets?
>
> They're used when editing keyboard macros, cf. this bit of the doc
> string of edmacro-mode: "Double angle brackets enclose command names:
> <<next-line>> is shorthand for M-x next-line RET."
>
> Steve Berman

Ah, thanks, I didn't find this piece of information in the docs.


-- 
Olaf Rogalsky
Schwoerhausgasse 5
89073 Ulm
Germany



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2024-02-05 16:25 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-01-31 15:18 double angled brackets in kbd: <<cmd>> Olaf Rogalsky
2024-02-01  9:11 ` Stephen Berman
2024-02-05 16:25   ` Olaf Rogalsky

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).