diff options
author | Nicolas Goaziou <mail@nicolasgoaziou.fr> | 2015-03-07 10:01:27 +0100 |
---|---|---|
committer | Nicolas Goaziou <mail@nicolasgoaziou.fr> | 2015-03-07 10:01:27 +0100 |
commit | 9e3c3ec0b357c97a488da1223f96785ec7edfc37 (patch) | |
tree | 9c9588a2222b57f4a6fd9a59c43422ebb5893685 | |
parent | bf4a645cacc26377b2847d7d2090a00017f6f114 (diff) | |
download | org-mode-9e3c3ec0b357c97a488da1223f96785ec7edfc37.tar.gz |
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>
-rwxr-xr-x | lisp/org.el | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/lisp/org.el b/lisp/org.el index 0e5e6ff..da5de84 100755 --- a/lisp/org.el +++ b/lisp/org.el @@ -18829,13 +18829,16 @@ for all fragments in the buffer." (throw 'exit nil)) (setq msg "Creating images for section...") (narrow-to-region beg end)))))) - (org-format-latex - (concat org-latex-preview-ltxpng-directory - (file-name-sans-extension - (file-name-nondirectory - (buffer-file-name (buffer-base-buffer))))) - default-directory 'overlays msg 'forbuffer - org-latex-create-formula-image-program)) + (let ((file (buffer-file-name (buffer-base-buffer)))) + (org-format-latex + (concat org-latex-preview-ltxpng-directory + (file-name-sans-extension (file-name-nondirectory file))) + ;; Emacs cannot overlay images from remote hosts. + ;; Create it in `temporary-file-directory' instead. + (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 ;; when widening back the buffer. (set-window-start nil window-start) |