summaryrefslogtreecommitdiff
path: root/lisp/textmodes
diff options
context:
space:
mode:
authorCarsten Dominik <dominik@science.uva.nl>2002-07-22 10:38:32 +0000
committerCarsten Dominik <dominik@science.uva.nl>2002-07-22 10:38:32 +0000
commit6fbeb4293696fae4524135e41c23fd78d566eeb0 (patch)
treee8cb868ed38728598a1978e6f67b41042ed56b7e /lisp/textmodes
parentb0e057bc0a65607340557686ca78d4489977455c (diff)
downloademacs-6fbeb4293696fae4524135e41c23fd78d566eeb0.tar.gz
Updated to reftex 4.17
Diffstat (limited to 'lisp/textmodes')
-rw-r--r--lisp/textmodes/reftex-auc.el4
-rw-r--r--lisp/textmodes/reftex-cite.el128
-rw-r--r--lisp/textmodes/reftex-dcr.el4
-rw-r--r--lisp/textmodes/reftex-global.el4
-rw-r--r--lisp/textmodes/reftex-index.el7
-rw-r--r--lisp/textmodes/reftex-parse.el10
-rw-r--r--lisp/textmodes/reftex-ref.el4
-rw-r--r--lisp/textmodes/reftex-sel.el4
-rw-r--r--lisp/textmodes/reftex-toc.el27
-rw-r--r--lisp/textmodes/reftex-vars.el116
-rw-r--r--lisp/textmodes/reftex.el53
11 files changed, 219 insertions, 142 deletions
diff --git a/lisp/textmodes/reftex-auc.el b/lisp/textmodes/reftex-auc.el
index 840bb889781..4546651da91 100644
--- a/lisp/textmodes/reftex-auc.el
+++ b/lisp/textmodes/reftex-auc.el
@@ -1,8 +1,8 @@
;;; reftex-auc.el --- RefTeX's interface to AUC TeX
;; Copyright (c) 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
-;; Author: Carsten Dominik <dominik@strw.LeidenUniv.nl>
-;; Version: 4.16
+;; Author: Carsten Dominik <dominik@science.uva.nl>
+;; Version: 4.17
;; This file is part of GNU Emacs.
diff --git a/lisp/textmodes/reftex-cite.el b/lisp/textmodes/reftex-cite.el
index 37833be278c..ebcfd991829 100644
--- a/lisp/textmodes/reftex-cite.el
+++ b/lisp/textmodes/reftex-cite.el
@@ -1,8 +1,8 @@
;;; reftex-cite.el --- creating citations with RefTeX
;; Copyright (c) 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
-;; Author: Carsten Dominik <dominik@strw.LeidenUniv.nl>
-;; Version: 4.16
+;; Author: Carsten Dominik <dominik@science.uva.nl>
+;; Version: 4.17
;; This file is part of GNU Emacs.
@@ -53,6 +53,15 @@
;; Find bibtex files
+
+(defmacro reftex-with-special-syntax-for-bib (&rest body)
+ `(let ((saved-syntax (syntax-table)))
+ (unwind-protect
+ (progn
+ (set-syntax-table reftex-syntax-table-for-bib)
+ ,@body)
+ (set-syntax-table saved-syntax))))
+
(defun reftex-default-bibliography ()
;; Return the expanded value of `reftex-default-bibliography'.
;; The expanded value is cached.
@@ -193,63 +202,64 @@
(message "Scanning bibliography database %s" buffer1))
(set-buffer buffer1)
- (save-excursion
- (goto-char (point-min))
- (while (re-search-forward first-re nil t)
- (catch 'search-again
- (setq key-point (point))
- (unless (re-search-backward
- "\\(\\`\\|[\n\r]\\)[ \t]*@\\([a-zA-Z]+\\)[ \t\n\r]*[{(]" nil t)
- (throw 'search-again nil))
- (setq start-point (point))
- (goto-char (match-end 0))
- (condition-case nil
- (up-list 1)
- (error (goto-char key-point)
+ (reftex-with-special-syntax-for-bib
+ (save-excursion
+ (goto-char (point-min))
+ (while (re-search-forward first-re nil t)
+ (catch 'search-again
+ (setq key-point (point))
+ (unless (re-search-backward
+ "\\(\\`\\|[\n\r]\\)[ \t]*@\\([a-zA-Z]+\\)[ \t\n\r]*[{(]" nil t)
+ (throw 'search-again nil))
+ (setq start-point (point))
+ (goto-char (match-end 0))
+ (condition-case nil
+ (up-list 1)
+ (error (goto-char key-point)
(throw 'search-again nil)))
- (setq end-point (point))
-
- ;; Ignore @string, @comment and @c entries or things
- ;; outside entries
- (when (or (string= (downcase (match-string 2)) "string")
- (string= (downcase (match-string 2)) "comment")
- (string= (downcase (match-string 2)) "c")
- (< (point) key-point)) ; this means match not in {}
- (goto-char key-point)
- (throw 'search-again nil))
-
- ;; Well, we have got a match
- (setq entry (concat
- (buffer-substring start-point (point)) "\n"))
-
- ;; Check if other regexp match as well
- (setq re-list rest-re)
- (while re-list
- (unless (string-match (car re-list) entry)
- ;; nope - move on
- (throw 'search-again nil))
- (pop re-list))
-
- (setq alist (reftex-parse-bibtex-entry
- nil start-point end-point))
- (push (cons "&entry" entry) alist)
-
- ;; check for crossref entries
- (if (assoc "crossref" alist)
- (setq alist
- (append
- alist (reftex-get-crossref-alist alist))))
-
- ;; format the entry
- (push (cons "&formatted" (reftex-format-bib-entry alist))
- alist)
-
- ;; make key the first element
- (push (reftex-get-bib-field "&key" alist) alist)
-
- ;; add it to the list
- (push alist found-list))))
- (reftex-kill-temporary-buffers))))
+ (setq end-point (point))
+
+ ;; Ignore @string, @comment and @c entries or things
+ ;; outside entries
+ (when (or (string= (downcase (match-string 2)) "string")
+ (string= (downcase (match-string 2)) "comment")
+ (string= (downcase (match-string 2)) "c")
+ (< (point) key-point)) ; this means match not in {}
+ (goto-char key-point)
+ (throw 'search-again nil))
+
+ ;; Well, we have got a match
+ (setq entry (concat
+ (buffer-substring start-point (point)) "\n"))
+
+ ;; Check if other regexp match as well
+ (setq re-list rest-re)
+ (while re-list
+ (unless (string-match (car re-list) entry)
+ ;; nope - move on
+ (throw 'search-again nil))
+ (pop re-list))
+
+ (setq alist (reftex-parse-bibtex-entry
+ nil start-point end-point))
+ (push (cons "&entry" entry) alist)
+
+ ;; check for crossref entries
+ (if (assoc "crossref" alist)
+ (setq alist
+ (append
+ alist (reftex-get-crossref-alist alist))))
+
+ ;; format the entry
+ (push (cons "&formatted" (reftex-format-bib-entry alist))
+ alist)
+
+ ;; make key the first element
+ (push (reftex-get-bib-field "&key" alist) alist)
+
+ ;; add it to the list
+ (push alist found-list)))))
+ (reftex-kill-temporary-buffers))))
(setq found-list (nreverse found-list))
;; Sorting
@@ -390,6 +400,7 @@
(progn
(set-buffer (get-buffer-create " *RefTeX-scratch*"))
(fundamental-mode)
+ (set-syntax-table reftex-syntax-table-for-bib)
(erase-buffer)
(insert entry))
(widen)
@@ -834,6 +845,7 @@ While entering the regexp, completion on knows citation keys is possible.
(defun reftex-format-names (namelist n)
(let (last (len (length namelist)))
+ (if (= n 0) (setq n len))
(cond
((< len 1) "")
((= 1 len) (car namelist))
diff --git a/lisp/textmodes/reftex-dcr.el b/lisp/textmodes/reftex-dcr.el
index 8c179ff32b1..c0af53a9bc6 100644
--- a/lisp/textmodes/reftex-dcr.el
+++ b/lisp/textmodes/reftex-dcr.el
@@ -1,8 +1,8 @@
;;; reftex-dcr.el --- viewing cross references and citations with RefTeX
;; Copyright (c) 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
-;; Author: Carsten Dominik <dominik@strw.LeidenUniv.nl>
-;; Version: 4.16
+;; Author: Carsten Dominik <dominik@science.uva.nl>
+;; Version: 4.17
;;
;; This file is part of GNU Emacs.
diff --git a/lisp/textmodes/reftex-global.el b/lisp/textmodes/reftex-global.el
index 6810b80adfc..d19b45d76de 100644
--- a/lisp/textmodes/reftex-global.el
+++ b/lisp/textmodes/reftex-global.el
@@ -1,8 +1,8 @@
;;; reftex-global.el --- operations on entire documents with RefTeX
;; Copyright (c) 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
-;; Author: Carsten Dominik <dominik@strw.LeidenUniv.nl>
-;; Version: 4.16
+;; Author: Carsten Dominik <dominik@science.uva.nl>
+;; Version: 4.17
;; This file is part of GNU Emacs.
diff --git a/lisp/textmodes/reftex-index.el b/lisp/textmodes/reftex-index.el
index 660dcfaadc2..5db364c371f 100644
--- a/lisp/textmodes/reftex-index.el
+++ b/lisp/textmodes/reftex-index.el
@@ -1,8 +1,8 @@
;;; reftex-index.el --- index support with RefTeX
;; Copyright (c) 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
-;; Author: Carsten Dominik <dominik@strw.LeidenUniv.nl>
-;; Version: 4.16
+;; Author: Carsten Dominik <dominik@science.uva.nl>
+;; Version: 4.17
;; This file is part of GNU Emacs.
@@ -1819,6 +1819,9 @@ both ends."
(unwind-protect
(while (re-search-forward re nil t)
(catch 'next-match
+ (if (and (fboundp reftex-index-verify-function)
+ (not (funcall reftex-index-verify-function)))
+ (throw 'next-match nil))
(setq match (match-string 0))
(setq mathp
(save-match-data
diff --git a/lisp/textmodes/reftex-parse.el b/lisp/textmodes/reftex-parse.el
index 1bb6a24bce5..3a42bc7d85b 100644
--- a/lisp/textmodes/reftex-parse.el
+++ b/lisp/textmodes/reftex-parse.el
@@ -1,8 +1,8 @@
;;; reftex-parse.el --- parser functions for RefTeX
;; Copyright (c) 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
-;; Author: Carsten Dominik <dominik@strw.LeidenUniv.nl>
-;; Version: 4.16
+;; Author: Carsten Dominik <dominik@science.uva.nl>
+;; Version: 4.17
;;
;; This file is part of GNU Emacs.
@@ -198,6 +198,7 @@ of master file."
toc-entry index-entry next-buf buf)
(catch 'exit
+ (debug)
(setq file-found (reftex-locate-file file "tex" master-dir))
(if (and (not file-found)
(setq buf (reftex-get-buffer-visiting file)))
@@ -334,7 +335,10 @@ of master file."
(save-excursion
(goto-char (point-min))
(if (re-search-forward
- "\\(\\`\\|[\n\r]\\)[ \t]*\\\\\\(no\\)?bibliography{[ \t]*\\([^}]+\\)" nil t)
+ (concat
+ "\\(\\`\\|[\n\r]\\)[^%]*\\\\\\("
+ (mapconcat 'identity reftex-bibliography-commands "\\|")
+ "\\){[ \t]*\\([^}]+\\)") nil t)
(setq files
(split-string (reftex-match-string 3)
"[ \t\n\r]*,[ \t\n\r]*")))))
diff --git a/lisp/textmodes/reftex-ref.el b/lisp/textmodes/reftex-ref.el
index 4db17b238b7..982062e12f9 100644
--- a/lisp/textmodes/reftex-ref.el
+++ b/lisp/textmodes/reftex-ref.el
@@ -1,8 +1,8 @@
;;; reftex-ref.el --- code to create labels and references with RefTeX
;; Copyright (c) 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
-;; Author: Carsten Dominik <dominik@strw.LeidenUniv.nl>
-;; Version: 4.16
+;; Author: Carsten Dominik <dominik@science.uva.nl>
+;; Version: 4.17
;; This file is part of GNU Emacs.
diff --git a/lisp/textmodes/reftex-sel.el b/lisp/textmodes/reftex-sel.el
index 05aadeeb03d..f59e2a1e03f 100644
--- a/lisp/textmodes/reftex-sel.el
+++ b/lisp/textmodes/reftex-sel.el
@@ -1,8 +1,8 @@
;;; reftex-sel.el --- the selection modes for RefTeX
;; Copyright (c) 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
-;; Author: Carsten Dominik <dominik@strw.LeidenUniv.nl>
-;; Version: 4.16
+;; Author: Carsten Dominik <dominik@science.uva.nl>
+;; Version: 4.17
;; This file is part of GNU Emacs.
diff --git a/lisp/textmodes/reftex-toc.el b/lisp/textmodes/reftex-toc.el
index 2ec1040d190..15685939815 100644
--- a/lisp/textmodes/reftex-toc.el
+++ b/lisp/textmodes/reftex-toc.el
@@ -1,8 +1,8 @@
;;; reftex-toc.el --- RefTeX's table of contents mode
;; Copyright (c) 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
-;; Author: Carsten Dominik <dominik@strw.LeidenUniv.nl>
-;; Version: 4.16
+;; Author: Carsten Dominik <dominik@science.uva.nl>
+;; Version: 4.17
;; This file is part of GNU Emacs.
@@ -72,6 +72,7 @@ Here are all local bindings.
"Stores the file name from which `reftex-toc' was called. For redo command.")
(defvar reftex-last-window-height nil)
+(defvar reftex-last-window-width nil)
(defvar reftex-toc-include-labels-indicator nil)
(defvar reftex-toc-include-index-indicator nil)
(defvar reftex-toc-max-level-indicator nil)
@@ -127,7 +128,7 @@ When called with a raw C-u prefix, rescan the document first."
(docstruct-symbol reftex-docstruct-symbol)
(xr-data (assq 'xr (symbol-value reftex-docstruct-symbol)))
(xr-alist (cons (cons "" (buffer-file-name)) (nth 1 xr-data)))
- (here-I-am (if rebuild
+ (here-I-am (if rebuild
(get 'reftex-toc :reftex-data)
(car (reftex-where-am-I))))
offset)
@@ -137,8 +138,14 @@ When called with a raw C-u prefix, rescan the document first."
(when (or (not reftex-toc-keep-other-windows)
(< (window-height) (* 2 window-min-height)))
(delete-other-windows))
- (setq reftex-last-window-height (window-height)) ; remember
- (split-window)
+
+ (setq reftex-last-window-width (window-width)
+ reftex-last-window-height (window-height)) ; remember
+ (if reftex-toc-split-windows-horizontally
+ (split-window-horizontally
+ (floor (* (frame-width) reftex-toc-split-windows-horizontally-fraction)))
+ (split-window))
+
(let ((default-major-mode 'reftex-toc-mode))
(switch-to-buffer "*toc*")))
@@ -237,9 +244,13 @@ SPC=view TAB=goto RET=goto+hide [q]uit [r]escan [l]abels [f]ollow [x]r [?]Help
(defun reftex-re-enlarge ()
;; Enlarge windiw to a remembered size
- (enlarge-window
- (max 0 (- (or reftex-last-window-height (window-height))
- (window-height)))))
+ (if reftex-toc-split-windows-horizontally
+ (enlarge-window-horizontally
+ (max 0 (- (or reftex-last-window-width (window-width))
+ (window-width))))
+ (enlarge-window
+ (max 0 (- (or reftex-last-window-height (window-height))
+ (window-height))))))
(defun reftex-toc-show-help ()
"Show a summary of special key bindings."
diff --git a/lisp/textmodes/reftex-vars.el b/lisp/textmodes/reftex-vars.el
index eac9d644d6f..05588d712e6 100644
--- a/lisp/textmodes/reftex-vars.el
+++ b/lisp/textmodes/reftex-vars.el
@@ -1,8 +1,8 @@
;;; reftex-vars.el --- configuration variables for RefTeX
;; Copyright (c) 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
-;; Author: Carsten Dominik <dominik@strw.LeidenUniv.nl>
-;; Version: 4.16
+;; Author: Carsten Dominik <dominik@science.uva.nl>
+;; Version: 4.17
;; This file is part of GNU Emacs.
@@ -136,7 +136,8 @@ distribution. Mixed-case symbols are convenience aliases.")
(?s . "\\citep[see][]{%l}")
(?a . "\\citeauthor{%l}")
(?A . "\\citeauthor*{%l}")
- (?y . "\\citeyear{%l}")))
+ (?y . "\\citeyear{%l}")
+ (?n . "\\nocite{%l}")))
(bibentry "The Bibentry package"
"\\bibentry{%l}")
(harvard "The Harvard package"
@@ -205,12 +206,57 @@ distribution. Mixed-case symbols are convenience aliases.")
:prefix "reftex-"
:group 'tex)
+
;; Table of contents configuration --------------------------------------
(defgroup reftex-table-of-contents-browser nil
"A multifile table of contents browser."
:group 'reftex)
+(defcustom reftex-include-file-commands '("include" "input")
+ "LaTeX commands which input another file.
+The file name is expected after the command, either in braces or separated
+by whitespace."
+ :group 'reftex-table-of-contents-browser
+ :type '(repeat string))
+
+(defcustom reftex-max-section-depth 12
+ "Maximum depth of section levels in document structure.
+Standard LaTeX needs default is 7, but there are packages for which this
+needs to be larger."
+ :group 'reftex-table-of-contents-browser
+ :type 'integer)
+
+;; LaTeX section commands and level numbers
+(defcustom reftex-section-levels
+ '(
+ ("part" . 0)
+ ("chapter" . 1)
+ ("section" . 2)
+ ("subsection" . 3)
+ ("subsubsection" . 4)
+ ("paragraph" . 5)
+ ("subparagraph" . 6)
+ ("subsubparagraph" . 7)
+ ("addchap" . -1) ; KOMA-Script
+ ("addsec" . -2) ; KOMA-Script
+;;; ("minisec" . -7) ; KOMA-Script
+ )
+ "Commands and levels used for defining sections in the document.
+This is an alist with each element like (COMMAND-NAME . LEVEL).
+The car of each cons cell is the name of the section macro (without
+the backslash). The cdr is a number indicating its level. A negative
+level means the same level as the positive value, but the section will
+never get a number. The cdr may also be a function which will be called
+to after the section-re matched to determine the level."
+ :group 'reftex-table-of-contents-browser
+ :set 'reftex-set-dirty
+ :type '(repeat
+ (cons (string :tag "sectioning macro" "")
+ (choice
+ (number :tag "level " 0)
+ (symbol :tag "function " my-level-func)))))
+
(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
@@ -219,6 +265,17 @@ 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-split-windows-horizontally nil
+ "*Non-nil means, create TOC window by splitting window horizontally."
+ :group 'reftex-table-of-contents-browser
+ :type 'boolean)
+
+(defcustom reftex-toc-split-windows-horizontally-fraction .5
+ "*Fraction of the horizontal width of the frame to be used for TOC window.
+Only relevant when `reftex-toc-split-windows-horizontally' is non-nil."
+ :group 'reftex-table-of-contents-browser
+ :type 'number)
+
(defcustom reftex-toc-keep-other-windows t
"*Non-nil means, split the selected window to display the *toc* buffer.
This helps to keep the window configuration, but makes the *toc* small.
@@ -479,43 +536,6 @@ list. However, builtin defaults should normally be set with the variable
(nth 0 x)))
reftex-label-alist-builtin)))))
-(defcustom reftex-max-section-depth 12
- "Maximum depth of section levels in document structure.
-Standard LaTeX needs default is 7, but there are packages for which this
-needs to be larger."
- :group 'reftex-defining-label-environments
- :type 'integer)
-
-;; LaTeX section commands and level numbers
-(defcustom reftex-section-levels
- '(
- ("part" . 0)
- ("chapter" . 1)
- ("section" . 2)
- ("subsection" . 3)
- ("subsubsection" . 4)
- ("paragraph" . 5)
- ("subparagraph" . 6)
- ("subsubparagraph" . 7)
- ("addchap" . -1) ; KOMA-Script
- ("addsec" . -2) ; KOMA-Script
-;;; ("minisec" . -7) ; KOMA-Script
- )
- "Commands and levels used for defining sections in the document.
-This is an alist with each element like (COMMAND-NAME . LEVEL).
-The car of each cons cell is the name of the section macro (without
-the backslash). The cdr is a number indicating its level. A negative
-level means the same level as the positive value, but the section will
-never get a number. The cdr may also be a function which will be called
-to after the section-re matched to determine the level."
- :group 'reftex-defining-label-environments
- :set 'reftex-set-dirty
- :type '(repeat
- (cons (string :tag "sectioning macro" "")
- (choice
- (number :tag "level " 0)
- (symbol :tag "function " my-level-func)))))
-
(defcustom reftex-section-prefixes '((0 . "part:") (1 . "cha:") (t . "sec:"))
"Prefixes for section labels.
When the label prefix given in an entry in `reftex-label-alist' contains `%S',
@@ -855,6 +875,12 @@ string to insert into the buffer."
"Support for referencing bibliographic data with BibTeX."
:group 'reftex)
+(defcustom reftex-bibliography-commands '("bibliography" "nobibliography")
+ "LaTeX commands which specify the BibTeX databases to use with the document."
+ :group 'reftex-citation-support
+ :type '(repeat string))
+
+
(defvar reftex-bibfile-ignore-list nil) ; compatibility
(defcustom reftex-bibfile-ignore-regexps nil
"*List of regular expressions to exclude files in \\bibliography{..}.
@@ -898,7 +924,7 @@ If `reftex-cite-format' is a string, it will be used as the format.
In the format, the following percent escapes will be expanded.
%l The BibTeX label of the citation.
-%a List of author names, see also `reftex-cite-punctuation.
+%a List of author names, see also `reftex-cite-punctuation'.
%2a Like %a, but abbreviate more than 2 authors like Jones et al.
%A First author name only.
%e Works like %a, but on list of editor names. (%2e and %E work a well)
@@ -1175,6 +1201,14 @@ at one of these points, no word boundary is required there."
:group 'reftex-index-support
:type 'boolean)
+(defcustom reftex-index-verify-function nil
+ "A function which is called at each match during global indexing.
+If the function returns nil, the current match is skipped."
+ :group 'reftex-index-support
+ :type '(choice
+ (const :tag "No verification" nil)
+ (function)))
+
(defcustom reftex-index-phrases-skip-indexed-matches nil
"*Non-nil means, skip matches which appear to be indexed already.
When doing global indexing from the phrases buffer, searches for some
diff --git a/lisp/textmodes/reftex.el b/lisp/textmodes/reftex.el
index 8db74a41090..2dca200c0ec 100644
--- a/lisp/textmodes/reftex.el
+++ b/lisp/textmodes/reftex.el
@@ -1,8 +1,8 @@
;;; reftex.el --- minor mode for doing \label, \ref, \cite, \index in LaTeX
;; Copyright (c) 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
-;; Author: Carsten Dominik <dominik@strw.LeidenUniv.nl>
-;; Version: 4.16
+;; Author: Carsten Dominik <dominik@science.uva.nl>
+;; Version: 4.17
;; Keywords: tex
;; This file is part of GNU Emacs.
@@ -300,7 +300,7 @@
;;; Define the formal stuff for a minor mode named RefTeX.
;;;
-(defconst reftex-version "RefTeX version 4.16"
+(defconst reftex-version "RefTeX version 4.17"
"Version string for RefTeX.")
(defvar reftex-mode nil
@@ -312,6 +312,7 @@
(defvar reftex-mode-menu nil)
(defvar reftex-syntax-table nil)
+(defvar reftex-syntax-table-for-bib nil)
(defvar reftex-auto-view-crossref-timer nil
"The timer used for auto-view-crossref.")
@@ -371,6 +372,12 @@ on the menu bar.
(setq reftex-syntax-table (copy-syntax-table (syntax-table)))
(modify-syntax-entry ?\( "." reftex-syntax-table)
(modify-syntax-entry ?\) "." reftex-syntax-table))
+ (unless reftex-syntax-table-for-bib
+ (setq reftex-syntax-table-for-bib (copy-syntax-table reftex-syntax-table))
+ (modify-syntax-entry ?\' "." reftex-syntax-table-for-bib)
+ (modify-syntax-entry ?\" "." reftex-syntax-table-for-bib)
+ (modify-syntax-entry ?\[ "." reftex-syntax-table-for-bib)
+ (modify-syntax-entry ?\] "." reftex-syntax-table-for-bib))
(run-hooks 'reftex-mode-hook))
;; Mode was turned off
(easy-menu-remove reftex-mode-menu)))
@@ -610,49 +617,49 @@ the label information is recompiled on next use."
;; The following constants are derived from `reftex-label-alist'.
;; Prompt used for label type queries directed to the user.
-(defconst reftex-type-query-prompt nil)
+(defvar reftex-type-query-prompt nil)
;; Help string for label type queries.
-(defconst reftex-type-query-help nil)
+(defvar reftex-type-query-help nil)
;; Alist relating label type to reference format.
-(defconst reftex-typekey-to-format-alist nil)
+(defvar reftex-typekey-to-format-alist nil)
;; Alist relating label type to label prefix.
-(defconst reftex-typekey-to-prefix-alist nil)
+(defvar reftex-typekey-to-prefix-alist nil)
;; Alist relating environments or macros to label type and context regexp.
-(defconst reftex-env-or-mac-alist nil)
+(defvar reftex-env-or-mac-alist nil)
;; List of special environment parser functions
-(defconst reftex-special-env-parsers nil)
+(defvar reftex-special-env-parsers nil)
;; List of macros carrying a label.
-(defconst reftex-label-mac-list nil)
+(defvar reftex-label-mac-list nil)
;; List of environments carrying a label.
-(defconst reftex-label-env-list nil)
+(defvar reftex-label-env-list nil)
;; List of all typekey letters in use.
-(defconst reftex-typekey-list nil)
+(defvar reftex-typekey-list nil)
;; Alist relating magic words to a label type.
-(defconst reftex-words-to-typekey-alist nil)
+(defvar reftex-words-to-typekey-alist nil)
;; The last list-of-labels entry used in a reference.
(defvar reftex-last-used-reference (list nil nil nil nil))
;; Alist relating index macros to other info.
-(defconst reftex-key-to-index-macro-alist nil)
+(defvar reftex-key-to-index-macro-alist nil)
;; Prompt for index macro queries
-(defconst reftex-query-index-macro-prompt nil)
+(defvar reftex-query-index-macro-prompt nil)
;; Help string for index macro queries
-(defconst reftex-query-index-macro-help nil)
+(defvar reftex-query-index-macro-help nil)
;; The message when follow-mode is suspended
-(defconst reftex-no-follow-message
+(defvar reftex-no-follow-message
"No follow-mode into unvisited file. Press SPC to visit it.")
-(defconst reftex-no-info-message
+(defvar reftex-no-info-message
"%s: info not available, use `\\[reftex-view-crossref]' to get it.")
;; Global variables used for communication between functions.
@@ -1092,9 +1099,15 @@ This enforces rescanning the buffer on next use."
reftex-section-levels))
;; Calculate the regular expressions
- (let* ((wbol "\\(\\`\\|[\n\r]\\)[ \t]*")
+ (let* (
+; (wbol "\\(\\`\\|[\n\r]\\)[ \t]*")
+ (wbol "\\(\\`\\|[\n\r]\\)[ \t]*")
(label-re "\\\\label{\\([^}]*\\)}")
- (include-re (concat wbol "\\\\\\(include\\|input\\)[{ \t]+\\([^} \t\n\r]+\\)"))
+ (include-re (concat wbol
+ "\\\\\\("
+ (mapconcat 'identity
+ reftex-include-file-commands "\\|")
+ "\\)[{ \t]+\\([^} \t\n\r]+\\)"))
(section-re
(concat wbol "\\\\\\("
(mapconcat (lambda (x) (regexp-quote (car x)))