emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/org 86b6d843f6 3/3: org-html-format-latex: Prevent side


From: ELPA Syncer
Subject: [elpa] externals/org 86b6d843f6 3/3: org-html-format-latex: Prevent side effects of copying `buffer-file-name'
Date: Fri, 7 Oct 2022 06:57:49 -0400 (EDT)

branch: externals/org
commit 86b6d843f6e8d33c0dcf414f7fda2b1ac6492550
Author: Ihor Radchenko <yantar92@gmail.com>
Commit: Ihor Radchenko <yantar92@gmail.com>

    org-html-format-latex: Prevent side effects of copying `buffer-file-name'
    
    * lisp/ox-html.el (org-html-format-latex): Unset `buffer-file-name'
    after we are done with transcoding LaTeX.
    
    Reported-by: Rudolf Adamkovič <salutis@me.com>
    Link: 
https://list.orgmode.org/m2k05c579o.fsf@me.com/T/#m949ed054f0f219e2742697c4c4f49fbe07909f5a
---
 lisp/ox-html.el | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/lisp/ox-html.el b/lisp/ox-html.el
index 9b77e4f8dd..3f55be2eeb 100644
--- a/lisp/ox-html.el
+++ b/lisp/ox-html.el
@@ -2887,13 +2887,15 @@ INFO is a plist containing export properties."
       (insert latex-frag)
       (org-format-latex cache-relpath nil nil cache-dir nil
                        "Creating LaTeX Image..." nil processing-type)
-      ;; Present save dialogue to be shown for this buffer.  We need
-      ;; to explicitly disable the dialogue because
+      ;; Present save dialogue to be shown for this buffer and prevent
+      ;; Emacs to jump into this buffer when opening
+      ;; `buffer-file-name' file.  We need this because
       ;; `org-export-copy-buffer' copies `buffer-file-name' local
       ;; variable thus making Emacs think that the buffer copy is
       ;; associated with file.  Note that despite `buffer-file-name',
       ;; `org-export-copy-buffer' arranges saving to not perform
       ;; actual writing onto the disk.
+      (setq buffer-file-name nil)
       (restore-buffer-modified-p nil)
       (buffer-string))))
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]