help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: Eval keymapp in a macros


From: Stefan Monnier
Subject: Re: Eval keymapp in a macros
Date: Wed, 04 Aug 2021 11:37:22 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

>> * If you sacrifice a quote and a pair of braces, you can have your
>> typing saving as a simple function:
>>
>>     (my-define-keys global-map
>>       '(("C-<insert>" . term-toggle)
>>         ("<insert>" . term-toggle-eshell)
>>         …))
>
> I know, but I wish the least noise as possible :-):

In most cases, macros are best defined in 2 steps:

1- provide a function-based solution
2- provide a simple macro that expands to a call to the function-based
   solution, with a very simple massaging (typically adding a few quotes
   or wrapping with some `lambda`).

That also makes debugging easier.


        Stefan




reply via email to

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