comparison lisp/modes/tex-mode.el @ 70:131b0175ea99 r20-0b30

Import from CVS: tag r20-0b30
author cvs
date Mon, 13 Aug 2007 09:02:59 +0200
parents 0293115a14e9
children ac0620f6398e
comparison
equal deleted inserted replaced
69:804d1389bcd6 70:131b0175ea99
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
71 (defvar slitex-run-command "slitex" 68 (defvar slitex-run-command "slitex"
72 "*Command used to run SliTeX subjob. 69 "*Command used to run SliTeX subjob.
73 If this string contains an asterisk (*), it will be replaced by the 70 If this string contains an asterisk (*), it will be replaced by the
74 filename; if not, the name of the file, preceded by blank, will be added to 71 filename; if not, the name of the file, preceded by blank, will be added to
75 this string.") 72 this string.")
76 73
77 (defvar tex-slitex-document-regex "documentstyle{slides}"
78 "Matches the first command of a slitex document")
79
80 (defvar tex-bibtex-command "bibtex" 74 (defvar tex-bibtex-command "bibtex"
81 "*Command used by `tex-bibtex-file' to gather bibliographic data. 75 "*Command used by `tex-bibtex-file' to gather bibliographic data.
82 If this string contains an asterisk (*), it will be replaced by the 76 If this string contains an asterisk (*), it will be replaced by the
83 filename; if not, the name of the file, preceded by blank, will be added to 77 filename; if not, the name of the file, preceded by blank, will be added to
84 this string.") 78 this string.")
219 (setq comment (let ((search-end (point))) 213 (setq comment (let ((search-end (point)))
220 (save-excursion 214 (save-excursion
221 (beginning-of-line) 215 (beginning-of-line)
222 (search-forward "%" search-end t)))))) 216 (search-forward "%" search-end t))))))
223 (if (and slash (not comment)) 217 (if (and slash (not comment))
224 (setq mode (if (looking-at tex-latex-document-regex) 218 (setq mode (if (looking-at "documentstyle")
225 (if (looking-at tex-slitex-document-regex) 219 (if (looking-at "documentstyle{slides}")
226 'slitex-mode 220 'slitex-mode
227 'latex-mode) 221 'latex-mode)
228 'plain-tex-mode)))) 222 'plain-tex-mode))))
229 (if mode (funcall mode) 223 (if mode (funcall mode)
230 (funcall tex-default-mode)))) 224 (funcall tex-default-mode))))
812 is provided, use the alternative command, tex-alt-dvi-print-command." 806 is provided, use the alternative command, tex-alt-dvi-print-command."
813 (interactive "P") 807 (interactive "P")
814 (let ((print-file-name-dvi (tex-append tex-print-file ".dvi")) 808 (let ((print-file-name-dvi (tex-append tex-print-file ".dvi"))
815 test-name) 809 test-name)
816 (if (and (not (equal (current-buffer) tex-last-buffer-texed)) 810 (if (and (not (equal (current-buffer) tex-last-buffer-texed))
817 (buffer-file-name)
818 ;; Check that this buffer's printed file is up to date.
819 (file-newer-than-file-p 811 (file-newer-than-file-p
820 (setq test-name (tex-append (buffer-file-name) ".dvi")) 812 (setq test-name (tex-append (buffer-file-name) ".dvi"))
821 (buffer-file-name))) 813 print-file-name-dvi))
822 (setq print-file-name-dvi test-name)) 814 (setq print-file-name-dvi test-name))
823 (if (not (file-exists-p print-file-name-dvi)) 815 (if (not (file-exists-p print-file-name-dvi))
824 (error "No appropriate `.dvi' file could be found") 816 (error "No appropriate `.dvi' file could be found")
825 (tex-send-command 817 (tex-send-command
826 (if alt tex-alt-dvi-print-command tex-dvi-print-command) 818 (if alt tex-alt-dvi-print-command tex-dvi-print-command)