aboutsummaryrefslogtreecommitdiffstats
path: root/lisp
diff options
context:
space:
mode:
authorRichard M. Stallman1996-01-26 19:57:45 +0000
committerRichard M. Stallman1996-01-26 19:57:45 +0000
commit6da9bbd6b23135ce70b75a486ef941d04fa403db (patch)
tree49f6489b56e5ca97b6bdfdce1a2cc971204e19b7 /lisp
parent14dacacd653d70334d4b6d7b09b5fe5e1929dac6 (diff)
downloademacs-6da9bbd6b23135ce70b75a486ef941d04fa403db.tar.gz
emacs-6da9bbd6b23135ce70b75a486ef941d04fa403db.zip
(tex-face-alist, tex-latex-face-alist): New variables.
(tex-common-initialization): Set facemenu-add-face-function, facemenu-end-add-face, facemenu-remove-face-function. (slitex-mode): Fix misspelling in value.
Diffstat (limited to 'lisp')
-rw-r--r--lisp/textmodes/tex-mode.el36
1 files changed, 32 insertions, 4 deletions
diff --git a/lisp/textmodes/tex-mode.el b/lisp/textmodes/tex-mode.el
index 427583a88f8..312ada43fab 100644
--- a/lisp/textmodes/tex-mode.el
+++ b/lisp/textmodes/tex-mode.el
@@ -21,8 +21,9 @@
21;; GNU General Public License for more details. 21;; GNU General Public License for more details.
22 22
23;; You should have received a copy of the GNU General Public License 23;; You should have received a copy of the GNU General Public License
24;; along with GNU Emacs; see the file COPYING. If not, write to 24;; along with GNU Emacs; see the file COPYING. If not, write to the
25;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. 25;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
26;; Boston, MA 02111-1307, USA.
26 27
27;;; Code: 28;;; Code:
28 29
@@ -255,6 +256,20 @@ Set by \\[tex-region], \\[tex-buffer], and \\[tex-file].")
255 "Keymap for the TeX shell. 256 "Keymap for the TeX shell.
256Inherits `shell-mode-map' with a few additions.") 257Inherits `shell-mode-map' with a few additions.")
257 258
259(defvar tex-face-alist
260 '((bold . "{\\bf ")
261 (italic . "{\\it ")
262 (bold-italic . "{\\bi ") ; hypothetical
263 (underline . "\\underline{")
264 (default . "{\\rm "))
265 "Alist of face and TeX font name for facemenu.")
266
267(defvar tex-latex-face-alist
268 `((italic . "{\\em ")
269 ,@tex-face-alist)
270 "Alist of face and LaTeX font name for facemenu.")
271
272
258(defvar compare-windows-whitespace) ; Pacify the byte-compiler 273(defvar compare-windows-whitespace) ; Pacify the byte-compiler
259 274
260;;; This would be a lot simpler if we just used a regexp search, 275;;; This would be a lot simpler if we just used a regexp search,
@@ -417,6 +432,8 @@ subshell is initiated, `tex-shell-hook' is run."
417\\\\marginpar\\|\\\\parbox\\|\\\\caption\\)[ \t]*\\($\\|%\\)") 432\\\\marginpar\\|\\\\parbox\\|\\\\caption\\)[ \t]*\\($\\|%\\)")
418 (make-local-variable 'imenu-generic-expression) 433 (make-local-variable 'imenu-generic-expression)
419 (setq imenu-generic-expression latex-imenu-generic-expression) 434 (setq imenu-generic-expression latex-imenu-generic-expression)
435 (make-local-variable 'tex-face-alist)
436 (setq tex-face-alist tex-latex-face-alist)
420 (run-hooks 'text-mode-hook 'tex-mode-hook 'latex-mode-hook)) 437 (run-hooks 'text-mode-hook 'tex-mode-hook 'latex-mode-hook))
421 438
422;;;###autoload 439;;;###autoload
@@ -466,7 +483,7 @@ Entering SliTeX mode runs the hook `text-mode-hook', then the hook
466 (setq mode-name "SliTeX") 483 (setq mode-name "SliTeX")
467 (setq major-mode 'slitex-mode) 484 (setq major-mode 'slitex-mode)
468 (setq tex-command slitex-run-command) 485 (setq tex-command slitex-run-command)
469 (setq tex-start-of-header "\\\\documentstyle{slides}\\|\\\\docuentclass{slides}") 486 (setq tex-start-of-header "\\\\documentstyle{slides}\\|\\\\documentclass{slides}")
470 (setq tex-end-of-header "\\\\begin{document}") 487 (setq tex-end-of-header "\\\\begin{document}")
471 (setq tex-trailer "\\end{document}\n") 488 (setq tex-trailer "\\end{document}\n")
472 ;; A line containing just $$ is treated as a paragraph separator. 489 ;; A line containing just $$ is treated as a paragraph separator.
@@ -535,6 +552,17 @@ Entering SliTeX mode runs the hook `text-mode-hook', then the hook
535 (setq parse-sexp-ignore-comments t) 552 (setq parse-sexp-ignore-comments t)
536 (make-local-variable 'compare-windows-whitespace) 553 (make-local-variable 'compare-windows-whitespace)
537 (setq compare-windows-whitespace 'tex-categorize-whitespace) 554 (setq compare-windows-whitespace 'tex-categorize-whitespace)
555 (make-local-variable 'facemenu-add-face-function)
556 (make-local-variable 'facemenu-end-add-face)
557 (make-local-variable 'facemenu-remove-face-function)
558 (setq facemenu-add-face-function
559 (lambda (face end)
560 (let ((face-text (cdr (assq face tex-face-alist))))
561 (if face-text
562 face-text
563 (error "Face %s not configured for %s mode" face mode-name))))
564 facemenu-end-add-face "}"
565 facemenu-remove-face-function t)
538 (make-local-variable 'tex-command) 566 (make-local-variable 'tex-command)
539 (make-local-variable 'tex-start-of-header) 567 (make-local-variable 'tex-start-of-header)
540 (make-local-variable 'tex-end-of-header) 568 (make-local-variable 'tex-end-of-header)
@@ -1121,7 +1149,7 @@ so normally SUFFIX starts with one."
1121 (if (stringp file-name) 1149 (if (stringp file-name)
1122 (let ((file (file-name-nondirectory file-name)) 1150 (let ((file (file-name-nondirectory file-name))
1123 trial-name) 1151 trial-name)
1124 ;; Try spliting on last period. 1152 ;; Try splitting on last period.
1125 ;; The first-period split can get fooled when two files 1153 ;; The first-period split can get fooled when two files
1126 ;; named a.tex and a.b.tex are both tex'd; 1154 ;; named a.tex and a.b.tex are both tex'd;
1127 ;; the last-period split must be right if it matches at all. 1155 ;; the last-period split must be right if it matches at all.