Skip to content

Commit d7a55bb

Browse files
committed
org-latex-export-to-latex: Do not suppress major modes in babel
* lisp/ox.el (org-export-to-file): Suppress loading major mode in the exported text explicitly instead of doing it across the whole export process. This way, babel evaluation will not suffer from unexpected behavior when no major modes are being loaded. Reported-by: Asilata Bapat <asilata@gmail.com> Link: https://list.orgmode.org/orgmode/87fsk5955a.fsf@gmail.com/
1 parent 252a062 commit d7a55bb

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

lisp/ox.el

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6586,8 +6586,7 @@ or FILE."
65866586
(declare (indent 2))
65876587
(if (not (file-writable-p file)) (error "Output file not writable")
65886588
(let ((ext-plist (org-combine-plists `(:output-file ,file) ext-plist))
6589-
(encoding (or org-export-coding-system buffer-file-coding-system))
6590-
auto-mode-alist)
6589+
(encoding (or org-export-coding-system buffer-file-coding-system)))
65916590
(if async
65926591
(org-export-async-start
65936592
(lambda (file)
@@ -6599,14 +6598,14 @@ or FILE."
65996598
(with-temp-buffer
66006599
(insert output)
66016600
(let ((coding-system-for-write ',encoding))
6602-
(write-file ,file)))
6601+
(write-region (point-min) (point-max) ,file)))
66036602
(or (ignore-errors (funcall ',post-process ,file)) ,file)))
66046603
(let ((output (org-export-as
66056604
backend subtreep visible-only body-only ext-plist)))
66066605
(with-temp-buffer
66076606
(insert output)
66086607
(let ((coding-system-for-write encoding))
6609-
(write-file file)))
6608+
(write-region (point-min) (point-max) file)))
66106609
(when (and (org-export--copy-to-kill-ring-p) (org-string-nw-p output))
66116610
(org-kill-new output))
66126611
;; Get proper return value.

0 commit comments

Comments
 (0)