monnier pushed a commit to branch externals/auctex in repository elpa. commit 448b75dd11a3a2fb48964c173d7310541256b1bb Author: Tassilo Horn <t...@gnu.org> Date: Tue Apr 2 07:22:29 2013 +0000
* latex.el (TeX-arg-document): Search for LaTeX classes. --- ChangeLog | 4 ++++ latex.el | 26 +++++++++++++++++--------- 2 files changed, 21 insertions(+), 9 deletions(-) diff --git a/ChangeLog b/ChangeLog index eaedaa1..ca24cf5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2013-03-29 Mos� Giordano <giordano.m...@libero.it> + + * latex.el (TeX-arg-document): Search for LaTeX classes. + 2013-03-28 Mos� Giordano <giordano.m...@libero.it> * style/biblatex.el (LaTeX-biblatex-package-options): Correct name diff --git a/latex.el b/latex.el index c06e365..ada12d4 100644 --- a/latex.el +++ b/latex.el @@ -1737,15 +1737,23 @@ string." (defun TeX-arg-document (optional &optional ignore) "Insert arguments to documentclass. OPTIONAL and IGNORE are ignored." - (let ((style (completing-read - (concat "Document class: (default " LaTeX-default-style ") ") - LaTeX-style-list)) - (options (read-string "Options: " - (if (stringp LaTeX-default-options) - LaTeX-default-options - (mapconcat 'identity - LaTeX-default-options - ","))))) + (let* ((TeX-file-extensions '("cls")) + (search (if (eq TeX-arg-input-file-search 'ask) + (not (y-or-n-p "Find class yourself? ")) + TeX-arg-input-file-search)) + (LaTeX-style-list + (if search + (mapcar 'identity (TeX-search-files-by-type 'texinputs 'global t t)) + LaTeX-style-list)) + (style (completing-read + (concat "Document class: (default " LaTeX-default-style ") ") + LaTeX-style-list)) + (options (read-string "Options: " + (if (stringp LaTeX-default-options) + LaTeX-default-options + (mapconcat 'identity + LaTeX-default-options + ","))))) (if (zerop (length style)) (setq style LaTeX-default-style)) (if (not (zerop (length options)))