Pārlūkot izejas kodu

org-html-format-latex: Prevent save prompt for temporary buffer

* lisp/ox-html.el (org-html-format-latex): Mark the temporary Org
buffer as unchanged to prevent buffer saving prompt before exiting
Emacs.

Reported-by: Rudolf Adamkovič <salutis@me.com>
Link: https://list.orgmode.org/m2zgef774u.fsf@me.com/T/#t
Ihor Radchenko 1 gadu atpakaļ
vecāks
revīzija
0be36ac13e
1 mainītis faili ar 8 papildinājumiem un 0 dzēšanām
  1. 8 0
      lisp/ox-html.el

+ 8 - 0
lisp/ox-html.el

@@ -2887,6 +2887,14 @@ 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
+      ;; `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.
+      (restore-buffer-modified-p nil)
       (buffer-string))))
 
 (defun org-html--wrap-latex-environment (contents _ &optional caption label)