emacs-devel
[Top][All Lists]
Advanced

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

Re: Get a command by its keybinding and also respecting key translation


From: Tassilo Horn
Subject: Re: Get a command by its keybinding and also respecting key translation
Date: Tue, 14 Dec 2010 23:51:21 +0100
User-agent: KMail/1.13.5 (Linux/2.6.37-rc5+; KDE/4.5.4; x86_64; ; )

On Tuesday 14 December 2010 20:50:43 Stefan Monnier wrote:
> > (define-context-key outline-minor-mode-map
> >   (kbd "<tab>")
> >   th-outline-context-p
> >   org-cycle)
> 
> You can do it this way:
> 
>   (define-key outline-minor-mode-map
>     (kdb "<tab>")
>     `(menu-item "dummy" org-cycle
>       :filter ,(lambda (cmd)
>                  (if (th-outline-context-p) cmd))))

Hm, just for educational purposes, could you please explain the
backquoting and the comma-substitution of the lambda?  I mean, I know
that `,' in a backquote triggers evaluation, but since a lambda evals to
itself, what's the point in doing so?

Thanks!
Tassilo



reply via email to

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