mirror of
https://git.savannah.gnu.org/git/emacs/org-mode.git
synced 2024-11-26 07:33:39 +00:00
New macro: Wrap let-binding of uninterned SYMBOLS around BODY
* org-macs.el (org-with-gensyms): New macro. Wrap let-binding of SYMBOLS to new uninterned symbols around BODY. Use this macro to compose macros that need to bind their own symbols in expansion. It expands into a let-binding of all symbols in SYMBOLS to new uninterned symbols that cannot collide with symbols used in the target macro's expansion.
This commit is contained in:
parent
ca3935b6e3
commit
4fe8369dae
@ -47,6 +47,12 @@
|
||||
(declare-function org-add-props "org-compat" (string plist &rest props))
|
||||
(declare-function org-string-match-p "org-compat" (&rest args))
|
||||
|
||||
(defmacro org-with-gensyms (symbols &rest body)
|
||||
`(let ,(mapcar (lambda (s)
|
||||
`(,s (make-symbol (concat "--" (symbol-name ',s))))) symbols)
|
||||
,@body))
|
||||
(put 'org-with-gensyms 'lisp-indent-function 1)
|
||||
|
||||
(defmacro org-called-interactively-p (&optional kind)
|
||||
(if (featurep 'xemacs)
|
||||
`(interactive-p)
|
||||
|
Loading…
Reference in New Issue
Block a user