Found another solution with lexical-let
(defun foo (n)
(lexical-let ((n n)) #'(lambda() n)))
(funcall (foo 10)) ;; => 10
More Related Contents:
- Why does an elisp local variable keep its value in this case?
- eval-after-load vs. mode hook
- Using tramp with EmacsW32 and cygwin, possible?
- What’s in your .emacs?
- How to achieve code folding effects in Emacs?
- When should Emacs #’function syntax be used?
- How to keep dir-local variables when switching major modes?
- Idiomatic batch processing of text in Emacs?
- Globally override key binding in Emacs
- Emacs 24 Package System Initialization Problems
- How do I control how Emacs makes backup files?
- Why does emacs create temporary symbolic links for modified files?
- Open file via SSH and Sudo with Emacs
- Binding M- / M- in Emacs 23.1.1
- Emacs: Symbol’s value as variable is void
- How to change size of split screen emacs windows?
- Set 4 Space Indent in Emacs in Text Mode
- Emacs: Tramp doesn’t work
- “Wrong type argument: commandp” error when binding a lambda to a key
- Emacs: help me understand file/buffer management
- Using Emacs to recursively find and replace in text files not already open
- How to load program reading stdin and taking parameters in gdb?
- Using Emacs as an IDE
- Emacs shell scripts – how to put initial options into the script?
- Unable to hide welcome screen in Emacs
- How to scroll line by line in GNU Emacs?
- Emacs behind HTTP proxy
- Changing Emacs Forward-Word Behaviour
- Originate edit of remote file using emacs tramp from ssh session
- Emacs – Error when calling (server-start)