branch: externals/org
commit 90e8d8b0450d7f6d7dc368a45878ce79ef0b6954
Author: Ihor Radchenko <[email protected]>
Commit: Ihor Radchenko <[email protected]>

    org-export-async-start: Fix when Org file has local variable footer
    
    * lisp/ox.el (org-export-async-start): Guard against Emacs attempting
    to read local variable block from the exported Org file that is
    present in the async script file.
    
    Reported-by: George Huebner <[email protected]>
    Link: https://orgmode.org/list/[email protected]
---
 lisp/ox.el | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/lisp/ox.el b/lisp/ox.el
index 7f72cfdca6..9e8b95a664 100644
--- a/lisp/ox.el
+++ b/lisp/ox.el
@@ -6753,7 +6753,7 @@ and `org-export-to-file' for more specialized functions."
          ;; Null characters (from variable values) are inserted
          ;; within the file.  As a consequence, coding system for
          ;; buffer contents could fail to be recognized properly.
-         (format ";; -*- coding: utf-8-emacs-unix; lexical-binding:t -*-\n%S"
+         (format ";; -*- coding: utf-8-emacs-unix; lexical-binding:t 
-*-\n%S\n%s"
                  `(with-temp-buffer
                     ,(when org-export-async-debug '(setq debug-on-error t))
                     ;; Ignore `kill-emacs-hook' and code evaluation
@@ -6767,7 +6767,11 @@ and `org-export-to-file' for more specialized functions."
                     (funcall ',copy-fun)
                     (restore-buffer-modified-p nil)
                     ;; Sexp to evaluate in the buffer.
-                    (print ,body)))
+                    (print ,body))
+                 ;; Add page break to suppress buffer-local variables.
+                 ;; We do not want local variables from the
+                 ;; orginal Org file (if any) to be mistakingly read.
+                 "\n")
          nil temp-file nil 'silent))
       ;; Start external process.
       (let* ((process-connection-type nil)

Reply via email to