aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCarsten Dominik2002-07-25 07:03:41 +0000
committerCarsten Dominik2002-07-25 07:03:41 +0000
commit7ac7387b8e5672d84f700e26c8a0ca432da058d1 (patch)
treeacec2cf9fde6431687da056ad25503220095798c
parent51922c041c2a91cec1764e07c1513efb4baf4610 (diff)
downloademacs-7ac7387b8e5672d84f700e26c8a0ca432da058d1.tar.gz
emacs-7ac7387b8e5672d84f700e26c8a0ca432da058d1.zip
Updated to RefTeX 4.18
-rw-r--r--lisp/textmodes/reftex-auc.el2
-rw-r--r--lisp/textmodes/reftex-cite.el48
-rw-r--r--lisp/textmodes/reftex-dcr.el2
-rw-r--r--lisp/textmodes/reftex-global.el2
-rw-r--r--lisp/textmodes/reftex-index.el6
-rw-r--r--lisp/textmodes/reftex-parse.el5
-rw-r--r--lisp/textmodes/reftex-ref.el4
-rw-r--r--lisp/textmodes/reftex-sel.el10
-rw-r--r--lisp/textmodes/reftex-toc.el6
-rw-r--r--lisp/textmodes/reftex-vars.el2
-rw-r--r--lisp/textmodes/reftex.el7
11 files changed, 72 insertions, 22 deletions
diff --git a/lisp/textmodes/reftex-auc.el b/lisp/textmodes/reftex-auc.el
index 4546651da91..c113e165d62 100644
--- a/lisp/textmodes/reftex-auc.el
+++ b/lisp/textmodes/reftex-auc.el
@@ -2,7 +2,7 @@
2;; Copyright (c) 1997, 1998, 1999, 2000 Free Software Foundation, Inc. 2;; Copyright (c) 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
3 3
4;; Author: Carsten Dominik <dominik@science.uva.nl> 4;; Author: Carsten Dominik <dominik@science.uva.nl>
5;; Version: 4.17 5;; Version: 4.18
6 6
7;; This file is part of GNU Emacs. 7;; This file is part of GNU Emacs.
8 8
diff --git a/lisp/textmodes/reftex-cite.el b/lisp/textmodes/reftex-cite.el
index ebcfd991829..39d8f26a9a6 100644
--- a/lisp/textmodes/reftex-cite.el
+++ b/lisp/textmodes/reftex-cite.el
@@ -2,7 +2,7 @@
2;; Copyright (c) 1997, 1998, 1999, 2000 Free Software Foundation, Inc. 2;; Copyright (c) 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
3 3
4;; Author: Carsten Dominik <dominik@science.uva.nl> 4;; Author: Carsten Dominik <dominik@science.uva.nl>
5;; Version: 4.17 5;; Version: 4.18
6 6
7;; This file is part of GNU Emacs. 7;; This file is part of GNU Emacs.
8 8
@@ -164,13 +164,16 @@
164 (let* (re-list first-re rest-re 164 (let* (re-list first-re rest-re
165 (buffer-list (if (listp buffers) buffers (list buffers))) 165 (buffer-list (if (listp buffers) buffers (list buffers)))
166 found-list entry buffer1 buffer alist 166 found-list entry buffer1 buffer alist
167 key-point start-point end-point) 167 key-point start-point end-point default)
168 168
169 ;; Read a regexp, completing on known citation keys. 169 ;; Read a regexp, completing on known citation keys.
170 (setq default (regexp-quote (reftex-get-bibkey-default)))
170 (setq re-list 171 (setq re-list
171 (split-string 172 (split-string
172 (completing-read 173 (completing-read
173 "RegExp [ && RegExp...]: " 174 (concat
175 "Regex { && Regex...}: "
176 "[" default "]: ")
174 (if reftex-mode 177 (if reftex-mode
175 (if (fboundp 'LaTeX-bibitem-list) 178 (if (fboundp 'LaTeX-bibitem-list)
176 (LaTeX-bibitem-list) 179 (LaTeX-bibitem-list)
@@ -180,6 +183,9 @@
180 nil nil nil 'reftex-cite-regexp-hist) 183 nil nil nil 'reftex-cite-regexp-hist)
181 "[ \t]*&&[ \t]*")) 184 "[ \t]*&&[ \t]*"))
182 185
186 (if (or (null re-list ) (equal re-list '("")))
187 (setq re-list (list default)))
188
183 (setq first-re (car re-list) ; We'll use the first re to find things, 189 (setq first-re (car re-list) ; We'll use the first re to find things,
184 rest-re (cdr re-list)) ; the others to narrow down. 190 rest-re (cdr re-list)) ; the others to narrow down.
185 (if (string-match "\\`[ \t]*\\'" (or first-re "")) 191 (if (string-match "\\`[ \t]*\\'" (or first-re ""))
@@ -315,7 +321,7 @@
315 ;; Parsing is not as good as for the BibTeX database stuff. 321 ;; Parsing is not as good as for the BibTeX database stuff.
316 ;; The environment should be located in file FILE. 322 ;; The environment should be located in file FILE.
317 323
318 (let* (start end buf entries re re-list file) 324 (let* (start end buf entries re re-list file default)
319 (unless files 325 (unless files
320 (error "Need file name to find thebibliography environment")) 326 (error "Need file name to find thebibliography environment"))
321 (while (setq file (pop files)) 327 (while (setq file (pop files))
@@ -351,10 +357,26 @@
351 (unless entries 357 (unless entries
352 (error "No bibitems found")) 358 (error "No bibitems found"))
353 359
354 (setq re-list (split-string 360 ;; Read a regexp, completing on known citation keys.
355 (read-string "RegExp [ && RegExp...]: " 361 (setq default (regexp-quote (reftex-get-bibkey-default)))
356 nil 'reftex-cite-regexp-hist) 362 (setq re-list
357 "[ \t]*&&[ \t]*")) 363 (split-string
364 (completing-read
365 (concat
366 "Regex { && Regex...}: "
367 "[" default "]: ")
368 (if reftex-mode
369 (if (fboundp 'LaTeX-bibitem-list)
370 (LaTeX-bibitem-list)
371 (cdr (assoc 'bibview-cache
372 (symbol-value reftex-docstruct-symbol))))
373 nil)
374 nil nil nil 'reftex-cite-regexp-hist)
375 "[ \t]*&&[ \t]*"))
376
377 (if (or (null re-list ) (equal re-list '("")))
378 (setq re-list (list default)))
379
358 (if (string-match "\\`[ \t]*\\'" (car re-list)) 380 (if (string-match "\\`[ \t]*\\'" (car re-list))
359 (error "Empty regular expression")) 381 (error "Empty regular expression"))
360 382
@@ -375,6 +397,16 @@
375 397
376 entries)) 398 entries))
377 399
400(defun reftex-get-bibkey-default ()
401 ;; Return the word before the cursor. If the cursor is in a
402 ;; citation macro, return the word before the macro.
403 (let* ((macro (reftex-what-macro 1)))
404 (save-excursion
405 (if (and macro (string-match "cite" (car macro)))
406 (goto-char (cdr macro)))
407 (skip-chars-backward "^a-zA-Z0-9")
408 (reftex-this-word))))
409
378;; Parse and format individual entries 410;; Parse and format individual entries
379 411
380(defun reftex-get-bib-names (field entry) 412(defun reftex-get-bib-names (field entry)
diff --git a/lisp/textmodes/reftex-dcr.el b/lisp/textmodes/reftex-dcr.el
index c0af53a9bc6..d7419ad49cc 100644
--- a/lisp/textmodes/reftex-dcr.el
+++ b/lisp/textmodes/reftex-dcr.el
@@ -2,7 +2,7 @@
2;; Copyright (c) 1997, 1998, 1999, 2000 Free Software Foundation, Inc. 2;; Copyright (c) 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
3 3
4;; Author: Carsten Dominik <dominik@science.uva.nl> 4;; Author: Carsten Dominik <dominik@science.uva.nl>
5;; Version: 4.17 5;; Version: 4.18
6;; 6;;
7 7
8;; This file is part of GNU Emacs. 8;; This file is part of GNU Emacs.
diff --git a/lisp/textmodes/reftex-global.el b/lisp/textmodes/reftex-global.el
index d19b45d76de..613a70192c2 100644
--- a/lisp/textmodes/reftex-global.el
+++ b/lisp/textmodes/reftex-global.el
@@ -2,7 +2,7 @@
2;; Copyright (c) 1997, 1998, 1999, 2000 Free Software Foundation, Inc. 2;; Copyright (c) 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
3 3
4;; Author: Carsten Dominik <dominik@science.uva.nl> 4;; Author: Carsten Dominik <dominik@science.uva.nl>
5;; Version: 4.17 5;; Version: 4.18
6 6
7;; This file is part of GNU Emacs. 7;; This file is part of GNU Emacs.
8 8
diff --git a/lisp/textmodes/reftex-index.el b/lisp/textmodes/reftex-index.el
index 5db364c371f..8990c15dc7e 100644
--- a/lisp/textmodes/reftex-index.el
+++ b/lisp/textmodes/reftex-index.el
@@ -2,7 +2,7 @@
2;; Copyright (c) 1997, 1998, 1999, 2000 Free Software Foundation, Inc. 2;; Copyright (c) 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
3 3
4;; Author: Carsten Dominik <dominik@science.uva.nl> 4;; Author: Carsten Dominik <dominik@science.uva.nl>
5;; Version: 4.17 5;; Version: 4.18
6 6
7;; This file is part of GNU Emacs. 7;; This file is part of GNU Emacs.
8 8
@@ -299,6 +299,10 @@ Here are all local bindings.
299 " R<" 'reftex-index-restriction-indicator ">" 299 " R<" 'reftex-index-restriction-indicator ">"
300 " -%-")) 300 " -%-"))
301 (setq truncate-lines t) 301 (setq truncate-lines t)
302 (when (featurep 'xemacs)
303 ;; XEmacs needs the call to make-local-hook
304 (make-local-hook 'post-command-hook)
305 (make-local-hook 'pre-command-hook))
302 (make-local-variable 'reftex-last-follow-point) 306 (make-local-variable 'reftex-last-follow-point)
303 (easy-menu-add reftex-index-menu reftex-index-map) 307 (easy-menu-add reftex-index-menu reftex-index-map)
304 (add-hook 'post-command-hook 'reftex-index-post-command-hook nil t) 308 (add-hook 'post-command-hook 'reftex-index-post-command-hook nil t)
diff --git a/lisp/textmodes/reftex-parse.el b/lisp/textmodes/reftex-parse.el
index 702682c9f8b..c6a950da6d7 100644
--- a/lisp/textmodes/reftex-parse.el
+++ b/lisp/textmodes/reftex-parse.el
@@ -2,7 +2,7 @@
2;; Copyright (c) 1997, 1998, 1999, 2000 Free Software Foundation, Inc. 2;; Copyright (c) 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
3 3
4;; Author: Carsten Dominik <dominik@science.uva.nl> 4;; Author: Carsten Dominik <dominik@science.uva.nl>
5;; Version: 4.17 5;; Version: 4.18
6;; 6;;
7 7
8;; This file is part of GNU Emacs. 8;; This file is part of GNU Emacs.
@@ -335,7 +335,8 @@ of master file."
335 (goto-char (point-min)) 335 (goto-char (point-min))
336 (if (re-search-forward 336 (if (re-search-forward
337 (concat 337 (concat
338 "\\(\\`\\|[\n\r]\\)[^%]*\\\\\\(" 338; "\\(\\`\\|[\n\r]\\)[^%]*\\\\\\("
339 "\\(^\\)[^%]*\\\\\\("
339 (mapconcat 'identity reftex-bibliography-commands "\\|") 340 (mapconcat 'identity reftex-bibliography-commands "\\|")
340 "\\){[ \t]*\\([^}]+\\)") nil t) 341 "\\){[ \t]*\\([^}]+\\)") nil t)
341 (setq files 342 (setq files
diff --git a/lisp/textmodes/reftex-ref.el b/lisp/textmodes/reftex-ref.el
index 982062e12f9..d3aaeb518e3 100644
--- a/lisp/textmodes/reftex-ref.el
+++ b/lisp/textmodes/reftex-ref.el
@@ -2,7 +2,7 @@
2;; Copyright (c) 1997, 1998, 1999, 2000 Free Software Foundation, Inc. 2;; Copyright (c) 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
3 3
4;; Author: Carsten Dominik <dominik@science.uva.nl> 4;; Author: Carsten Dominik <dominik@science.uva.nl>
5;; Version: 4.17 5;; Version: 4.18
6 6
7;; This file is part of GNU Emacs. 7;; This file is part of GNU Emacs.
8 8
@@ -646,7 +646,7 @@ When called with 2 C-u prefix args, disable magic word recognition."
646 selection-buffers) 646 selection-buffers)
647 (reftex-kill-temporary-buffers)) 647 (reftex-kill-temporary-buffers))
648 ;; Add the prefixes, put together the relevant information in the form 648 ;; Add the prefixes, put together the relevant information in the form
649 ;; (LABEL TYPEKEY SEPERATOR) and return a list of those. 649 ;; (LABEL TYPEKEY SEPARATOR) and return a list of those.
650 (mapcar (lambda (x) 650 (mapcar (lambda (x)
651 (if (listp x) 651 (if (listp x)
652 (list (concat prefix (car (car x))) 652 (list (concat prefix (car (car x)))
diff --git a/lisp/textmodes/reftex-sel.el b/lisp/textmodes/reftex-sel.el
index f59e2a1e03f..f888406c593 100644
--- a/lisp/textmodes/reftex-sel.el
+++ b/lisp/textmodes/reftex-sel.el
@@ -2,7 +2,7 @@
2;; Copyright (c) 1997, 1998, 1999, 2000 Free Software Foundation, Inc. 2;; Copyright (c) 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
3 3
4;; Author: Carsten Dominik <dominik@science.uva.nl> 4;; Author: Carsten Dominik <dominik@science.uva.nl>
5;; Version: 4.17 5;; Version: 4.18
6 6
7;; This file is part of GNU Emacs. 7;; This file is part of GNU Emacs.
8 8
@@ -49,6 +49,10 @@ During a selection process, these are the local bindings.
49 49
50 (interactive) 50 (interactive)
51 (kill-all-local-variables) 51 (kill-all-local-variables)
52 (when (featurep 'xemacs)
53 ;; XEmacs needs the call to make-local-hook
54 (make-local-hook 'pre-command-hook)
55 (make-local-hook 'post-command-hook))
52 (setq major-mode 'reftex-select-label-mode 56 (setq major-mode 'reftex-select-label-mode
53 mode-name "LSelect") 57 mode-name "LSelect")
54 (set (make-local-variable 'reftex-select-marked) nil) 58 (set (make-local-variable 'reftex-select-marked) nil)
@@ -75,6 +79,10 @@ During a selection process, these are the local bindings.
75\\{reftex-select-label-map}" 79\\{reftex-select-label-map}"
76 (interactive) 80 (interactive)
77 (kill-all-local-variables) 81 (kill-all-local-variables)
82 (when (featurep 'xemacs)
83 ;; XEmacs needs the call to make-local-hook
84 (make-local-hook 'pre-command-hook)
85 (make-local-hook 'post-command-hook))
78 (setq major-mode 'reftex-select-bib-mode 86 (setq major-mode 'reftex-select-bib-mode
79 mode-name "BSelect") 87 mode-name "BSelect")
80 (set (make-local-variable 'reftex-select-marked) nil) 88 (set (make-local-variable 'reftex-select-marked) nil)
diff --git a/lisp/textmodes/reftex-toc.el b/lisp/textmodes/reftex-toc.el
index 15685939815..c769758430c 100644
--- a/lisp/textmodes/reftex-toc.el
+++ b/lisp/textmodes/reftex-toc.el
@@ -2,7 +2,7 @@
2;; Copyright (c) 1997, 1998, 1999, 2000 Free Software Foundation, Inc. 2;; Copyright (c) 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
3 3
4;; Author: Carsten Dominik <dominik@science.uva.nl> 4;; Author: Carsten Dominik <dominik@science.uva.nl>
5;; Version: 4.17 5;; Version: 4.18
6 6
7;; This file is part of GNU Emacs. 7;; This file is part of GNU Emacs.
8 8
@@ -62,6 +62,10 @@ Here are all local bindings.
62 " T<" 'reftex-toc-max-level-indicator ">" 62 " T<" 'reftex-toc-max-level-indicator ">"
63 " -%-")) 63 " -%-"))
64 (setq truncate-lines t) 64 (setq truncate-lines t)
65 (when (featurep 'xemacs)
66 ;; XEmacs needs the call to make-local-hook
67 (make-local-hook 'post-command-hook)
68 (make-local-hook 'pre-command-hook))
65 (make-local-variable 'reftex-last-follow-point) 69 (make-local-variable 'reftex-last-follow-point)
66 (add-hook 'post-command-hook 'reftex-toc-post-command-hook nil t) 70 (add-hook 'post-command-hook 'reftex-toc-post-command-hook nil t)
67 (add-hook 'pre-command-hook 'reftex-toc-pre-command-hook nil t) 71 (add-hook 'pre-command-hook 'reftex-toc-pre-command-hook nil t)
diff --git a/lisp/textmodes/reftex-vars.el b/lisp/textmodes/reftex-vars.el
index 05588d712e6..dca2dc95517 100644
--- a/lisp/textmodes/reftex-vars.el
+++ b/lisp/textmodes/reftex-vars.el
@@ -2,7 +2,7 @@
2;; Copyright (c) 1997, 1998, 1999, 2000 Free Software Foundation, Inc. 2;; Copyright (c) 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
3 3
4;; Author: Carsten Dominik <dominik@science.uva.nl> 4;; Author: Carsten Dominik <dominik@science.uva.nl>
5;; Version: 4.17 5;; Version: 4.18
6 6
7;; This file is part of GNU Emacs. 7;; This file is part of GNU Emacs.
8 8
diff --git a/lisp/textmodes/reftex.el b/lisp/textmodes/reftex.el
index 2dca200c0ec..0ccaff9ead1 100644
--- a/lisp/textmodes/reftex.el
+++ b/lisp/textmodes/reftex.el
@@ -2,7 +2,7 @@
2;; Copyright (c) 1997, 1998, 1999, 2000 Free Software Foundation, Inc. 2;; Copyright (c) 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
3 3
4;; Author: Carsten Dominik <dominik@science.uva.nl> 4;; Author: Carsten Dominik <dominik@science.uva.nl>
5;; Version: 4.17 5;; Version: 4.18
6;; Keywords: tex 6;; Keywords: tex
7 7
8;; This file is part of GNU Emacs. 8;; This file is part of GNU Emacs.
@@ -300,7 +300,7 @@
300;;; Define the formal stuff for a minor mode named RefTeX. 300;;; Define the formal stuff for a minor mode named RefTeX.
301;;; 301;;;
302 302
303(defconst reftex-version "RefTeX version 4.17" 303(defconst reftex-version "RefTeX version 4.18"
304 "Version string for RefTeX.") 304 "Version string for RefTeX.")
305 305
306(defvar reftex-mode nil 306(defvar reftex-mode nil
@@ -1101,7 +1101,8 @@ This enforces rescanning the buffer on next use."
1101 ;; Calculate the regular expressions 1101 ;; Calculate the regular expressions
1102 (let* ( 1102 (let* (
1103; (wbol "\\(\\`\\|[\n\r]\\)[ \t]*") 1103; (wbol "\\(\\`\\|[\n\r]\\)[ \t]*")
1104 (wbol "\\(\\`\\|[\n\r]\\)[ \t]*") 1104 (wbol "\\(^\\)[ \t]*") ; Need to keep the empty group because
1105 ;;; because match number are hard coded
1105 (label-re "\\\\label{\\([^}]*\\)}") 1106 (label-re "\\\\label{\\([^}]*\\)}")
1106 (include-re (concat wbol 1107 (include-re (concat wbol
1107 "\\\\\\(" 1108 "\\\\\\("