comparison lisp/modes/tex-mode.el @ 84:ac0620f6398e r20-0b92

Import from CVS: tag r20-0b92
author cvs
date Mon, 13 Aug 2007 09:08:29 +0200
parents 131b0175ea99
children
comparison
equal deleted inserted replaced
83:ba3ba6e17456 84:ac0620f6398e
63 63
64 (defvar latex-block-names nil 64 (defvar latex-block-names nil
65 "*User defined LaTeX block names. 65 "*User defined LaTeX block names.
66 Combined with `standard-latex-block-names' for minibuffer completion.") 66 Combined with `standard-latex-block-names' for minibuffer completion.")
67 67
68 (defvar tex-latex-document-regex "documentstyle\\|documentclass"
69 "matches the first command of a LaTeX document")
70
68 (defvar slitex-run-command "slitex" 71 (defvar slitex-run-command "slitex"
69 "*Command used to run SliTeX subjob. 72 "*Command used to run SliTeX subjob.
70 If this string contains an asterisk (*), it will be replaced by the 73 If this string contains an asterisk (*), it will be replaced by the
71 filename; if not, the name of the file, preceded by blank, will be added to 74 filename; if not, the name of the file, preceded by blank, will be added to
72 this string.") 75 this string.")
73 76
77 (defvar tex-slitex-document-regex "documentstyle{slides}"
78 "Matches the first command of a slitex document")
79
74 (defvar tex-bibtex-command "bibtex" 80 (defvar tex-bibtex-command "bibtex"
75 "*Command used by `tex-bibtex-file' to gather bibliographic data. 81 "*Command used by `tex-bibtex-file' to gather bibliographic data.
76 If this string contains an asterisk (*), it will be replaced by the 82 If this string contains an asterisk (*), it will be replaced by the
77 filename; if not, the name of the file, preceded by blank, will be added to 83 filename; if not, the name of the file, preceded by blank, will be added to
78 this string.") 84 this string.")
213 (setq comment (let ((search-end (point))) 219 (setq comment (let ((search-end (point)))
214 (save-excursion 220 (save-excursion
215 (beginning-of-line) 221 (beginning-of-line)
216 (search-forward "%" search-end t)))))) 222 (search-forward "%" search-end t))))))
217 (if (and slash (not comment)) 223 (if (and slash (not comment))
218 (setq mode (if (looking-at "documentstyle") 224 (setq mode (if (looking-at tex-latex-document-regex)
219 (if (looking-at "documentstyle{slides}") 225 (if (looking-at tex-slitex-document-regex)
220 'slitex-mode 226 'slitex-mode
221 'latex-mode) 227 'latex-mode)
222 'plain-tex-mode)))) 228 'plain-tex-mode))))
223 (if mode (funcall mode) 229 (if mode (funcall mode)
224 (funcall tex-default-mode)))) 230 (funcall tex-default-mode))))