aboutsummaryrefslogtreecommitdiffstats
path: root/lisp
diff options
context:
space:
mode:
authorKarl Heuer <[email protected]>1995-07-28 00:26:37 +0000
committerKarl Heuer <[email protected]>1995-07-28 00:26:37 +0000
commit0fb4f2457b212d9a369076dac2daf0297708887d (patch)
treee4622b3c0d3de5ea20d494c1c37823e3cc740c09 /lisp
parente4cfb70d5cd2eddec3c8c9b6ee49bc3485ff8e66 (diff)
(latex-imenu-generic-expression): Var defined.
(latex-mode): Set imenu-generic-expression.
Diffstat (limited to 'lisp')
-rw-r--r--lisp/textmodes/tex-mode.el16
1 files changed, 16 insertions, 0 deletions
diff --git a/lisp/textmodes/tex-mode.el b/lisp/textmodes/tex-mode.el
index 2aca111ee6..62e47a8bbe 100644
--- a/lisp/textmodes/tex-mode.el
+++ b/lisp/textmodes/tex-mode.el
@@ -178,6 +178,20 @@ Set by \\[tex-region], \\[tex-buffer], and \\[tex-file].")
(defvar tex-mode-syntax-table nil
"Syntax table used while in TeX mode.")
+;; Written by Wolfgang Bangerth <[email protected]>
+(defvar latex-imenu-generic-expression
+ '(
+ ("Part" "\\\\part{\\([^}]*\\)}" 1)
+ ("Chapter" "\\\\chapter{\\([^}]*\\)}" 1)
+ ("Section" "\\\\[a-zA-Z]*section{\\([^}]*\\)}" 1)
+ ;; i put numbers like 3.15 before my
+ ;; \begin{equation}'s which tell me
+ ;; the number the equation will get when
+ ;; being printed.
+ ("Equations" "%[ \t]*\\([0-9]+\\.[0-9]+\\)[,;]?[ \t]?" 1))
+
+ "Imenu generic expression for LaTex mode. See `imenu-generic-expression'.")
+
(defun tex-define-common-keys (keymap)
"Define the keys that we want defined both in TeX mode and in the TeX shell."
(define-key keymap "\C-c\C-k" 'tex-kill-job)
@@ -401,6 +415,8 @@ subshell is initiated, `tex-shell-hook' is run."
\\\\[a-z]*space\\|\\\\[a-z]*skip\\|\
\\\\newpage\\|\\\\[a-z]*page[a-z]*\\|\\\\footnote\\|\
\\\\marginpar\\|\\\\parbox\\|\\\\caption\\)[ \t]*\\($\\|%\\)")
+ (make-local-variable 'imenu-generic-expression)
+ (setq imenu-generic-expression latex-imenu-generic-expression)
(run-hooks 'text-mode-hook 'tex-mode-hook 'latex-mode-hook))
;;;###autoload