org-latex-preview: Speed up texfile creation time

* lisp/org-latex-preview.el (org-latex-preview--create-tex-file):
Speed up texfile creation time by inhibiting fsync and setting the
`coding-system-for-write' explicitly.  Times are reduced by about
40-50%.
This commit is contained in:
Karthik Chikmagalur 2023-02-04 00:58:58 -08:00 committed by TEC
parent 0f1d2f0ca0
commit b9f937bb2d
Signed by: tec
SSH Key Fingerprint: SHA256:eobz41Mnm0/iYWBvWThftS0ElEs1ftBr6jamutnXc/A
1 changed files with 3 additions and 1 deletions

View File

@ -1429,7 +1429,9 @@ The path of the created LaTeX file is returned."
(format "\n\\setlength{\\textwidth}{%s}\n" w))
((and (floatp w) (<= 0.0 w 1.0))
(format "\n\\setlength{\\textwidth}{%s\\paperwidth}\n" w))))
"\n\\usepackage[active,tightpage,auctex]{preview}\n")))
"\n\\usepackage[active,tightpage,auctex]{preview}\n"))
(write-region-inhibit-fsync t)
(coding-system-for-write buffer-file-coding-system))
(with-temp-file tex-temp-name
(insert (if-let ((format-file
(and org-latex-preview-use-precompilation