forked from mirrors/org-mode
org-latex-preview: Reduce overhead in SVG editing
* lisp/org-latex-preview.el (org-latex-preview--svg-make-fg-currentColor): By setting the coding system and avoiding triggering any file handlers (such as the `image-file-handler'), memory usage is nearly halved, reducing GC pressure.
This commit is contained in:
parent
9884886692
commit
7a4925cac6
|
@ -1189,7 +1189,14 @@ EXTENDED-INFO, and displayed in the buffer."
|
|||
The foreground color is guessed to be the first specified <g>
|
||||
fill color, which appears to be a reliable heuristic from a few
|
||||
tests with the output of dvisvgm."
|
||||
(let ((write-region-inhibit-fsync t))
|
||||
(let ((write-region-inhibit-fsync t)
|
||||
;; dvisvgm produces UTF-8 encoded files, so we might as well
|
||||
;; avoid calling `find-auto-coding'.
|
||||
(coding-system-for-read 'utf-8)
|
||||
(coding-system-for-write 'utf-8)
|
||||
;; Prevent any file handlers (specifically
|
||||
;; `image-file-handler') from being called.
|
||||
(file-name-handler-alist nil))
|
||||
(with-temp-buffer
|
||||
(insert-file-contents (plist-get svg-fragment :path))
|
||||
(goto-char (point-min))
|
||||
|
|
Loading…
Reference in New Issue