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: Christopher Dimech
Subject: Re: global-set-key with function taking arguments
Date: Sun, 1 Nov 2020 12:47:35 +0100

It looks to me that it is much better to define your own function so then you 
can use
describe-key.  But I have not checked it.


> Sent: Sunday, November 01, 2020 at 12:33 PM
> From: "Emanuel Berg via Users list for the GNU Emacs text editor" 
> <help-gnu-emacs@gnu.org>
> To: help-gnu-emacs@gnu.org
> Subject: Re: global-set-key with function taking arguments
>
> 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]