comparison lisp/modes/tex-mode.el @ 16:0293115a14e9 r19-15b91

Import from CVS: tag r19-15b91
author cvs
date Mon, 13 Aug 2007 08:49:20 +0200
parents b82b59fe008d
children 131b0175ea99
comparison
equal deleted inserted replaced
15:ad457d5f7d04 16:0293115a14e9
17 ;; WITHOUT ANY WARRANTY; without even the implied warranty of 17 ;; WITHOUT ANY WARRANTY; without even the implied warranty of
18 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 18 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19 ;; General Public License for more details. 19 ;; General Public License for more details.
20 20
21 ;; You should have received a copy of the GNU General Public License 21 ;; You should have received a copy of the GNU General Public License
22 ;; along with XEmacs; see the file COPYING. If not, write to the Free 22 ;; along with XEmacs; see the file COPYING. If not, write to the
23 ;; Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. 23 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
24 ;; Boston, MA 02111-1307, USA.
24 25
25 (require 'comint) 26 (require 'comint)
26 27
27 (defvar tex-shell-file-name nil 28 (defvar tex-shell-file-name nil
28 "*If non-nil, is file name to use for the subshell in which TeX is run.") 29 "*If non-nil, is file name to use for the subshell in which TeX is run.")
62 63
63 (defvar latex-block-names nil 64 (defvar latex-block-names nil
64 "*User defined LaTeX block names. 65 "*User defined LaTeX block names.
65 Combined with `standard-latex-block-names' for minibuffer completion.") 66 Combined with `standard-latex-block-names' for minibuffer completion.")
66 67
68 (defvar tex-latex-document-regex "documentstyle\\|documentclass"
69 "matches the first command of a LaTeX document")
70
67 (defvar slitex-run-command "slitex" 71 (defvar slitex-run-command "slitex"
68 "*Command used to run SliTeX subjob. 72 "*Command used to run SliTeX subjob.
69 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
70 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
71 this string.") 75 this string.")
72 76
77 (defvar tex-slitex-document-regex "documentstyle{slides}"
78 "Matches the first command of a slitex document")
79
73 (defvar tex-bibtex-command "bibtex" 80 (defvar tex-bibtex-command "bibtex"
74 "*Command used by `tex-bibtex-file' to gather bibliographic data. 81 "*Command used by `tex-bibtex-file' to gather bibliographic data.
75 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
76 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
77 this string.") 84 this string.")
212 (setq comment (let ((search-end (point))) 219 (setq comment (let ((search-end (point)))
213 (save-excursion 220 (save-excursion
214 (beginning-of-line) 221 (beginning-of-line)
215 (search-forward "%" search-end t)))))) 222 (search-forward "%" search-end t))))))
216 (if (and slash (not comment)) 223 (if (and slash (not comment))
217 (setq mode (if (looking-at "documentstyle") 224 (setq mode (if (looking-at tex-latex-document-regex)
218 (if (looking-at "documentstyle{slides}") 225 (if (looking-at tex-slitex-document-regex)
219 'slitex-mode 226 'slitex-mode
220 'latex-mode) 227 'latex-mode)
221 'plain-tex-mode)))) 228 'plain-tex-mode))))
222 (if mode (funcall mode) 229 (if mode (funcall mode)
223 (funcall tex-default-mode)))) 230 (funcall tex-default-mode))))