diff options
Diffstat (limited to 'lisp/textmodes/tex-mode.el')
| -rw-r--r-- | lisp/textmodes/tex-mode.el | 32 |
1 files changed, 18 insertions, 14 deletions
diff --git a/lisp/textmodes/tex-mode.el b/lisp/textmodes/tex-mode.el index 66dc7b83507..7d04464346a 100644 --- a/lisp/textmodes/tex-mode.el +++ b/lisp/textmodes/tex-mode.el | |||
| @@ -650,17 +650,22 @@ An alternative value is \" . \", if you use a font with a narrow period." | |||
| 650 | "Face used for subscripts." | 650 | "Face used for subscripts." |
| 651 | :group 'tex) | 651 | :group 'tex) |
| 652 | 652 | ||
| 653 | (defface tex-math-face | 653 | (defface tex-math |
| 654 | '((t :inherit font-lock-string-face)) | 654 | '((t :inherit font-lock-string-face)) |
| 655 | "Face used to highlight TeX math expressions." | 655 | "Face used to highlight TeX math expressions." |
| 656 | :group 'tex) | 656 | :group 'tex) |
| 657 | (defvar tex-math-face 'tex-math-face) | 657 | ;; backward-compatibility alias |
| 658 | (defface tex-verbatim-face | 658 | (put 'tex-math-face 'face-alias 'tex-math) |
| 659 | (defvar tex-math-face 'tex-math) | ||
| 660 | |||
| 661 | (defface tex-verbatim | ||
| 659 | ;; '((t :inherit font-lock-string-face)) | 662 | ;; '((t :inherit font-lock-string-face)) |
| 660 | '((t :family "courier")) | 663 | '((t :family "courier")) |
| 661 | "Face used to highlight TeX verbatim environments." | 664 | "Face used to highlight TeX verbatim environments." |
| 662 | :group 'tex) | 665 | :group 'tex) |
| 663 | (defvar tex-verbatim-face 'tex-verbatim-face) | 666 | ;; backward-compatibility alias |
| 667 | (put 'tex-verbatim-face 'face-alias 'tex-verbatim) | ||
| 668 | (defvar tex-verbatim-face 'tex-verbatim) | ||
| 664 | 669 | ||
| 665 | ;; Use string syntax but math face for $...$. | 670 | ;; Use string syntax but math face for $...$. |
| 666 | (defun tex-font-lock-syntactic-face-function (state) | 671 | (defun tex-font-lock-syntactic-face-function (state) |
| @@ -795,7 +800,7 @@ Inherits `shell-mode-map' with a few additions.") | |||
| 795 | (regexp-opt '("documentstyle" "documentclass" | 800 | (regexp-opt '("documentstyle" "documentclass" |
| 796 | "begin" "subsection" "section" | 801 | "begin" "subsection" "section" |
| 797 | "part" "chapter" "newcommand" | 802 | "part" "chapter" "newcommand" |
| 798 | "renewcommand") 'words) | 803 | "renewcommand" "RequirePackage") 'words) |
| 799 | "\\|NeedsTeXFormat{LaTeX"))) | 804 | "\\|NeedsTeXFormat{LaTeX"))) |
| 800 | (if (and (looking-at | 805 | (if (and (looking-at |
| 801 | "document\\(style\\|class\\)\\(\\[.*\\]\\)?{slides}") | 806 | "document\\(style\\|class\\)\\(\\[.*\\]\\)?{slides}") |
| @@ -1101,7 +1106,7 @@ Inserts the value of `tex-open-quote' (normally ``) or `tex-close-quote' | |||
| 1101 | inserts \" characters." | 1106 | inserts \" characters." |
| 1102 | (interactive "*P") | 1107 | (interactive "*P") |
| 1103 | (if (or arg (memq (char-syntax (preceding-char)) '(?/ ?\\)) | 1108 | (if (or arg (memq (char-syntax (preceding-char)) '(?/ ?\\)) |
| 1104 | (eq (get-text-property (point) 'face) 'tex-verbatim-face) | 1109 | (eq (get-text-property (point) 'face) tex-verbatim-face) |
| 1105 | (save-excursion | 1110 | (save-excursion |
| 1106 | (backward-char (length tex-open-quote)) | 1111 | (backward-char (length tex-open-quote)) |
| 1107 | (when (or (looking-at (regexp-quote tex-open-quote)) | 1112 | (when (or (looking-at (regexp-quote tex-open-quote)) |
| @@ -1639,9 +1644,12 @@ If NOT-ALL is non-nil, save the `.dvi' file." | |||
| 1639 | " " (if (< 0 (length tex-start-commands)) | 1644 | " " (if (< 0 (length tex-start-commands)) |
| 1640 | (shell-quote-argument tex-start-commands)) " %f") | 1645 | (shell-quote-argument tex-start-commands)) " %f") |
| 1641 | t "%r.dvi") | 1646 | t "%r.dvi") |
| 1642 | ("yap %r &" "%r.dvi") | ||
| 1643 | ("xdvi %r &" "%r.dvi") | 1647 | ("xdvi %r &" "%r.dvi") |
| 1648 | ("xpdf %r.pdf &" "%r.pdf") | ||
| 1649 | ("gv %r.ps &" "%r.ps") | ||
| 1650 | ("yap %r &" "%r.dvi") | ||
| 1644 | ("advi %r &" "%r.dvi") | 1651 | ("advi %r &" "%r.dvi") |
| 1652 | ("gv %r.pdf &" "%r.pdf") | ||
| 1645 | ("bibtex %r" "%r.aux" "%r.bbl") | 1653 | ("bibtex %r" "%r.aux" "%r.bbl") |
| 1646 | ("makeindex %r" "%r.idx" "%r.ind") | 1654 | ("makeindex %r" "%r.idx" "%r.ind") |
| 1647 | ("texindex %r.??") | 1655 | ("texindex %r.??") |
| @@ -1649,9 +1657,6 @@ If NOT-ALL is non-nil, save the `.dvi' file." | |||
| 1649 | ("dvipdf %r" "%r.dvi" "%r.pdf") | 1657 | ("dvipdf %r" "%r.dvi" "%r.pdf") |
| 1650 | ("dvips -o %r.ps %r" "%r.dvi" "%r.ps") | 1658 | ("dvips -o %r.ps %r" "%r.dvi" "%r.ps") |
| 1651 | ("ps2pdf %r.ps" "%r.ps" "%r.pdf") | 1659 | ("ps2pdf %r.ps" "%r.ps" "%r.pdf") |
| 1652 | ("gv %r.ps &" "%r.ps") | ||
| 1653 | ("gv %r.pdf &" "%r.pdf") | ||
| 1654 | ("xpdf %r.pdf &" "%r.pdf") | ||
| 1655 | ("lpr %r.ps" "%r.ps")) | 1660 | ("lpr %r.ps" "%r.ps")) |
| 1656 | "List of commands for `tex-compile'. | 1661 | "List of commands for `tex-compile'. |
| 1657 | Each element should be of the form (FORMAT IN OUT) where | 1662 | Each element should be of the form (FORMAT IN OUT) where |
| @@ -1830,8 +1835,7 @@ FILE is typically the output DVI or PDF file." | |||
| 1830 | (push cmd cmds) | 1835 | (push cmd cmds) |
| 1831 | (push (nth 1 cmd) unchanged-in)))) | 1836 | (push (nth 1 cmd) unchanged-in)))) |
| 1832 | ;; If no command seems to be applicable, arbitrarily pick the first one. | 1837 | ;; If no command seems to be applicable, arbitrarily pick the first one. |
| 1833 | (unless cmds | 1838 | (setq cmds (if cmds (nreverse cmds) (list (car tex-compile-commands)))) |
| 1834 | (setq cmds (list (car tex-compile-commands)))) | ||
| 1835 | ;; Remove those commands whose input was considered stable for | 1839 | ;; Remove those commands whose input was considered stable for |
| 1836 | ;; some other command (typically if (t . "%.pdf") is inactive | 1840 | ;; some other command (typically if (t . "%.pdf") is inactive |
| 1837 | ;; then we're using pdflatex and the fact that the dvi file | 1841 | ;; then we're using pdflatex and the fact that the dvi file |
| @@ -1841,7 +1845,7 @@ FILE is typically the output DVI or PDF file." | |||
| 1841 | (unless (member (nth 1 cmd) unchanged-in) | 1845 | (unless (member (nth 1 cmd) unchanged-in) |
| 1842 | (push cmd tmp))) | 1846 | (push cmd tmp))) |
| 1843 | ;; Only remove if there's something left. | 1847 | ;; Only remove if there's something left. |
| 1844 | (if tmp (setq cmds tmp))) | 1848 | (if tmp (setq cmds (nreverse tmp)))) |
| 1845 | ;; Remove commands whose input is not uptodate either. | 1849 | ;; Remove commands whose input is not uptodate either. |
| 1846 | (let ((outs (delq nil (mapcar (lambda (x) (nth 2 x)) cmds))) | 1850 | (let ((outs (delq nil (mapcar (lambda (x) (nth 2 x)) cmds))) |
| 1847 | (tmp nil)) | 1851 | (tmp nil)) |
| @@ -1849,7 +1853,7 @@ FILE is typically the output DVI or PDF file." | |||
| 1849 | (unless (member (nth 1 cmd) outs) | 1853 | (unless (member (nth 1 cmd) outs) |
| 1850 | (push cmd tmp))) | 1854 | (push cmd tmp))) |
| 1851 | ;; Only remove if there's something left. | 1855 | ;; Only remove if there's something left. |
| 1852 | (if tmp (setq cmds tmp))) | 1856 | (if tmp (setq cmds (nreverse tmp)))) |
| 1853 | ;; Select which file we're going to operate on (the latest). | 1857 | ;; Select which file we're going to operate on (the latest). |
| 1854 | (let ((latest (nth 1 (car cmds)))) | 1858 | (let ((latest (nth 1 (car cmds)))) |
| 1855 | (dolist (cmd (prog1 (cdr cmds) (setq cmds (list (car cmds))))) | 1859 | (dolist (cmd (prog1 (cdr cmds) (setq cmds (list (car cmds))))) |