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
This commit is contained in:
Bastien Guerry 2012-01-26 09:24:51 +01:00 committed by Eric Schulte
parent 6bd7c7d042
commit 8c16d85476

View file

@ -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