Function: org-export-with-buffer-copy

org-export-with-buffer-copy is a macro defined in ox.el.gz.

Signature

(org-export-with-buffer-copy &rest BODY &key TO-BUFFER DROP-VISIBILITY DROP-NARROWING DROP-CONTENTS DROP-LOCALS &allow-other-keys)

Documentation

Apply BODY in a copy of the current buffer.

This macro is like org-element-with-buffer-copy, passing the same arguments BODY, TO-BUFFER, DROP-VISIBILITY, DROP-NARROWING, DROP-CONTENTS, and DROP-LOCALS.

In addition, buffer-local variables are set according to #+BIND: keywords.

Source Code

;; Defined in /usr/src/emacs/lisp/org/ox.el.gz
(cl-defmacro org-export-with-buffer-copy ( &rest body
                                           &key to-buffer drop-visibility
                                           drop-narrowing drop-contents
                                           drop-locals
                                           &allow-other-keys)
  "Apply BODY in a copy of the current buffer.
This macro is like `org-element-with-buffer-copy', passing the same
arguments BODY, TO-BUFFER, DROP-VISIBILITY, DROP-NARROWING,
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
        :to-buffer ,to-buffer
        :drop-visibility ,drop-visibility
        :drop-narrowing ,drop-narrowing
        :drop-contents ,drop-contents
        :drop-locals ,drop-locals
        (org-export--set-variables ,bind-variables)
        ,@body))))