[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/org 3afae6690f 1/4: org-element-with-buffer-copy, org-e
From: |
ELPA Syncer |
Subject: |
[elpa] externals/org 3afae6690f 1/4: org-element-with-buffer-copy, org-export-with-buffer-copy: Fix expansion |
Date: |
Mon, 25 Dec 2023 15:58:26 -0500 (EST) |
branch: externals/org
commit 3afae6690f6bd932fb60ab66b132b9a972501310
Author: Ihor Radchenko <yantar92@posteo.net>
Commit: Ihor Radchenko <yantar92@posteo.net>
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/
---
lisp/org-element.el | 2 ++
lisp/ox.el | 2 ++
2 files changed, 4 insertions(+)
diff --git a/lisp/org-element.el b/lisp/org-element.el
index 0924c56fed..ab81abebd9 100644
--- a/lisp/org-element.el
+++ b/lisp/org-element.el
@@ -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
DROP-LOCALS are passed as arguments to `org-element-copy-buffer'."
(declare (debug t))
+ ;; Drop keyword arguments from BODY.
+ (while (keywordp (car body)) (pop body) (pop body))
(org-with-gensyms (buf-copy)
`(let ((,buf-copy (org-element-copy-buffer
:to-buffer ,to-buffer
diff --git a/lisp/ox.el b/lisp/ox.el
index b661b59c31..46994f0e29 100644
--- a/lisp/ox.el
+++ b/lisp/ox.el
@@ -2599,6 +2599,8 @@ DROP-CONTENTS, and DROP-LOCALS.
In addition, buffer-local variables are set according to #+BIND:
keywords."
(declare (debug t))
+ ;; Drop keyword arguments from BODY.
+ (while (keywordp (car body)) (pop body) (pop body))
(org-with-gensyms (bind-variables)
`(let ((,bind-variables (org-export--list-bound-variables)))
(org-element-with-buffer-copy