[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Orgmode] Re: Frequently used files/headings
From: |
Štěpán Němec |
Subject: |
[Orgmode] Re: Frequently used files/headings |
Date: |
Mon, 10 May 2010 23:35:49 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) |
Stephan Schmitt <address@hidden> writes:
> Hi Nathan,
>
> when the lambda form is evaluated (when you press f6) the variable
> shortcut-def doesn't exist any more.
>
> The problem is that elisp doesn't support closures. See
> this info page:
> (elisp) Top > Variables > Variable Scoping > Extent
>
> As a workaraound you can save the table in a global variable with setq
> and access that variable in the lambda form.
Another way would be to use `lexical-let' from the CL package, i.e.:
(global-set-key (read-kbd-macro (second shortcut-def))
(lexical-let ((shortcut-def shortcut-def))
(lambda ()
(interactive)
(org-id-goto (third shortcut-def)))))
should do what you want.
Štěpán