forked from mirrors/org-mode
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/
This commit is contained in:
parent
252a062bf8
commit
d7a55bbd53
|
@ -6586,8 +6586,7 @@ or FILE."
|
||||||
(declare (indent 2))
|
(declare (indent 2))
|
||||||
(if (not (file-writable-p file)) (error "Output file not writable")
|
(if (not (file-writable-p file)) (error "Output file not writable")
|
||||||
(let ((ext-plist (org-combine-plists `(:output-file ,file) ext-plist))
|
(let ((ext-plist (org-combine-plists `(:output-file ,file) ext-plist))
|
||||||
(encoding (or org-export-coding-system buffer-file-coding-system))
|
(encoding (or org-export-coding-system buffer-file-coding-system)))
|
||||||
auto-mode-alist)
|
|
||||||
(if async
|
(if async
|
||||||
(org-export-async-start
|
(org-export-async-start
|
||||||
(lambda (file)
|
(lambda (file)
|
||||||
|
@ -6599,14 +6598,14 @@ or FILE."
|
||||||
(with-temp-buffer
|
(with-temp-buffer
|
||||||
(insert output)
|
(insert output)
|
||||||
(let ((coding-system-for-write ',encoding))
|
(let ((coding-system-for-write ',encoding))
|
||||||
(write-file ,file)))
|
(write-region (point-min) (point-max) ,file)))
|
||||||
(or (ignore-errors (funcall ',post-process ,file)) ,file)))
|
(or (ignore-errors (funcall ',post-process ,file)) ,file)))
|
||||||
(let ((output (org-export-as
|
(let ((output (org-export-as
|
||||||
backend subtreep visible-only body-only ext-plist)))
|
backend subtreep visible-only body-only ext-plist)))
|
||||||
(with-temp-buffer
|
(with-temp-buffer
|
||||||
(insert output)
|
(insert output)
|
||||||
(let ((coding-system-for-write encoding))
|
(let ((coding-system-for-write encoding))
|
||||||
(write-file file)))
|
(write-region (point-min) (point-max) file)))
|
||||||
(when (and (org-export--copy-to-kill-ring-p) (org-string-nw-p output))
|
(when (and (org-export--copy-to-kill-ring-p) (org-string-nw-p output))
|
||||||
(org-kill-new output))
|
(org-kill-new output))
|
||||||
;; Get proper return value.
|
;; Get proper return value.
|
||||||
|
|
Loading…
Reference in a new issue