浏览代码

ox-latex/ox-beamer: Provide an error when LaTeX class is invalid

* lisp/ox-beamer.el (org-beamer-template): Provide an error when LaTeX
  class is invalid.
* lisp/ox-latex.el (org-latex-template): Provide an error when LaTeX
  class is invalid.

Patch suggested by Sébastien Vauban
Nicolas Goaziou 12 年之前
父节点
当前提交
ce79e36ff0
共有 2 个文件被更改,包括 4 次插入2 次删除
  1. 2 1
      lisp/ox-beamer.el
  2. 2 1
      lisp/ox-latex.el

+ 2 - 1
lisp/ox-beamer.el

@@ -828,7 +828,8 @@ holding export options."
 		       (replace-regexp-in-string
 			"^[ \t]*\\\\documentclass\\(\\(\\[.*\\]\\)?\\)"
 			class-options header t nil 1)))))
-	  (when document-class-string
+	  (if (not document-class-string)
+	      (user-error "Unknown LaTeX class `%s'")
 	    (org-latex-guess-babel-language
 	     (org-latex-guess-inputenc
 	      (org-splice-latex-header

+ 2 - 1
lisp/ox-latex.el

@@ -1108,7 +1108,8 @@ holding export options."
 		       (replace-regexp-in-string
 			"^[ \t]*\\\\documentclass\\(\\(\\[.*\\]\\)?\\)"
 			class-options header t nil 1)))))
-	  (when document-class-string
+	  (if (not document-class-string)
+	      (user-error "Unknown LaTeX class `%s'")
 	    (org-latex-guess-babel-language
 	     (org-latex-guess-inputenc
 	      (org-splice-latex-header