summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien Guerry <bzg@altern.org>2012-01-26 09:24:51 +0100
committerEric Schulte <eric.schulte@gmx.com>2012-02-19 08:04:26 -0700
commit8c16d854769b6ebf614f14795a1fe11111e88fad (patch)
tree6fc94fd5b92c1a400cf5016b490f422d348fcd91
parent6bd7c7d042937d7fcaec12a672b4f087d81c6dfa (diff)
downloadorg-mode-8c16d854769b6ebf614f14795a1fe11111e88fad.tar.gz
org.el: `org-preview-latex-fragment' requires a buffer file name.
* org.el (org-preview-latex-fragment): Throw an error when called from a non-file buffer. This take care of this bug: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3768
-rw-r--r--lisp/org.el2
1 files changed, 2 insertions, 0 deletions
diff --git a/lisp/org.el b/lisp/org.el
index 0d06231..55b32b6 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -16713,6 +16713,8 @@ the cursor is before the first headline,
display all fragments in the buffer.
The images can be removed again with \\[org-ctrl-c-ctrl-c]."
(interactive "P")
+ (unless buffer-file-name
+ (error "Can't preview LaTeX fragment in a non-file buffer"))
(org-remove-latex-fragment-image-overlays)
(save-excursion
(save-restriction