diff options
| author | Stefan Monnier | 2003-05-10 18:54:13 +0000 |
|---|---|---|
| committer | Stefan Monnier | 2003-05-10 18:54:13 +0000 |
| commit | bca7a08bf60fdc34fb8d7ee6c024ca26754d3214 (patch) | |
| tree | b2f3d4ed86cfdbc84787e72c8e330ea83bfffbed | |
| parent | aa744995436cd66d74e51782c1c24edf5460124e (diff) | |
| download | emacs-bca7a08bf60fdc34fb8d7ee6c024ca26754d3214.tar.gz emacs-bca7a08bf60fdc34fb8d7ee6c024ca26754d3214.zip | |
(tex-mode-syntax-table): ~ is not whitespace.
(tex-guess-mode): Add `renewcommand'.
(tex-mode): Move the autoload so we get the correct docstring and usage.
| -rw-r--r-- | lisp/textmodes/tex-mode.el | 32 |
1 files changed, 20 insertions, 12 deletions
diff --git a/lisp/textmodes/tex-mode.el b/lisp/textmodes/tex-mode.el index 87f7b6b5c04..34bd13e146a 100644 --- a/lisp/textmodes/tex-mode.el +++ b/lisp/textmodes/tex-mode.el | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | ;;; tex-mode.el --- TeX, LaTeX, and SliTeX mode commands -*- coding: utf-8 -*- | 1 | ;;; tex-mode.el --- TeX, LaTeX, and SliTeX mode commands -*- coding: utf-8 -*- |
| 2 | 2 | ||
| 3 | ;; Copyright (C) 1985, 86, 89, 92, 94, 95, 96, 97, 98, 1999, 2002 | 3 | ;; Copyright (C) 1985,86,89,92,94,95,96,97,98,1999,2002,2003 |
| 4 | ;; Free Software Foundation, Inc. | 4 | ;; Free Software Foundation, Inc. |
| 5 | 5 | ||
| 6 | ;; Maintainer: FSF | 6 | ;; Maintainer: FSF |
| @@ -285,7 +285,9 @@ Set by \\[tex-region], \\[tex-buffer], and \\[tex-file].") | |||
| 285 | (?@ . "_") | 285 | (?@ . "_") |
| 286 | (?* . "_") | 286 | (?* . "_") |
| 287 | (?\t . " ") | 287 | (?\t . " ") |
| 288 | (?~ . " ") | 288 | ;; ~ is printed by TeX as a space, but it's semantics in the syntax |
| 289 | ;; of TeX is not `whitespace' (i.e. it's just like \hspace{foo}). | ||
| 290 | (?~ . ".") | ||
| 289 | (?$ . "$$") | 291 | (?$ . "$$") |
| 290 | (?\\ . "/") | 292 | (?\\ . "/") |
| 291 | (?\" . ".") | 293 | (?\" . ".") |
| @@ -763,7 +765,8 @@ Inherits `shell-mode-map' with a few additions.") | |||
| 763 | (concat | 765 | (concat |
| 764 | (regexp-opt '("documentstyle" "documentclass" | 766 | (regexp-opt '("documentstyle" "documentclass" |
| 765 | "begin" "subsection" "section" | 767 | "begin" "subsection" "section" |
| 766 | "part" "chapter" "newcommand") 'words) | 768 | "part" "chapter" "newcommand" |
| 769 | "renewcommand") 'words) | ||
| 767 | "\\|NeedsTeXFormat{LaTeX"))) | 770 | "\\|NeedsTeXFormat{LaTeX"))) |
| 768 | (if (looking-at | 771 | (if (looking-at |
| 769 | "document\\(style\\|class\\)\\(\\[.*\\]\\)?{slides}") | 772 | "document\\(style\\|class\\)\\(\\[.*\\]\\)?{slides}") |
| @@ -776,22 +779,27 @@ Inherits `shell-mode-map' with a few additions.") | |||
| 776 | ;; but it's also the function that chooses between those submodes. | 779 | ;; but it's also the function that chooses between those submodes. |
| 777 | ;; To tell the difference between those two cases where the function | 780 | ;; To tell the difference between those two cases where the function |
| 778 | ;; might be called, we check `delay-mode-hooks'. | 781 | ;; might be called, we check `delay-mode-hooks'. |
| 779 | ;;;###autoload | ||
| 780 | (define-derived-mode tex-mode text-mode "generic-TeX" | 782 | (define-derived-mode tex-mode text-mode "generic-TeX" |
| 781 | (tex-common-initialization)) | 783 | (tex-common-initialization)) |
| 782 | (fset 'tex-mode | 784 | ;; We now move the function and define it again. This gives a warning |
| 783 | `(lambda () | 785 | ;; in the byte-compiler :-( but it's difficult to avoid because |
| 784 | "Major mode for editing files of input for TeX, LaTeX, or SliTeX. | 786 | ;; `define-derived-mode' will necessarily define the function once |
| 787 | ;; and we need to define it a second time for `autoload' to get the | ||
| 788 | ;; proper docstring. | ||
| 789 | (defalias 'tex-mode-internal (symbol-function 'tex-mode)) | ||
| 790 | ;;;###autoload | ||
| 791 | (defun tex-mode () | ||
| 792 | "Major mode for editing files of input for TeX, LaTeX, or SliTeX. | ||
| 785 | Tries to determine (by looking at the beginning of the file) whether | 793 | Tries to determine (by looking at the beginning of the file) whether |
| 786 | this file is for plain TeX, LaTeX, or SliTeX and calls `plain-tex-mode', | 794 | this file is for plain TeX, LaTeX, or SliTeX and calls `plain-tex-mode', |
| 787 | `latex-mode', or `slitex-mode', respectively. If it cannot be determined, | 795 | `latex-mode', or `slitex-mode', respectively. If it cannot be determined, |
| 788 | such as if there are no commands in the file, the value of `tex-default-mode' | 796 | such as if there are no commands in the file, the value of `tex-default-mode' |
| 789 | says which mode to use." | 797 | says which mode to use." |
| 790 | (interactive) | 798 | (interactive) |
| 791 | (if delay-mode-hooks | 799 | (if delay-mode-hooks |
| 792 | ;; We're called from one of the children already. | 800 | ;; We're called from one of the children already. |
| 793 | (funcall ,(symbol-function 'tex-mode)) | 801 | (tex-mode-internal) |
| 794 | (tex-guess-mode)))) | 802 | (tex-guess-mode))) |
| 795 | 803 | ||
| 796 | ;;;###autoload | 804 | ;;;###autoload |
| 797 | (defalias 'TeX-mode 'tex-mode) | 805 | (defalias 'TeX-mode 'tex-mode) |