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
parent 471ddbd14e
commit 25ddcb9c35
1 changed files with 2 additions and 0 deletions

View File

@ -16764,6 +16764,8 @@ the cursor is before the first headline,
display all fragments in the buffer. display all fragments in the buffer.
The images can be removed again with \\[org-ctrl-c-ctrl-c]." The images can be removed again with \\[org-ctrl-c-ctrl-c]."
(interactive "P") (interactive "P")
(unless buffer-file-name
(error "Can't preview LaTeX fragment in a non-file buffer"))
(org-remove-latex-fragment-image-overlays) (org-remove-latex-fragment-image-overlays)
(save-excursion (save-excursion
(save-restriction (save-restriction