mirror of
https://git.savannah.gnu.org/git/emacs/org-mode.git
synced 2024-09-05 01:43:33 +00:00
org-element-with-buffer-copy, org-export-with-buffer-copy: Fix expansion
* lisp/org-element.el (org-element-with-buffer-copy): * lisp/ox.el (org-export-with-buffer-copy): Make sure that keyword arguments in the macro are not duplicated into BODY, which happens for &rest body + &allow-other-keys in `cl-defmacro'. Reported-by: João Távora <joaotavora@gmail.com> Link: https://yhetil.org/emacs-devel/CALDnm53p7nXdnbA2PuH-VHL7EeGQUXYy3x_87hp3oj2pkyWS9Q@mail.gmail.com/
This commit is contained in:
parent
f59ac10257
commit
3afae6690f
|
@ -669,6 +669,8 @@ Optional keys can modify what is being copied and the generated buffer
|
||||||
copy. TO-BUFFER, DROP-VISIBILITY, DROP-NARROWING, DROP-CONTENTS, and
|
copy. TO-BUFFER, DROP-VISIBILITY, DROP-NARROWING, DROP-CONTENTS, and
|
||||||
DROP-LOCALS are passed as arguments to `org-element-copy-buffer'."
|
DROP-LOCALS are passed as arguments to `org-element-copy-buffer'."
|
||||||
(declare (debug t))
|
(declare (debug t))
|
||||||
|
;; Drop keyword arguments from BODY.
|
||||||
|
(while (keywordp (car body)) (pop body) (pop body))
|
||||||
(org-with-gensyms (buf-copy)
|
(org-with-gensyms (buf-copy)
|
||||||
`(let ((,buf-copy (org-element-copy-buffer
|
`(let ((,buf-copy (org-element-copy-buffer
|
||||||
:to-buffer ,to-buffer
|
:to-buffer ,to-buffer
|
||||||
|
|
|
@ -2599,6 +2599,8 @@ DROP-CONTENTS, and DROP-LOCALS.
|
||||||
In addition, buffer-local variables are set according to #+BIND:
|
In addition, buffer-local variables are set according to #+BIND:
|
||||||
keywords."
|
keywords."
|
||||||
(declare (debug t))
|
(declare (debug t))
|
||||||
|
;; Drop keyword arguments from BODY.
|
||||||
|
(while (keywordp (car body)) (pop body) (pop body))
|
||||||
(org-with-gensyms (bind-variables)
|
(org-with-gensyms (bind-variables)
|
||||||
`(let ((,bind-variables (org-export--list-bound-variables)))
|
`(let ((,bind-variables (org-export--list-bound-variables)))
|
||||||
(org-element-with-buffer-copy
|
(org-element-with-buffer-copy
|
||||||
|
|
Loading…
Reference in a new issue