Fix LaTeX fragment display from remote documents
* lisp/org.el (org-toggle-latex-fragment): Fix display from remote documents by creating images in temporary directory. Reported-by: Dustin Paluch <dustinpaluch@gmail.com> <http://permalink.gmane.org/gmane.emacs.orgmode/95712>
This commit is contained in:
parent
bf4a645cac
commit
9e3c3ec0b3
17
lisp/org.el
17
lisp/org.el
|
@ -18829,13 +18829,16 @@ for all fragments in the buffer."
|
||||||
(throw 'exit nil))
|
(throw 'exit nil))
|
||||||
(setq msg "Creating images for section...")
|
(setq msg "Creating images for section...")
|
||||||
(narrow-to-region beg end))))))
|
(narrow-to-region beg end))))))
|
||||||
(org-format-latex
|
(let ((file (buffer-file-name (buffer-base-buffer))))
|
||||||
(concat org-latex-preview-ltxpng-directory
|
(org-format-latex
|
||||||
(file-name-sans-extension
|
(concat org-latex-preview-ltxpng-directory
|
||||||
(file-name-nondirectory
|
(file-name-sans-extension (file-name-nondirectory file)))
|
||||||
(buffer-file-name (buffer-base-buffer)))))
|
;; Emacs cannot overlay images from remote hosts.
|
||||||
default-directory 'overlays msg 'forbuffer
|
;; Create it in `temporary-file-directory' instead.
|
||||||
org-latex-create-formula-image-program))
|
(if (file-remote-p file) temporary-file-directory
|
||||||
|
default-directory)
|
||||||
|
'overlays msg 'forbuffer
|
||||||
|
org-latex-create-formula-image-program)))
|
||||||
;; Work around a bug that doesn't restore window's start
|
;; Work around a bug that doesn't restore window's start
|
||||||
;; when widening back the buffer.
|
;; when widening back the buffer.
|
||||||
(set-window-start nil window-start)
|
(set-window-start nil window-start)
|
||||||
|
|
Loading…
Reference in New Issue