瀏覽代碼

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
Bastien Guerry 13 年之前
父節點
當前提交
25ddcb9c35
共有 1 個文件被更改,包括 2 次插入0 次删除
  1. 2 0
      lisp/org.el

+ 2 - 0
lisp/org.el

@@ -16764,6 +16764,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