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

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

Re: global-set-key with function taking arguments


From: Emanuel Berg
Subject: Re: global-set-key with function taking arguments
Date: Sun, 01 Nov 2020 12:33:25 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

William Xu wrote:

> You could define a macro wraper around: 
>
> (defmacro my-make-interactive (&rest body)
>   `(lambda ()
>      (interactive)
>      (progn ,@body)))
>
> (global-set-key (kbd "C-H-<up>") (my-make-interactive (transpose-paragraphs 
> -1)))

Well, maybe you could, but what would you gain from that?

Better to either use `lambda' or define your own function.

-- 
underground experts united
http://user.it.uu.se/~embe8573
https://dataswamp.org/~incal




reply via email to

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