Commit 7c4d13cc authored by Carsten Dominik's avatar Carsten Dominik

* reftex.el (reftex-compile-variables): respect new structure of

`reftex-index-macro'
(reftex-compile-variables): Use the changed structure of
`reftex-label-alist'.

* reftex-vars.el (reftex-index-math-format,
(reftex-toc-max-level): New option.
reftex-index-phrases-search-whole-words,
reftex-index-phrases-case-fold-search,
reftex-index-phrases-skip-indexed-matches,
reftex-index-phrases-wrap-long-lines,
reftex-index-phrases-sort-prefers-entry,
reftex-index-phrases-sort-in-blocks): New options.
(reftex-index-macros): Option structure changed.
(reftex-index-macros-builtin): Added `repeat' item to each entry.
(reftex-label-alist): Additional item in each entry to specify if
the environment should be listed in the TOC.
(eval-when-compile (require 'cl)) added.

* reftex-index.el (reftex-index-selection-or-word): No longer
deals with "repeat".
(reftex-index): "repeat property in `reftex-index-macro-alist' is
now used.
(reftex-index-phrases-comment-regexp,
reftex-index-phrases-macrodef-regexp,
reftex-index-phrases-phrase-regexp1,
reftex-index-phrases-phrase-regexp2,
reftex-index-phrases-phrase-regexp12, reftex-index-phrases-help):
New constants.
(reftex-index-phrases-macro-data, reftex-index-phrases-files,
reftex-index-phrases-font-lock-keywords,
reftex-index-phrases-font-lock-defaults, reftex-index-phrases-map,
reftex-index-phrases-restrict-file): New variables.
(reftex-index-phrase-selection-or-word,
reftex-index-visit-phrases-buffer,
reftex-index-initialize-phrases-buffer,
reftex-index-phrases-save-and-return, reftex-index-phrases-mode,
reftex-index-next-phrase, reftex-index-this-phrase,
reftex-index-all-phrases, reftex-index-region-phrases,
reftex-index-phrases-parse-header,
reftex-index-phrases-toggle-restricted, reftex-index-new-phrase,
reftex-index-find-next-conflict-phrase, reftex-index-phrases-info,
reftex-index-phrases-set-macro-key, reftex-index-sort-phrases,
reftex-compare-phrase-lines, reftex-index-make-phrase-regexp,
reftex-index-simplify-phrase, reftex-index-phrases-find-dup-re,
reftex-index-make-replace-string,
reftex-query-index-phrase-globally, reftex-query-index-phrase,
reftex-index-phrase-match-is-indexed,
reftex-index-phrases-fixup-line,
reftex-index-phrases-replace-space,
reftex-index-select-phrases-macro): New functions.
(reftex-index-globalize, reftex-index-globally): functions removed
(eval-when-compile (require 'cl)) added.

* reftex-toc.el (reftex-toc-mode): Create new indicator for max
level.
(reftex-toc-max-level-indicator): New variable.
(reftex-toc-max-level): New command.
(reftex-toc-map): New keybinding `t'.
(reftex-toc-help): Constant updated.
(eval-when-compile (require 'cl)) added.

* reftex-ref.el (reftex-offer-label-menu): Prefix to `t' command key
can change `reftex-toc-max-level'
(eval-when-compile (require 'cl)) added.

* reftex-sel (reftex-insert-docstruct): Respect
`reftex-toc-max-level'
(eval-when-compile (require 'cl)) added.

* reftex-auc.el (eval-when-compile (require 'cl)) added.

* reftex-vcr.el (eval-when-compile (require 'cl)) added.

* reftex-cite.el (reftex-citep, reftex-citet): New commands.
(reftex-citation, reftex-do-citation,
reftex-figure-out-cite-format): Additional argument FORMAT-KEY to
preselect a citation format.
(eval-when-compile (require 'cl)) added.

* reftex-parse.el (reftex-context-substring): Optional parameter
to-end
(reftex-section-info): Deal with environment matches.
(eval-when-compile (require 'cl)) added.

* reftex-global.el (eval-when-compile (require 'cl)) added.
parent cfad01b4
;;; reftex-auc.el - RefTeX's interface to AUC TeX ;;; reftex-auc.el - RefTeX's interface to AUC TeX
;;; Version: 4.6 ;;; Version: 4.9
;;; ;;;
;;; See main file reftex.el for licensing information ;;; See main file reftex.el for licensing information
(eval-when-compile (require 'cl))
(provide 'reftex-auc) (provide 'reftex-auc)
(require 'reftex) (require 'reftex)
;;; ;;;
......
;;; reftex-cite.el - Creating citations with RefTeX ;;; reftex-cite.el - Creating citations with RefTeX
;;; Version: 4.6 ;;; Version: 4.9
;;; ;;;
;;; See main file reftex.el for licensing information ;;; See main file reftex.el for licensing information
(eval-when-compile (require 'cl))
(provide 'reftex-cite) (provide 'reftex-cite)
(require 'reftex) (require 'reftex)
;;; ;;;
...@@ -501,7 +502,7 @@ ...@@ -501,7 +502,7 @@
;; Make a citation ;; Make a citation
;;;###autoload ;;;###autoload
(defun reftex-citation (&optional no-insert) (defun reftex-citation (&optional no-insert format-key)
"Make a citation using BibTeX database files. "Make a citation using BibTeX database files.
After prompting for a regular expression, scans the buffers with After prompting for a regular expression, scans the buffers with
bibtex entries (taken from the \\bibliography command) and offers the bibtex entries (taken from the \\bibliography command) and offers the
...@@ -510,6 +511,8 @@ to `reftex-cite-format' and inserted into the buffer. ...@@ -510,6 +511,8 @@ to `reftex-cite-format' and inserted into the buffer.
If NO-INSERT is non-nil, nothing is inserted, only the selected key returned. If NO-INSERT is non-nil, nothing is inserted, only the selected key returned.
FORAT-KEY can be used to pre-select a citation format.
When called with one or two `C-u' prefixes, first rescans the document. When called with one or two `C-u' prefixes, first rescans the document.
When called with a numeric prefix, make that many citations. When When called with a numeric prefix, make that many citations. When
called with point inside the braces of a `\cite' command, it will called with point inside the braces of a `\cite' command, it will
...@@ -533,13 +536,13 @@ While entering the regexp, completion on knows citation keys is possible. ...@@ -533,13 +536,13 @@ While entering the regexp, completion on knows citation keys is possible.
;; Call reftex-do-citation, but protected ;; Call reftex-do-citation, but protected
(unwind-protect (unwind-protect
(reftex-do-citation current-prefix-arg no-insert) (reftex-do-citation current-prefix-arg no-insert format-key)
(reftex-kill-temporary-buffers))) (reftex-kill-temporary-buffers)))
(defun reftex-do-citation (&optional arg no-insert) (defun reftex-do-citation (&optional arg no-insert format-key)
;; This really does the work of reftex-citation. ;; This really does the work of reftex-citation.
(let* ((format (reftex-figure-out-cite-format arg no-insert)) (let* ((format (reftex-figure-out-cite-format arg no-insert format-key))
(docstruct-symbol reftex-docstruct-symbol) (docstruct-symbol reftex-docstruct-symbol)
(selected-entries (reftex-offer-bib-menu)) (selected-entries (reftex-offer-bib-menu))
(insert-entries selected-entries) (insert-entries selected-entries)
...@@ -610,7 +613,7 @@ While entering the regexp, completion on knows citation keys is possible. ...@@ -610,7 +613,7 @@ While entering the regexp, completion on knows citation keys is possible.
;; Return the citation key ;; Return the citation key
(car (car selected-entries)))) (car (car selected-entries))))
(defun reftex-figure-out-cite-format (arg no-insert) (defun reftex-figure-out-cite-format (arg &optional no-insert format-key)
;; Check if there is already a cite command at point and change cite format ;; Check if there is already a cite command at point and change cite format
;; in order to only add another reference in the same cite command. ;; in order to only add another reference in the same cite command.
(let ((macro (car (reftex-what-macro 1))) (let ((macro (car (reftex-what-macro 1)))
...@@ -640,19 +643,30 @@ While entering the regexp, completion on knows citation keys is possible. ...@@ -640,19 +643,30 @@ While entering the regexp, completion on knows citation keys is possible.
cite-format-value)) cite-format-value))
(when (listp format) (when (listp format)
(setq key (setq key
(reftex-select-with-char (or format-key
"" (concat "SELECT A CITATION FORMAT\n\n" (reftex-select-with-char
(mapconcat "" (concat "SELECT A CITATION FORMAT\n\n"
(lambda (x) (mapconcat
(format "[%c] %s %s" (car x) (lambda (x)
(if (> (car x) 31) " " "") (format "[%c] %s %s" (car x)
(cdr x))) (if (> (car x) 31) " " "")
format "\n")))) (cdr x)))
format "\n")))))
(if (assq key format) (if (assq key format)
(setq format (cdr (assq key format))) (setq format (cdr (assq key format)))
(error "No citation format associated with key `%c'" key))))) (error "No citation format associated with key `%c'" key)))))
format)) format))
(defun reftex-citep ()
"Call `reftex-citation' with a format selector `?p'."
(interactive)
(reftex-citation nil ?p))
(defun reftex-citet ()
"Call `reftex-citation' with a format selector `?t'."
(interactive)
(reftex-citation nil ?t))
(defvar reftex-select-bib-map) (defvar reftex-select-bib-map)
(defun reftex-offer-bib-menu () (defun reftex-offer-bib-menu ()
;; Offer bib menu and return list of selected items ;; Offer bib menu and return list of selected items
......
;;; reftex-global.el - Operations on entire documents with RefTeX ;;; reftex-global.el - Operations on entire documents with RefTeX
;;; Version: 4.6 ;;; Version: 4.9
;;; ;;;
;;; See main file reftex.el for licensing information ;;; See main file reftex.el for licensing information
(eval-when-compile (require 'cl))
(provide 'reftex-global) (provide 'reftex-global)
(require 'reftex) (require 'reftex)
;;; ;;;
...@@ -191,7 +192,7 @@ one with the `xr' package." ...@@ -191,7 +192,7 @@ one with the `xr' package."
(if (assoc label translate-alist) (if (assoc label translate-alist)
(error "Duplicate label %s" label)) (error "Duplicate label %s" label))
(setq new-label (concat (match-string 1 (car entry)) (setq new-label (concat (match-string 1 (car entry))
(incf (cdr nr-cell)))) (int-to-string (incf (cdr nr-cell)))))
(push (cons label new-label) translate-alist) (push (cons label new-label) translate-alist)
(or (string= label new-label) (setq changed-sequence t)))) (or (string= label new-label) (setq changed-sequence t))))
......
This diff is collapsed.
;;; reftex-parse.el - Parser Functions for RefTeX ;;; reftex-parse.el - Parser Functions for RefTeX
;;; Version: 4.6 ;;; Version: 4.9
;;; ;;;
;;; See main file reftex.el for licensing information ;;; See main file reftex.el for licensing information
(eval-when-compile (require 'cl))
(provide 'reftex-parse) (provide 'reftex-parse)
(require 'reftex) (require 'reftex)
...@@ -216,16 +217,18 @@ of master file." ...@@ -216,16 +217,18 @@ of master file."
;; Insert in List ;; Insert in List
(setq toc-entry (reftex-section-info file)) (setq toc-entry (reftex-section-info file))
(setq level (nth 5 toc-entry)) (when toc-entry
(setq highest-level (min highest-level level)) ;; It can happen that section info returns nil
(if (= level highest-level) (setq level (nth 5 toc-entry))
(message (setq highest-level (min highest-level level))
"Scanning %s %s ..." (if (= level highest-level)
(car (rassoc level reftex-section-levels-all)) (message
(nth 6 toc-entry))) "Scanning %s %s ..."
(car (rassoc level reftex-section-levels-all))
(push toc-entry docstruct) (nth 6 toc-entry)))
(setq reftex-active-toc toc-entry))
(push toc-entry docstruct)
(setq reftex-active-toc toc-entry)))
((match-end 7) ((match-end 7)
;; It's an include or input ;; It's an include or input
...@@ -355,6 +358,9 @@ of master file." ...@@ -355,6 +358,9 @@ of master file."
;; Carefull: This function expects the match-data to be still in place! ;; Carefull: This function expects the match-data to be still in place!
(let* ((marker (set-marker (make-marker) (1- (match-beginning 3)))) (let* ((marker (set-marker (make-marker) (1- (match-beginning 3))))
(macro (reftex-match-string 3)) (macro (reftex-match-string 3))
(prefix (save-match-data
(if (string-match "begin{\\([^}]+\\)}" macro)
(match-string 1 macro))))
(level-exp (cdr (assoc macro reftex-section-levels-all))) (level-exp (cdr (assoc macro reftex-section-levels-all)))
(level (if (symbolp level-exp) (level (if (symbolp level-exp)
(save-match-data (funcall level-exp)) (save-match-data (funcall level-exp))
...@@ -363,7 +369,9 @@ of master file." ...@@ -363,7 +369,9 @@ of master file."
(unnumbered (or star (< level 0))) (unnumbered (or star (< level 0)))
(level (abs level)) (level (abs level))
(section-number (reftex-section-number level unnumbered)) (section-number (reftex-section-number level unnumbered))
(text1 (save-match-data (save-excursion (reftex-context-substring)))) (text1 (save-match-data
(save-excursion
(reftex-context-substring prefix))))
(literal (buffer-substring-no-properties (literal (buffer-substring-no-properties
(1- (match-beginning 3)) (1- (match-beginning 3))
(min (point-max) (+ (match-end 0) (length text1) 1)))) (min (point-max) (+ (match-end 0) (length text1) 1))))
...@@ -376,6 +384,7 @@ of master file." ...@@ -376,6 +384,7 @@ of master file."
(make-string (* reftex-level-indent level) ?\ ) (make-string (* reftex-level-indent level) ?\ )
(if (nth 1 reftex-label-menu-flags) ; section number flag (if (nth 1 reftex-label-menu-flags) ; section number flag
(concat section-number " ")) (concat section-number " "))
(if prefix (concat (capitalize prefix) ": ") "")
text)) text))
(list 'toc "toc" text file marker level section-number (list 'toc "toc" text file marker level section-number
literal (marker-position marker)))) literal (marker-position marker))))
...@@ -908,10 +917,20 @@ of master file." ...@@ -908,10 +917,20 @@ of master file."
(forward-list 1)) (forward-list 1))
(error nil))) (error nil)))
(defun reftex-context-substring () (defun reftex-context-substring (&optional to-end)
;; Return up to 150 chars from point ;; Return up to 150 chars from point
;; When point is just after a { or [, limit string to matching parenthesis ;; When point is just after a { or [, limit string to matching parenthesis
(cond (cond
(to-end
;; Environment - find next \end
(buffer-substring-no-properties
(point)
(min (+ (point) 150)
(save-match-data
;; FIXME: THis is not perfect
(if (re-search-forward "\\\\end{" nil t)
(match-beginning 0)
(point-max))))))
((or (= (preceding-char) ?\{) ((or (= (preceding-char) ?\{)
(= (preceding-char) ?\[)) (= (preceding-char) ?\[))
;; Inside a list - get only the list. ;; Inside a list - get only the list.
......
;;; reftex-ref.el - Code to create labels and references with RefTeX ;;; reftex-ref.el - Code to create labels and references with RefTeX
;;; Version: 4.6 ;;; Version: 4.9
;;; ;;;
;;; See main file reftex.el for licensing information ;;; See main file reftex.el for licensing information
(eval-when-compile (require 'cl))
(provide 'reftex-ref) (provide 'reftex-ref)
(require 'reftex) (require 'reftex)
;;; ;;;
...@@ -561,9 +562,12 @@ When called with 2 C-u prefix args, disable magic word recognition." ...@@ -561,9 +562,12 @@ When called with 2 C-u prefix args, disable magic word recognition."
(setq here-I-am here-I-am1) (setq here-I-am here-I-am1)
(setq typekey (reftex-query-label-type))) (setq typekey (reftex-query-label-type)))
((eq key ?t) ((eq key ?t)
;; toggle table of contents display ;; toggle table of contents display, or change depth
(reftex-erase-buffer) (reftex-erase-buffer)
(setq toc (not toc))) (if current-prefix-arg
(setq reftex-toc-max-level (prefix-numeric-value
current-prefix-arg))
(setq toc (not toc))))
((eq key ?F) ((eq key ?F)
;; toggle display of included file borders ;; toggle display of included file borders
(reftex-erase-buffer) (reftex-erase-buffer)
......
;;; reftex-sel.el - The selection modes for RefTeX ;;; reftex-sel.el - The selection modes for RefTeX
;;; Version: 4.6 ;;; Version: 4.9
;;; ;;;
;;; See main file reftex.el for licensing information ;;; See main file reftex.el for licensing information
(eval-when-compile (require 'cl))
(provide 'reftex-sel) (provide 'reftex-sel)
(require 'reftex) (require 'reftex)
;;; ;;;
...@@ -180,7 +181,8 @@ During a selection process, these are the local bindings. ...@@ -180,7 +181,8 @@ During a selection process, these are the local bindings.
((eq (car cell) 'toc) ((eq (car cell) 'toc)
;; a table of contents entry ;; a table of contents entry
(when toc (when (and toc
(<= (nth 5 cell) reftex-toc-max-level))
(if (eq offset 'attention) (setq offset cell)) (if (eq offset 'attention) (setq offset cell))
(setq reftex-active-toc cell) (setq reftex-active-toc cell)
(insert (concat toc-indent (nth 2 cell) "\n")) (insert (concat toc-indent (nth 2 cell) "\n"))
......
;;; reftex-toc.el - RefTeX's table of contents mode ;;; reftex-toc.el - RefTeX's table of contents mode
;;; Version: 4.6 ;;; Version: 4.9
;;; ;;;
;;; See main file reftex.el for licensing information ;;; See main file reftex.el for licensing information
(eval-when-compile (require 'cl))
(provide 'reftex-toc) (provide 'reftex-toc)
(require 'reftex) (require 'reftex)
;;; ;;;
...@@ -27,12 +28,16 @@ Here are all local bindings. ...@@ -27,12 +28,16 @@ Here are all local bindings.
(use-local-map reftex-toc-map) (use-local-map reftex-toc-map)
(set (make-local-variable 'revert-buffer-function) 'reftex-toc-revert) (set (make-local-variable 'revert-buffer-function) 'reftex-toc-revert)
(set (make-local-variable 'reftex-toc-include-labels-indicator) "") (set (make-local-variable 'reftex-toc-include-labels-indicator) "")
(set (make-local-variable 'reftex-toc-include-index-indicator) "") (set (make-local-variable 'reftex-toc-max-level-indicator)
(if (= reftex-toc-max-level 100)
"ALL"
(int-to-string reftex-toc-max-level)))
(setq mode-line-format (setq mode-line-format
(list "---- " 'mode-line-buffer-identification (list "---- " 'mode-line-buffer-identification
" " 'global-mode-string " (" mode-name ")" " " 'global-mode-string " (" mode-name ")"
" L<" 'reftex-toc-include-labels-indicator ">" " L<" 'reftex-toc-include-labels-indicator ">"
" I<" 'reftex-toc-include-index-indicator ">" " I<" 'reftex-toc-include-index-indicator ">"
" T<" 'reftex-toc-max-level-indicator ">"
" -%-")) " -%-"))
(setq truncate-lines t) (setq truncate-lines t)
(make-local-hook 'post-command-hook) (make-local-hook 'post-command-hook)
...@@ -49,6 +54,7 @@ Here are all local bindings. ...@@ -49,6 +54,7 @@ Here are all local bindings.
(defvar reftex-last-window-height nil) (defvar reftex-last-window-height nil)
(defvar reftex-toc-include-labels-indicator nil) (defvar reftex-toc-include-labels-indicator nil)
(defvar reftex-toc-include-index-indicator nil) (defvar reftex-toc-include-index-indicator nil)
(defvar reftex-toc-max-level-indicator nil)
(defvar reftex-toc-return-marker (make-marker) (defvar reftex-toc-return-marker (make-marker)
"Marker which makes it possible to return from toc to old position.") "Marker which makes it possible to return from toc to old position.")
...@@ -63,6 +69,7 @@ RET Goto the location and hide the *toc* window (also on mouse-2). ...@@ -63,6 +69,7 @@ RET Goto the location and hide the *toc* window (also on mouse-2).
C-c > Display Index. With prefix arg, restrict index to current section. C-c > Display Index. With prefix arg, restrict index to current section.
q / k Hide/Kill *toc* buffer, return to position of reftex-toc command. q / k Hide/Kill *toc* buffer, return to position of reftex-toc command.
l i c F Toggle display of [l]abels, [i]ndex, [c]ontext, [F]ile borders. l i c F Toggle display of [l]abels, [i]ndex, [c]ontext, [F]ile borders.
t Change maximum toc depth (e.g. `3 t' hides levels greater than 3).
f / g Toggle follow mode on and off / Refresh *toc* buffer. f / g Toggle follow mode on and off / Refresh *toc* buffer.
r / C-u r Reparse the LaTeX document / Reparse entire LaTeX document. r / C-u r Reparse the LaTeX document / Reparse entire LaTeX document.
. In other window, show position from where `reftex-toc' was called. . In other window, show position from where `reftex-toc' was called.
...@@ -281,6 +288,17 @@ Label context is only displayed when the labels are there as well." ...@@ -281,6 +288,17 @@ Label context is only displayed when the labels are there as well."
(interactive) (interactive)
(setq reftex-toc-include-context (not reftex-toc-include-context)) (setq reftex-toc-include-context (not reftex-toc-include-context))
(reftex-toc-revert)) (reftex-toc-revert))
(defun reftex-toc-max-level (arg)
"Set the maximum level of toc lines in this buffer to value of prefix ARG.
When no prefix is given, set the max level to a large number, so that all
levels are shown. For eaxample, to set the level to 3, type `3 m'."
(interactive "P")
(setq reftex-toc-max-level (if arg
(prefix-numeric-value arg)
100))
(setq reftex-toc-max-level-indicator
(if arg (int-to-string reftex-toc-max-level) "ALL"))
(reftex-toc-revert))
(defun reftex-toc-view-line () (defun reftex-toc-view-line ()
"View document location in other window." "View document location in other window."
(interactive) (interactive)
...@@ -473,7 +491,7 @@ With prefix arg 1, restrict index to the section at point." ...@@ -473,7 +491,7 @@ With prefix arg 1, restrict index to the section at point."
(car (car
(rassq level (rassq level
reftex-section-levels-all))) reftex-section-levels-all)))
"[[{]")))) "[[{]?"))))
((or (not no-revisit) ((or (not no-revisit)
(reftex-get-buffer-visiting file)) (reftex-get-buffer-visiting file))
;; Marker is lost. Use the backup method. ;; Marker is lost. Use the backup method.
...@@ -535,6 +553,7 @@ With prefix arg 1, restrict index to the section at point." ...@@ -535,6 +553,7 @@ With prefix arg 1, restrict index to the section at point."
("F" . reftex-toc-toggle-file-boundary) ("F" . reftex-toc-toggle-file-boundary)
("i" . reftex-toc-toggle-index) ("i" . reftex-toc-toggle-index)
("l" . reftex-toc-toggle-labels) ("l" . reftex-toc-toggle-labels)
("t" . reftex-toc-max-level)
("c" . reftex-toc-toggle-context) ("c" . reftex-toc-toggle-context)
("%" . reftex-toc-toggle-commented) ("%" . reftex-toc-toggle-commented)
("x" . reftex-toc-external) ("x" . reftex-toc-external)
......
;;; reftex-vars.el - Configuration variables for RefTeX ;;; reftex-vars.el - Configuration variables for RefTeX
;;; Version: 4.6 ;;; Version: 4.9
;;; ;;;
;;; See main file reftex.el for licensing information ;;; See main file reftex.el for licensing information
(eval-when-compile (require 'cl))
(provide 'reftex-vars) (provide 'reftex-vars)
;; Define the two constants which are needed during compilation ;; Define the two constants which are needed during compilation
...@@ -151,18 +152,18 @@ The following conventions are valid for all alist entries: ...@@ -151,18 +152,18 @@ The following conventions are valid for all alist entries:
(defconst reftex-index-macros-builtin (defconst reftex-index-macros-builtin
'((default "Default \\index and \\glossary macros" '((default "Default \\index and \\glossary macros"
(("\\index{*}" "idx" ?i "" nil) (("\\index{*}" "idx" ?i "" nil t)
("\\glossary{*}" "glo" ?g "" nil))) ("\\glossary{*}" "glo" ?g "" nil t)))
(multind "The multind.sty package" (multind "The multind.sty package"
(("\\index{}{*}" 1 ?i "" nil))) (("\\index{}{*}" 1 ?i "" nil t)))
(index "The index.sty package" (index "The index.sty package"
(("\\index[]{*}" 1 ?i "" nil) (("\\index[]{*}" 1 ?i "" nil t)
("\\index*[]{*}" 1 ?I "" nil))) ("\\index*[]{*}" 1 ?I "" nil nil)))
(Index-Shortcut "index.sty with \\shortindexingon" (Index-Shortcut "index.sty with \\shortindexingon"
(("\\index[]{*}" 1 ?i "" nil) (("\\index[]{*}" 1 ?i "" nil t)
("\\index*[]{*}" 1 ?I "" nil) ("\\index*[]{*}" 1 ?I "" nil nil)
("^[]{*}" 1 ?^ "" texmathp) ("^[]{*}" 1 ?^ "" texmathp t)
("_[]{*}" 1 ?_ "" texmathp)))) ("_[]{*}" 1 ?_ "" texmathp nil))))
"Builtin stuff for reftex-index-macros. "Builtin stuff for reftex-index-macros.
Lower-case symbols correspond to a style file of the same name in the LaTeX Lower-case symbols correspond to a style file of the same name in the LaTeX
distribution. Mixed-case symbols are convenience aliases.") distribution. Mixed-case symbols are convenience aliases.")
...@@ -186,6 +187,14 @@ distribution. Mixed-case symbols are convenience aliases.") ...@@ -186,6 +187,14 @@ distribution. Mixed-case symbols are convenience aliases.")
"A multifile table of contents browser." "A multifile table of contents browser."
:group 'reftex) :group 'reftex)
(defcustom reftex-toc-max-level 100
"*The maximum level of toc entries which will be included in the TOC.
Section headings with a bigger level will be ignored. In RefTeX, chapters
are level 1, sections are level 2 etc.
This variable can be changed from within the *toc* buffer with the `t' key."
:group 'reftex-table-of-contents-browser
:type 'integer)
(defcustom reftex-toc-keep-other-windows t (defcustom reftex-toc-keep-other-windows t
"*Non-nil means, split the selected window to display the *toc* buffer. "*Non-nil means, split the selected window to display the *toc* buffer.
This helps to keep the window configuration, but makes the *toc* small. This helps to keep the window configuration, but makes the *toc* small.
...@@ -284,7 +293,7 @@ The value of the variable must be a list of items. Each item is a list ...@@ -284,7 +293,7 @@ The value of the variable must be a list of items. Each item is a list
itself and has the following structure: itself and has the following structure:
(ENV-OR-MACRO TYPE-KEY LABEL-PREFIX REFERENCE-FORMAT CONTEXT-METHOD (ENV-OR-MACRO TYPE-KEY LABEL-PREFIX REFERENCE-FORMAT CONTEXT-METHOD
(MAGIC-WORD ... )) (MAGIC-WORD ... ) TOC-LEVEL)
Each list entry describes either an environment carrying a counter for use Each list entry describes either an environment carrying a counter for use
with \\label and \\ref, or a LaTeX macro defining a label as (or inside) with \\label and \\ref, or a LaTeX macro defining a label as (or inside)
...@@ -385,6 +394,14 @@ MAGIC-WORDS ...@@ -385,6 +394,14 @@ MAGIC-WORDS
strings are interpreted as regular expressions. RefTeX will add strings are interpreted as regular expressions. RefTeX will add
a \"\\\\W\" to the beginning and other stuff to the end of the regexp. a \"\\\\W\" to the beginning and other stuff to the end of the regexp.
TOC-LEVEL
The integer level at which this environment should be added to the
table of contents. See also `reftex-section-levels'. A positive
value will number the entries mixed with the sectioning commands of
the same level. A negative value will make unnumbered entries.
Useful only for theorem-like environments, will be ignored for macros.
When omitted or nil, no TOC entries will be made.
If the type indicator characters of two or more entries are the same, RefTeX If the type indicator characters of two or more entries are the same, RefTeX
will use will use
- the first non-nil format and prefix - the first non-nil format and prefix
...@@ -425,7 +442,10 @@ list. However, builtin defaults should normally be set with the variable ...@@ -425,7 +442,10 @@ list. However, builtin defaults should normally be set with the variable
(const :tag "Eqnarray-like" eqnarray-like) (const :tag "Eqnarray-like" eqnarray-like)
(const :tag "Alignat-like" alignat-like) (const :tag "Alignat-like" alignat-like)
(symbol :tag "Function" my-func)) (symbol :tag "Function" my-func))
(repeat :tag "Magic words" :extra-offset 2 (string))) (repeat :tag "Magic words" :extra-offset 2 (string))
(option (choice :tag "Make TOC entry "
(const :tag "No entry" nil)
(integer :tag "Level" :value -3))))
(choice (choice
:tag "Package" :tag "Package"
:value AMSTeX :value AMSTeX
...@@ -982,7 +1002,7 @@ These correspond to the makeindex keywords LEVEL ENCAP ACTUAL QUOTE ESCAPE." ...@@ -982,7 +1002,7 @@ These correspond to the makeindex keywords LEVEL ENCAP ACTUAL QUOTE ESCAPE."
(defcustom reftex-index-macros nil (defcustom reftex-index-macros nil
"Macros which define index entries. The structure is "Macros which define index entries. The structure is
(MACRO INDEX-TAG KEY PREFIX EXCLUDE) (MACRO INDEX-TAG KEY PREFIX EXCLUDE REPEAT)
MACRO is the macro. Arguments should be denoted by empty braces like MACRO is the macro. Arguments should be denoted by empty braces like
\\index[]{*}. Use square brackets to denote optional arguments. The star \\index[]{*}. Use square brackets to denote optional arguments. The star
...@@ -1004,6 +1024,11 @@ EXCLUDE can be a function. If this function exists and returns a non-nil ...@@ -1004,6 +1024,11 @@ EXCLUDE can be a function. If this function exists and returns a non-nil
value, the index entry at point is ignored. This was implemented to support value, the index entry at point is ignored. This was implemented to support
the (deprecated) `^' and `_' shortcuts in the LaTeX2e `index' package. the (deprecated) `^' and `_' shortcuts in the LaTeX2e `index' package.
REPEAT, if non-nil, means the index macro does not typeset the entry in
the text, so that the text has to be repeated outside the index macro.
Needed for `reftex-index-selection-or-word' and for indexing from the
phrase buffer.
The final entry may also be a symbol if this entry has a association The final entry may also be a symbol if this entry has a association
in the variable `reftex-index-macros-builtin' to specify the main in the variable `reftex-index-macros-builtin' to specify the main
indexing package you are using. Legal values are currently indexing package you are using. Legal values are currently
...@@ -1021,13 +1046,14 @@ package here." ...@@ -1021,13 +1046,14 @@ package here."
(repeat (repeat
:inline t :inline t
(list :value ("" "idx" ?a "" nil) (list :value ("" "idx" ?a "" nil)
(string :tag "Macro with args") (string :tag "Macro with args")
(choice :tag "Index Tag " (choice :tag "Index Tag "
(string) (string)
(integer :tag "Macro arg Nr" :value 1)) (integer :tag "Macro arg Nr" :value 1))
(character :tag "Access Key ") (character :tag "Access Key ")
(string :tag "Key Prefix ")