Commits

andreasj  committed b9717e2

Added reftex 4.10 from
Carsten Dominik
(see <14453.60353.240672.857225@antares.astro.uva.nl>).

  • Participants
  • Parent commits c992cdb

Comments (0)

Files changed (20)

-This is the CHANGES file of the RefTeX distribution, version 4.9 
+This is the CHANGES file of the RefTeX distribution, version 4.10 
 
 Here are the more important changes made to RefTeX since initial release.
 Minor bug fixes are not mentioned.
 
+Version 4.10
+   - Renamed `reftex-vcr.el' to `reftex-dcr.el' because of conflict
+     with `reftex-vars.el' on DOS machines.
+   - New options `reftex-parse-file-extension' and
+     `reftex-index-phrase-file-extension'. 
+
 Version 4.09
    - RefTeX maintaines an "Index Phrases" file in which phrases can be 
      collected.  When the document is ready, RefTeX can search all
+2000-01-07  Andreas Jaeger  <aj@suse.de>
+
+	* reftex 4.10 from Carsten Dominik.
+
 1999-12-08  Jan Vroonhof <jan@xemacs.org>
-	
+
 	* reftex 4.09.
 
 1999-04-06  Andreas Jaeger  <aj@arthur.rhein-neckar.de>

File INSTALL

-This is the INSTALL file of the RefTeX distribution, version 4.9 
-
-
-1a. INSTALLATION WITH MAKE
-==========================
-
-In order to install RefTeX, unpack the distribution and edit the
-header of the Makefile.  Basically, you need to change the path
-specifications for Emacs lisp files and the info files.  Also, enter
-the name of your Emacs executable (usually either `emacs' or
-`xemacs').
-
-Then, type 
-
-   make
-   make install
-
-to compile and install the code and documentation.
-
-1b. INSTALLATION BY HAND
-========================
-
-If you don't have `make' available, you can do the following to
-install.
-a) Copy the reftex*.el lisp files to a directory on your load path.
-   Make sure that no old copy of reftex.el or reftex.elc shadows these 
-   files.
-b) Byte compile the files.  The sequence of compiling should be:
-   reftex-var.el, reftex.el, and then all the others.
-c) Copy the info files reftex, reftex-1, reftex-2, reftex-3 to the
-   info directory.
-
-
-2. Copy the following lines into your .emacs file:
-==================================================
-
-  (autoload 'reftex-mode     "reftex" "RefTeX Minor Mode" t)
-  (autoload 'turn-on-reftex  "reftex" "RefTeX Minor Mode" nil)
-  (autoload 'reftex-citation "reftex-cite" "Make citation" nil)
-  (autoload 'reftex-index-phrase-mode "reftex-index" "Phrase mode" t)
-  (add-hook 'LaTeX-mode-hook 'turn-on-reftex)   ; with AUCTeX LaTeX mode
-  (add-hook 'latex-mode-hook 'turn-on-reftex)   ; with Emacs latex mode
-
-That's all!
-
-To get started, read the documentation, in particular the summary
-"RefTeX in a Nutshell".  You can find this summary both in the file
-NUTSHELL and as part of the TeX-Info documentation.
-
-In order to produce a printed version of the documentation, use
-`make dvi' or `make ps' to produce a reftex.dvi or reftex.ps file.
-
-In order to produce the documentation in HTML format, use `make html'.
 # Boston, MA 02111-1307, USA.
 
 VERSION = 1.15
-AUTHOR_VERSION = 4.09
+AUTHOR_VERSION = 4.10
 MAINTAINER = Carsten Dominik <dominik@astro.uva.nl>
 PACKAGE = reftex
 PKG_TYPE = regular
 
 LISPFILES  = reftex-vars.el reftex.el reftex-auc.el reftex-cite.el\
              reftex-global.el reftex-parse.el reftex-ref.el\
-             reftex-sel.el reftex-toc.el reftex-vcr.el reftex-index.el
+             reftex-sel.el reftex-toc.el reftex-dcr.el reftex-index.el
 ELCS  = $(LISPFILES:.el=.elc)
 
 INFO_FILES = reftex.info*

File Makefile.Carsten

-# Makefile - for the RefTeX distribution.
-#
-# Maintainer: Carsten Dominik <dominik@strw.leidenuniv.nl
-# Version: 4.8 
-#
-# To install RefTeX, edit the Makefile, type `make', then `make install'.
-# To create the postscript documentation file reftex.ps, type `make ps'.
-# To create the HTML documentation file reftex.html, type `make html'.
-
-##----------------------------------------------------------------------
-##  YOU MUST EDIT THE FOLLOWING LINES 
-##----------------------------------------------------------------------
-
-# Where local software is found
-prefix=/usr/local
-
-# Where info files go.
-infodir = $(prefix)/info
-
-# Where local lisp files go.
-lispdir = $(prefix)/share/emacs/site-lisp
-
-# Name of your emacs binary
-EMACS=xemacs
-
-##----------------------------------------------------------------------
-## YOU MAY NEED TO EDIT THESE
-##----------------------------------------------------------------------
-
-# Using emacs in batch mode.
-BATCH=$(EMACS) -batch -q -l lpath.el
-
-# Specify the byte-compiler for compiling RefTeX files
-ELC= $(BATCH) -f batch-byte-compile
-
-# How to make a dvi file from a texinfo file
-TEXI2DVI = texi2dvi
-
-# How to create directories
-MKDIR = mkdir -p
-
-# How to make a postscript file from a dvi file
-DVIPS = dvips
-
-# How to create the info files from the texinfo file
-MAKEINFO = makeinfo
-
-# How to create the HTML file
-TEXI2HTML = texi2html -monolithic -number
-
-# How to move the byte compiled files to their destination.  
-MV = mv
-
-# How to copy the lisp files to their distination.
-CP = cp -p
-
-##----------------------------------------------------------------------
-##  BELOW THIS LINE ON YOUR OWN RISK!
-##----------------------------------------------------------------------
-
-# The following variables need to be defined by the maintainer
-METAFILE   = REFTEX.el
-LISPFILES  = reftex-vars.el reftex.el reftex-auc.el reftex-cite.el\
-             reftex-global.el reftex-parse.el reftex-ref.el\
-             reftex-sel.el reftex-toc.el reftex-vcr.el reftex-index.el
-ELCFILES   = $(LISPFILES:.el=.elc)
-TEXIFILES  = reftex.texinfo
-INFOFILES  = reftex reftex-1 reftex-2 reftex-3 reftex-4 reftex-5
-FTPDIR     = /ftphome/pub/dominik/reftex/
-HTMLDIR    = /home/strw/dominik/public_html
-
-# An alternative installation point
-MY_INFODIR = /home/strw/dominik/lib/emacs/info
-MY_LISPDIR = /home/strw/dominik/lib/emacs/lisp
-
-.SUFFIXES: .el .elc .texinfo
-SHELL = /bin/sh
-
-DISTFILES=  README INSTALL NUTSHELL CHANGES COPYING Makefile\
-	    $(LISPFILES) reftex.texinfo $(INFOFILES) lpath.el
-
-all:	lisp
-
-split:
-	perl split_reftex $(METAFILE)
-
-install: install-lisp install-info
-
-lisp:	$(LISPFILES)
-	$(ELC) $(LISPFILES)
-
-compile: $(LISPFILES)
-	$(ELC) $(LISPFILES)
-
-info:	$(INFOFILES)
-
-dvi:    reftex.dvi
-
-view:   
-	xdvi reftex.dvi&
-
-ps:	reftex.ps
-
-html:	reftex.html
-
-nutshell: reftex.nutshell
-
-install-lisp: $(LISPFILES) $(ELCFILES)
-	if [ ! -d $(lispdir) ]; then $(MKDIR) $(lispdir); else true; fi ;
-	$(CP) $(LISPFILES) $(lispdir)
-	$(CP) $(ELCFILES)  $(lispdir)
-
-install-info: $(INFOFILES)
-	if [ ! -d $(infodir) ]; then $(MKDIR) $(infodir); else true; fi ;
-	$(CP) $(INFOFILES) $(infodir)
-
-reftex.elc: reftex.el
-	$(ELC) reftex.el
-
-reftex: reftex.texinfo
-	$(MAKEINFO) reftex.texinfo
-
-reftex-1: reftex.texinfo
-	$(MAKEINFO) reftex.texinfo
-
-reftex-2: reftex.texinfo
-	$(MAKEINFO) reftex.texinfo
-
-reftex-3: reftex.texinfo
-	$(MAKEINFO) reftex.texinfo
-
-reftex-4: reftex.texinfo
-	$(MAKEINFO) reftex.texinfo
-
-reftex-5: reftex.texinfo
-	$(MAKEINFO) reftex.texinfo
-
-reftex.dvi: reftex.texinfo
-	$(TEXI2DVI) reftex.texinfo
-
-reftex.ps: reftex.dvi
-	$(DVIPS) -o reftex.ps reftex.dvi
-
-reftex.html: reftex.texinfo
-	$(TEXI2HTML) reftex.texinfo
-
-reftex.nutshell: reftex.html
-	perl nutshell.pl reftex.html > reftex.nutshell
-
-NUTSHELL: reftex.texinfo
-	makeinfo --no-headers reftex.texinfo|perl NUTSHELL.pl>NUTSHELL
-
-wcompile:
-	xemacs -batch -q -l lpath-warn.el -f batch-byte-compile $(LISPFILES)
-
-ecompile:
-	emacs -batch -q -l lpath-warn.el -f batch-byte-compile $(LISPFILES)
-
-ccompile:
-	xemacs -batch -q -l lpath-compatible.el -f batch-byte-compile $(LISPFILES)
-
-myinstall: $(LISPFILES) $(ELCFILES) $(INFOFILES)
-	if [ ! -d $(MY_LISPDIR) ]; then $(MKDIR) $(MY_LISPDIR); else true; fi ;
-	$(CP) $(LISPFILES) $(MY_LISPDIR)
-	$(CP) $(ELCFILES)  $(MY_LISPDIR)
-	if [ ! -d $(MY_INFODIR) ]; then $(MKDIR) $(MY_INFODIR); else true; fi ;
-	$(CP) $(INFOFILES) $(MY_INFODIR)
-
-distfile:
-	make split
-	make info
-	make NUTSHELL
-	@if [ "X$(TAG)" = "X" ]; then echo "*** No tag ***"; exit 1; fi
-	rm -rf reftex-$(TAG)
-	$(MKDIR) reftex-$(TAG)
-	cp $(DISTFILES) reftex-$(TAG)/
-	perl -pi -e 's/\sVERSIONTAG\b/ $(TAG)/' reftex-$(TAG)/*
-	gtar zcvf reftex-$(TAG).tar.gz reftex-$(TAG)
-	rm -rf reftex-$(TAG)
-
-dist:
-	make distfile TAG=$(TAG)
-	cp reftex-$(TAG).tar.gz $(FTPDIR)
-	rm -f $(FTPDIR)/reftex.tar.gz
-	rm -f $(FTPDIR)/reftex-alpha.tar.gz
-	(cd $(FTPDIR); ln -s reftex-$(TAG).tar.gz reftex.tar.gz)
-	(cd $(FTPDIR); ln -s reftex-$(TAG).tar.gz reftex-alpha.tar.gz)
-	make ps
-	make html
-	gtar zcvf reftex.info.tar.gz $(INFOFILES)
-	cp reftex.html $(HTMLDIR)/Tools/reftex/
-	gzip -c reftex.ps > $(FTPDIR)/reftex.ps.gz
-	gzip -c reftex.texinfo > $(FTPDIR)/reftex.texinfo.gz
-	cp reftex.info.tar.gz $(FTPDIR)
-	cp CHANGES $(HTMLDIR)/Tools/reftex/
-	 #make nutshell
-	 #cp reftex.nutshell $(HTMLDIR)/Tools/reftex/reftex.nutshell
-
-alphadist:
-	make distfile TAG=$(TAG)
-	cp reftex-$(TAG).tar.gz $(FTPDIR)
-	cp CHANGES $(HTMLDIR)/Tools/reftex/
-	rm -f $(FTPDIR)/reftex-alpha.tar.gz
-	(cd $(FTPDIR); ln -s reftex-$(TAG).tar.gz reftex-alpha.tar.gz)
-
-distfile_emacs:
-	rm -rf distributions/Emacs/reftex
-	$(MKDIR) distributions/Emacs/reftex
-	cp $(LISPFILES) reftex.texinfo etcNEWS distributions/Emacs/reftex
-submit_emacs:
-	make distfile_emacs
-	cp -r distributions/Emacs/reftex distributions/Emacs/reftex-submitted
-	cvs tag -F submit_emacs
-patch_emacs:
-	make distfile_emacs
-	cp -r distributions/Emacs/reftex distributions/Emacs/reftex-submitted
-	(cd distributions/Emacs; diff -c -r reftex.orig reftex>patch)
-	cvs tag -F submit_emacs
-accept_emacs:
-	cp -r distributions/Emacs/reftex-submitted distributions/Emacs/reftex.orig
-	cvs rtag -r submit_emacs -F accept_emacs
-
-distfile_xemacs:
-	rm -rf distributions/XEmacs/reftex
-	$(MKDIR) distributions/XEmacs/reftex
-	cp $(LISPFILES) reftex.texinfo etcNEWS distributions/XEmacs/reftex
-submit_xemacs:
-	make distfile_xemacs
-	cp -r distributions/XEmacs/reftex distributions/XEmacs/reftex-submitted
-	cvs tag -F submit_xemacs
-patch_xemacs:
-	make distfile_xemacs
-	cp -r distributions/XEmacs/reftex distributions/XEmacs/reftex-submitted
-	(cd distributions/XEmacs; diff -c -r reftex.orig reftex>patch)
-	cvs tag -F submit_xemacs
-accept_xemacs:
-	cp -r distributions/XEmacs/reftex-submitted distributions/XEmacs/reftex.orig
-	cvs rtag -r submit_xemacs -F accept_xemacs
-
-
-package_xemacs:
-	rm -rf distributions/XEmacs/package
-	$(MKDIR) distributions/XEmacs/package
-	$(MKDIR) distributions/XEmacs/package/lisp/reftex
-	$(MKDIR) distributions/XEmacs/package/info/reftex
-	$(MKDIR) distributions/XEmacs/package/pgkinfo
-	$(MKDIR) distributions/XEmacs/package/man
-	cp $(LISPFILES) $(ELCFILES) distributions/XEmacs/package/lisp/reftex
-	cp $(INFOFILES) distributions/XEmacs/package/info/reftex
-	cp $(TEXIFILES) distributions/XEmacs/package/man
-	(cd distributions/XEmacs/package/;ls -1 > pgkinfo/MANIFEST.reftex)
-
-clean:
-	rm -f $(ELCFILES)
-	rm -f *~ 
-	rm -f *.aux *.cp *.cps *.dvi *.fn *.fns *.ky *.kys *.pg *.pgs
-	rm -f *.toc *.tp *.tps *.vr *.vrs *.log *.html *.ps
-
-veryclean:
-	rm -f $(LISPFILES) $(ELCFILES) REFTEX.elc
-	rm -f *~ reftex reftex-[1-9]
-	rm -f *.aux *.cp *.cps *.dvi *.fn *.fns *.ky *.kys *.pg *.pgs
-	rm -f *.toc *.tp *.tps *.vr *.vrs *.log *.html *.ps
-	rm -f reftex-emacs.el reftex.el.orig reftex.texinfo.orig reftex.tar.gz
-	rm -f reftex.info.tar.gz reftex.nutshell *-patch-*
-	rm -f *.rel
-
-
-linkelc:
-	(cd ../lisp;ln -s ../reftex/reftex*.elc .)
-
-unlinkelc:
-	rm ../lisp/reftex*.elc
-
-.el.elc:
-	$(ELC) $<
-
-This is the README file of the RefTeX distribution, version 4.9 
+This is the README file of the RefTeX distribution, version 4.10 
 
 Your kit should contain the following files:
 
 reftex-sel.el      The selection modes.
 reftex-toc.el      The Table of Contents mode.
 reftex-vars.el     All user variables (defcustom forms).
-reftex-vcr.el      Code to view cross references and citations.
+reftex-dcr.el      Code to display cross references and citations.
 
 reftex             \
 reftex-1            \
 reftex-2             >  The info files (online documentation)
 reftex-3            /
 reftex-4           /
+reftex-5          /
 
 RefTeX is part of Emacs (version 20.2 and later) and is distributed as
 one of the XEmacs packages.  If you use an earlier version of Emacs,

File lpath.el

-;;; This file is only used for installing RefTeX
-;;; It is not a part of RefTeX itself.
-
-;; Make sure we get the right files.
-(setq load-path (cons "." load-path)
-      byte-compile-warnings nil)
-

File reftex-auc.el

 ;;; reftex-auc.el - RefTeX's interface to AUC TeX
-;;; Version: 4.9
-;;;
-;;; See main file reftex.el for licensing information
+;; Copyright (c) 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
+
+;; Author:     Carsten Dominik <dominik@strw.LeidenUniv.nl>
+;; Version: 4.10
+;;
+
+;; This file is part of GNU Emacs.
+
+;; GNU Emacs is free software; you can redistribute it and/or modify
+;; it under the terms of the GNU General Public License as published by
+;; the Free Software Foundation; either version 2, or (at your option)
+;; any later version.
+
+;; GNU Emacs is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+;; GNU General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with GNU Emacs; see the file COPYING.  If not, write to the
+;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+;; Boston, MA 02111-1307, USA.
 
 (eval-when-compile (require 'cl))
 (provide 'reftex-auc)

File reftex-cite.el

 ;;; reftex-cite.el - Creating citations with RefTeX
-;;; Version: 4.9
-;;;
-;;; See main file reftex.el for licensing information
+;; Copyright (c) 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
+
+;; Author:     Carsten Dominik <dominik@strw.LeidenUniv.nl>
+;; Version: 4.10
+;;
+
+;; This file is part of GNU Emacs.
+
+;; GNU Emacs is free software; you can redistribute it and/or modify
+;; it under the terms of the GNU General Public License as published by
+;; the Free Software Foundation; either version 2, or (at your option)
+;; any later version.
+
+;; GNU Emacs is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+;; GNU General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with GNU Emacs; see the file COPYING.  If not, write to the
+;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+;; Boston, MA 02111-1307, USA.
 
 (eval-when-compile (require 'cl))
 (provide 'reftex-cite)

File reftex-dcr.el

+;;; 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.10
+;;
+
+;; This file is part of GNU Emacs.
+
+;; GNU Emacs is free software; you can redistribute it and/or modify
+;; it under the terms of the GNU General Public License as published by
+;; the Free Software Foundation; either version 2, or (at your option)
+;; any later version.
+
+;; GNU Emacs is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+;; GNU General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with GNU Emacs; see the file COPYING.  If not, write to the
+;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+;; Boston, MA 02111-1307, USA.
+
+(eval-when-compile (require 'cl))
+(provide 'reftex-dcr)
+(provide 'reftex-vcr)
+(require 'reftex)
+;;;
+
+(defun reftex-view-crossref (&optional arg auto-how)
+  "View cross reference of macro at point.  Point must be on the KEY
+argument.  When at at `\ref' macro, show corresponding `\label'
+definition, also in external documents (`xr').  When on a label, show
+a locations where KEY is referenced.  Subsequent calls find additional
+locations.  When on a `\cite', show the associated `\bibitem' macro or
+the BibTeX database entry.  When on a `\bibitem', show a `\cite' macro
+which uses this KEY. When on an `\index', show other locations marked
+by the same index entry.
+To define additional cross referencing items, use the option
+`reftex-view-crossref-extra'.  See also `reftex-view-crossref-from-bibtex'.
+With one or two C-u prefixes, enforce rescanning of the document.
+With argument 2, select the window showing the cross reference.
+AUTO-HOW is only for the automatic crossref display and is handed through
+to the functions `reftex-view-cr-cite' and `reftex-view-cr-ref'."
+
+  (interactive "P")
+  ;; See where we are.
+  (let* ((macro (car (reftex-what-macro-safe 1)))
+         (key (reftex-this-word "^{}%\n\r,"))
+	 dw)
+
+    (if (or (null macro) (reftex-in-comment))
+	(error "Not on a crossref macro argument"))
+
+    (setq reftex-call-back-to-this-buffer (current-buffer))
+
+    (cond
+     ((string-match "\\`\\\\cite\\|cite\\*?\\'" macro)
+      ;; A citation macro: search for bibitems or BibTeX entries
+      (setq dw (reftex-view-cr-cite arg key auto-how)))
+     ((string-match "\\`\\\\ref\\|ref\\(range\\)?\\*?\\'" macro)
+      ;; A reference macro: search for labels
+      (setq dw (reftex-view-cr-ref arg key auto-how)))
+     (auto-how nil)  ;; No further action for automatic display (speed)
+     ((or (equal macro "\\label")
+	  (member macro reftex-macros-with-labels))
+      ;; A label macro: search for reference macros
+      (reftex-access-scan-info arg)
+      (setq dw (reftex-view-regexp-match
+		(format reftex-find-reference-format (regexp-quote key))
+		4 nil nil)))
+     ((equal macro "\\bibitem")
+      ;; A bibitem macro: search for citations
+      (reftex-access-scan-info arg)
+      (setq dw (reftex-view-regexp-match
+		(format reftex-find-citation-regexp-format (regexp-quote key))
+		3 nil nil)))
+     ((member macro reftex-macros-with-index)
+      (reftex-access-scan-info arg)
+      (setq dw (reftex-view-regexp-match
+		(format reftex-find-index-entry-regexp-format
+			(regexp-quote key))
+		3 nil nil)))
+     (t 
+      (reftex-access-scan-info arg)
+      (catch 'exit
+	(let ((list reftex-view-crossref-extra)
+	      entry mre action group)
+	  (while (setq entry (pop list))
+	    (setq mre (car entry)
+		  action (nth 1 entry)
+		  group (nth 2 entry))
+	    (when (string-match mre macro)
+	      (setq dw (reftex-view-regexp-match 
+			(format action key) group nil nil))
+	      (throw 'exit t))))
+	(error "Not on a crossref macro argument"))))
+    (if (and (eq arg 2) (windowp dw)) (select-window dw))))
+     
+(defun reftex-view-cr-cite (arg key how)
+  ;; View crossreference of a ref cite.  HOW can have the values 
+  ;; nil:         Show in another window.
+  ;; echo:        Show one-line info in echo area.
+  ;; tmp-window:  Show in small window and arrange for window to disappear.
+
+  ;; Ensure access to scanning info
+  (reftex-access-scan-info (or arg current-prefix-arg))
+
+  (if (eq how 'tmp-window)
+      ;; Remember the window configuration
+      (put 'reftex-auto-view-crossref 'last-window-conf 
+	   (current-window-configuration)))
+
+  (let (files size item (pos (point)) (win (selected-window)) pop-win)
+    ;; Find the citation mode and the file list
+    (cond
+     ((assq 'bib (symbol-value reftex-docstruct-symbol))
+      (setq item nil
+	    files (reftex-get-bibfile-list)))
+     ((assq 'thebib (symbol-value reftex-docstruct-symbol))
+      (setq item t
+	    files (reftex-uniquify
+		   (mapcar 'cdr
+			   (reftex-all-assq 
+			    'thebib (symbol-value reftex-docstruct-symbol))))))
+     (reftex-default-bibliography
+      (setq item nil
+	    files (reftex-default-bibliography)))
+     (how)  ;; don't throw for special display
+     (t (error "Cannot display crossref")))
+
+    (if (eq how 'echo)
+	;; Display in Echo area
+	(reftex-echo-cite key files item)
+      ;; Display in a window
+      (if (not (eq how 'tmp-window))
+	  ;; Normal display
+	  (reftex-pop-to-bibtex-entry key files nil t item)
+	;; A temporary window
+	(condition-case nil
+	    (reftex-pop-to-bibtex-entry key files nil t item)
+	  (error (goto-char pos)
+		 (message "cite: no such citation key %s" key)
+		 (error "")))
+	;; Resize the window
+	(setq size (max 1 (count-lines (point)
+				       (reftex-end-of-bib-entry item))))
+	(let ((window-min-height 2))
+	  (shrink-window (1- (- (window-height) size)))
+	  (recenter 0))
+	;; Arrange restoration
+	(add-hook 'pre-command-hook 'reftex-restore-window-conf))
+
+	;; Normal display in other window
+      (add-hook 'pre-command-hook 'reftex-highlight-shall-die)
+      (setq pop-win (selected-window))
+      (select-window win)
+      (goto-char pos)
+      (when (equal arg 2)
+	(select-window pop-win)))))
+
+(defun reftex-view-cr-ref (arg label how)
+  ;; View crossreference of a ref macro.  HOW can have the values 
+  ;; nil:         Show in another window.
+  ;; echo:        Show one-line info in echo area.
+  ;; tmp-window:  Show in small window and arrange for window to disappear.
+
+  ;; Ensure access to scanning info
+  (reftex-access-scan-info (or arg current-prefix-arg))
+  
+  (if (eq how 'tmp-window)
+      ;; Remember the window configuration
+      (put 'reftex-auto-view-crossref 'last-window-conf 
+	   (current-window-configuration)))
+
+  (let* ((xr-data (assoc 'xr (symbol-value reftex-docstruct-symbol)))
+	 (xr-re (nth 2 xr-data))
+	 (entry (assoc label (symbol-value reftex-docstruct-symbol)))
+	 (win (selected-window)) pop-win (pos (point)))
+
+    (if (and (not entry) (stringp label) xr-re (string-match xr-re label))
+	;; Label is defined in external document
+	(save-excursion
+	  (save-match-data
+	    (set-buffer 
+	     (or (reftex-get-file-buffer-force
+		  (cdr (assoc (match-string 1 label) (nth 1
+							  xr-data))))
+		 (error "Problem with external label %s" label))))
+	  (setq label (substring label (match-end 1)))
+	  (reftex-access-scan-info)
+	  (setq entry 
+		(assoc label (symbol-value reftex-docstruct-symbol)))))
+    (if (eq how 'echo)
+	;; Display in echo area
+	(reftex-echo-ref label entry (symbol-value reftex-docstruct-symbol))
+      (let ((window-conf (current-window-configuration)))
+	(condition-case nil
+	    (reftex-show-label-location entry t nil t t)
+	  (error (set-window-configuration window-conf)
+		 (message "ref: Label %s not found" label)
+		 (error "ref: Label %s not found" label)))) ;; 2nd is line OK
+      (add-hook 'pre-command-hook 'reftex-highlight-shall-die)
+
+      (when (eq how 'tmp-window)
+	;; Resize window and arrange restauration
+	(shrink-window (1- (- (window-height) 9)))
+	(recenter '(4))
+	(add-hook 'pre-command-hook 'reftex-restore-window-conf))
+      (setq pop-win (selected-window))
+      (select-window win)
+      (goto-char pos)
+      (when (equal arg 2)
+	(select-window pop-win)))))
+
+(defun reftex-mouse-view-crossref (ev)
+  "View cross reference of \\ref or \\cite macro where you click.
+If the macro at point is a \\ref, show the corresponding label definition.
+If it is a \\cite, show the BibTeX database entry.
+If there is no such macro at point, search forward to find one.
+With argument, actually select the window showing the cross reference."
+  (interactive "e")
+  (mouse-set-point ev)
+  (reftex-view-crossref current-prefix-arg))
+
+(defun reftex-view-crossref-when-idle ()
+  ;; Display info about crossref at point in echo area or a window.
+  ;; This function was desigend to work with an idle timer.
+  ;; We try to get out of here as quickly as possible if the call is useless.
+  (and reftex-mode
+       ;; Make sure message area is free if we need it.
+       (or (eq reftex-auto-view-crossref 'window) (not (current-message)))
+       ;; Make sure we are not already displaying this one
+       (not (memq last-command '(reftex-view-crossref
+				 reftex-mouse-view-crossref)))
+       ;; Quick precheck if this might be a relevant spot
+       ;; FIXME: Can fail with backslash in comment
+       (save-excursion  
+	 (search-backward "\\" nil t)
+	 (looking-at "\\\\[a-zA-Z]*\\(cite\\|ref\\)"))
+
+       (condition-case nil
+	   (let ((current-prefix-arg nil))
+	     (cond
+	      ((eq reftex-auto-view-crossref t)
+	       (reftex-view-crossref -1 'echo))
+	      ((eq reftex-auto-view-crossref 'window)
+	       (reftex-view-crossref -1 'tmp-window))
+	      (t nil)))
+	 (error nil))))
+
+(defun reftex-restore-window-conf ()
+  (set-window-configuration (get 'reftex-auto-view-crossref 'last-window-conf))
+  (put 'reftex-auto-view-crossref 'last-window-conf nil)
+  (remove-hook 'pre-command-hook 'reftex-restore-window-conf))
+		  
+(defun reftex-echo-ref (label entry docstruct)
+  ;; Display crossref info in echo area.
+  (cond
+   ((null docstruct)
+    (message (substitute-command-keys (format reftex-no-info-message "ref"))))
+   ((null entry)
+    (message "ref: unknown label: %s" label))
+   (t
+    (when (stringp (nth 2 entry))
+      (message "ref(%s): %s" (nth 1 entry) (nth 2 entry)))
+    (let ((buf (get-buffer " *Echo Area*")))
+      (when buf
+	(save-excursion
+	  (set-buffer buf)
+	  (run-hooks 'reftex-display-copied-context-hook)))))))
+
+(defun reftex-echo-cite (key files item)
+  ;; Display citation info in echo area.
+  (let* ((cache (assq 'bibview-cache (symbol-value reftex-docstruct-symbol)))
+	 (cache-entry (assoc key (cdr cache)))
+	 entry string buf (all-files files))
+
+    (if (and reftex-cache-cite-echo cache-entry)
+	;; We can just use the cache
+	(setq string (cdr cache-entry))
+
+      ;; Need to look in the database
+      (unless reftex-revisit-to-echo
+	(setq files (reftex-visited-files files)))
+
+      (setq entry 
+	    (condition-case nil
+		(save-excursion
+		  (reftex-pop-to-bibtex-entry key files nil nil item t))
+	      (error
+	       (if (and files (= (length all-files) (length files)))
+		   (message "cite: no such database entry: %s" key)
+		 (message (substitute-command-keys 
+			   (format reftex-no-info-message "cite"))))
+	       nil)))
+      (when entry
+	(if item
+	    (setq string (reftex-nicify-text entry))
+	  (setq string (reftex-make-cite-echo-string
+			(reftex-parse-bibtex-entry entry)
+			reftex-docstruct-symbol)))))
+    (unless (or (null string) (equal string ""))
+      (message "cite: %s" string))
+    (when (setq buf (get-buffer " *Echo Area*"))
+      (save-excursion
+	(set-buffer buf)
+	(run-hooks 'reftex-display-copied-context-hook)))))
+
+(defvar reftex-use-itimer-in-xemacs nil
+  "*Non-nil means use the idle timers in XEmacs for crossref display.
+Currently, idle timer restart is broken and we use the post-command-hook.")
+
+(defun reftex-toggle-auto-view-crossref ()
+  "Toggle the automatic display of crossref information in the echo area.
+When active, leaving point idle in the argument of a \\ref or \\cite macro
+will display info in the echo area."
+  (interactive)
+  (if reftex-auto-view-crossref-timer
+      (progn
+	(if (featurep 'xemacs)
+	    (if reftex-use-itimer-in-xemacs
+		(delete-itimer reftex-auto-view-crossref-timer)
+	      (remove-hook 'post-command-hook 'reftex-start-itimer-once))
+	  (cancel-timer reftex-auto-view-crossref-timer))
+	(setq reftex-auto-view-crossref-timer nil)
+	(message "Automatic display of crossref information was turned off"))
+    (setq reftex-auto-view-crossref-timer
+	  (if (featurep 'xemacs)
+	      (if reftex-use-itimer-in-xemacs
+		  (start-itimer "RefTeX Idle Timer"
+				'reftex-view-crossref-when-idle 
+				reftex-idle-time reftex-idle-time t)
+		(add-hook 'post-command-hook 'reftex-start-itimer-once)
+		t)
+	    (run-with-idle-timer
+	     reftex-idle-time t 'reftex-view-crossref-when-idle)))
+    (unless reftex-auto-view-crossref
+      (setq reftex-auto-view-crossref t))
+    (message "Automatic display of crossref information was turned on")))
+
+(defun reftex-start-itimer-once ()
+   (and reftex-mode
+	(not (itimer-live-p reftex-auto-view-crossref-timer))
+	(setq reftex-auto-view-crossref-timer
+	      (start-itimer "RefTeX Idle Timer"
+			    'reftex-view-crossref-when-idle 
+			    reftex-idle-time nil t))))
+
+(defun reftex-view-crossref-from-bibtex (&optional arg)
+  "View location in a LaTeX document which cites the BibTeX entry at point.
+Since BibTeX files can be used by many LaTeX documents, this function
+prompts upon first use for a buffer in RefTeX mode.  To reset this
+link to a document, call the function with with a prefix arg.
+Calling this function several times find successive citation locations."
+  (interactive "P")
+  (when arg 
+    ;; Break connection to reference buffer
+    (remprop 'reftex-bibtex-view-cite-locations :ref-buffer))
+  (let ((ref-buffer (get 'reftex-bibtex-view-cite-locations :ref-buffer)))
+    ;; Establish connection to reference buffer
+    (unless ref-buffer
+      (setq ref-buffer
+	    (save-excursion
+	      (completing-read 
+	       "Reference buffer: "
+	       (delq nil
+		     (mapcar 
+		      (lambda (b)
+			(set-buffer b)
+			(if reftex-mode (list (buffer-name b)) nil))
+		      (buffer-list)))
+	       nil t)))
+      (put 'reftex-bibtex-view-cite-locations :ref-buffer ref-buffer))
+    ;; Search for citations
+    (bibtex-beginning-of-entry)
+    (if (looking-at
+	 "@[a-zA-Z]+[ \t\n\r]*[{(][ \t\n\r]*\\([^, \t\r\n}]+\\)")
+	(progn
+	  (goto-char (match-beginning 1))
+	  (reftex-view-regexp-match
+	   (format reftex-find-citation-regexp-format
+		   (regexp-quote (match-string 1)))
+	   3 arg ref-buffer))
+      (error "Cannot find citation key in BibTeX entry"))))
+
+(defun reftex-view-regexp-match (re &optional highlight-group new ref-buffer)
+  ;; Search for RE in current document or in the document of REF-BUFFER.
+  ;; Continue the search, if the same re was searched last.
+  ;; Highlight the group HIGHLIGHT-GROUP of the match.
+  ;; When NEW is non-nil, start a new search regardless.
+  ;; Match point is displayed in another window.
+  ;; Upon success, returns the window which displays the match.
+
+  ;;; Decide if new search or continued search
+  (let* ((oldprop (get 'reftex-view-regexp-match :props))
+	 (newprop (list (current-buffer) re))
+	 (cont (and (not new) (equal oldprop newprop)))
+	 (cnt (if cont (get 'reftex-view-regexp-match :cnt) 0))
+	 (current-window (selected-window))
+	 (window-conf (current-window-configuration))
+	 match pop-window)
+    (switch-to-buffer-other-window (or ref-buffer (current-buffer)))
+    ;; Search
+    (condition-case nil
+	(if cont
+	    (setq match (reftex-global-search-continue))
+	  (reftex-access-scan-info)
+	  (setq match (reftex-global-search re (reftex-all-document-files))))
+      (error nil))
+    ;; Evaluate the match.
+    (if match
+	(progn
+	  (put 'reftex-view-regexp-match :props newprop)
+	  (put 'reftex-view-regexp-match :cnt (incf cnt))
+	  (reftex-highlight 0 (match-beginning highlight-group)
+			    (match-end highlight-group))
+	  (add-hook 'pre-command-hook 'reftex-highlight-shall-die)
+	  (setq pop-window (selected-window)))
+      (remprop 'reftex-view-regexp-match :props)
+      (or cont (set-window-configuration window-conf)))
+    (select-window current-window)
+    (if match
+	(progn
+	  (message "Match Nr. %s" cnt)
+	  pop-window)
+      (if cont
+	  (error "No further matches (total number of matches: %d)" cnt)
+	(error "No matches")))))
+
+(defvar reftex-global-search-marker (make-marker))
+(defun reftex-global-search (regexp file-list)
+  ;; Start a search for REGEXP in all files of FILE-LIST
+  (put 'reftex-global-search :file-list file-list)
+  (put 'reftex-global-search :regexp regexp)
+  (move-marker reftex-global-search-marker nil)
+  (reftex-global-search-continue))
+
+(defun reftex-global-search-continue ()
+  ;; Continue a global search started with `reftex-global-search'
+  (unless (get 'reftex-global-search :file-list)
+    (error "No global search to continue"))
+  (let* ((file-list (get 'reftex-global-search :file-list))
+	 (regexp (get 'reftex-global-search :regexp))
+	 (buf (or (marker-buffer reftex-global-search-marker)
+		  (reftex-get-file-buffer-force (car file-list))))
+	 (pos (or (marker-position reftex-global-search-marker) 1))
+	 file)
+    ;; Take up starting position
+    (unless buf (error "No such buffer %s" buf))
+    (switch-to-buffer buf)
+    (widen)
+    (goto-char pos)
+    ;; Search and switch file if necessary
+    (if (catch 'exit
+	  (while t
+	    (when (re-search-forward regexp nil t)
+	      (move-marker reftex-global-search-marker (point))
+	      (throw 'exit t))
+	    ;; No match - goto next file
+	    (pop file-list)
+	    (or file-list (throw 'exit nil))
+	    (setq file (car file-list)
+		  buf (reftex-get-file-buffer-force file))
+	    (unless buf (error "Cannot access file %s" file))
+	    (put 'reftex-global-search :file-list file-list)
+	    (switch-to-buffer buf)
+	    (widen)
+	    (goto-char 1)))
+	t
+      (move-marker reftex-global-search-marker nil)
+      (error "All files processed"))))
+
+;;; reftex-dcr.el ends here

File reftex-global.el

 ;;; reftex-global.el - Operations on entire documents with RefTeX
-;;; Version: 4.9
-;;;
-;;; See main file reftex.el for licensing information
+;; Copyright (c) 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
+
+;; Author:     Carsten Dominik <dominik@strw.LeidenUniv.nl>
+;; Version: 4.10
+;;
+
+;; This file is part of GNU Emacs.
+
+;; GNU Emacs is free software; you can redistribute it and/or modify
+;; it under the terms of the GNU General Public License as published by
+;; the Free Software Foundation; either version 2, or (at your option)
+;; any later version.
+
+;; GNU Emacs is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+;; GNU General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with GNU Emacs; see the file COPYING.  If not, write to the
+;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+;; Boston, MA 02111-1307, USA.
 
 (eval-when-compile (require 'cl))
 (provide 'reftex-global)

File reftex-index.el

 ;;; reftex-index.el - Index support with RefTeX
-;;; Version: 4.9
-;;;
-;;; See main file reftex.el for licensing information
+;; Copyright (c) 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
+
+;; Author:     Carsten Dominik <dominik@strw.LeidenUniv.nl>
+;; Version: 4.10
+;;
+
+;; This file is part of GNU Emacs.
+
+;; GNU Emacs is free software; you can redistribute it and/or modify
+;; it under the terms of the GNU General Public License as published by
+;; the Free Software Foundation; either version 2, or (at your option)
+;; any later version.
+
+;; GNU Emacs is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+;; GNU General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with GNU Emacs; see the file COPYING.  If not, write to the
+;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+;; Boston, MA 02111-1307, USA.
 
 (eval-when-compile (require 'cl))
 (provide 'reftex-index)
   (interactive)
   (reftex-access-scan-info)
   (let* ((master (reftex-TeX-master-file))
-	 (name (concat (file-name-sans-extension master) ".rip")))
+	 (name (concat (file-name-sans-extension master)
+		       reftex-index-phrase-file-extension)))
     (find-file name)
     (unless (eq major-mode 'reftex-index-phrases-mode)
       (reftex-index-phrases-mode))
 	      reftex-index-phrases-macro-data))
       ;; Reverse the list, so that the first macro is first
       (if (null reftex-index-phrases-macro-data)
-	  (error "No valid MACRO DEFINITION line in .rip file (make sure to use TAB separators)"))
+	  (error "No valid MACRO DEFINITION line in %s file (make sure to use TAB separators)" reftex-index-phrase-file-extension))
       (setq reftex-index-phrases-macro-data 
 	    (nreverse reftex-index-phrases-macro-data))
       (goto-char (point-min)))))

File reftex-parse.el

 ;;; reftex-parse.el - Parser Functions for RefTeX
-;;; Version: 4.9
-;;;
-;;; See main file reftex.el for licensing information
+;; Copyright (c) 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
+
+;; Author:     Carsten Dominik <dominik@strw.LeidenUniv.nl>
+;; Version: 4.10
+;;
+
+;; This file is part of GNU Emacs.
+
+;; GNU Emacs is free software; you can redistribute it and/or modify
+;; it under the terms of the GNU General Public License as published by
+;; the Free Software Foundation; either version 2, or (at your option)
+;; any later version.
+
+;; GNU Emacs is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+;; GNU General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with GNU Emacs; see the file COPYING.  If not, write to the
+;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+;; Boston, MA 02111-1307, USA.
 
 (eval-when-compile (require 'cl))
 (provide 'reftex-parse)

File reftex-ref.el

 ;;; reftex-ref.el - Code to create labels and references with RefTeX
-;;; Version: 4.9
-;;;
-;;; See main file reftex.el for licensing information
+;; Copyright (c) 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
+
+;; Author:     Carsten Dominik <dominik@strw.LeidenUniv.nl>
+;; Version: 4.10
+;;
+
+;; This file is part of GNU Emacs.
+
+;; GNU Emacs is free software; you can redistribute it and/or modify
+;; it under the terms of the GNU General Public License as published by
+;; the Free Software Foundation; either version 2, or (at your option)
+;; any later version.
+
+;; GNU Emacs is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+;; GNU General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with GNU Emacs; see the file COPYING.  If not, write to the
+;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+;; Boston, MA 02111-1307, USA.
 
 (eval-when-compile (require 'cl))
 (provide 'reftex-ref)

File reftex-sel.el

 ;;; reftex-sel.el - The selection modes for RefTeX
-;;; Version: 4.9
-;;;
-;;; See main file reftex.el for licensing information
+;; Copyright (c) 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
+
+;; Author:     Carsten Dominik <dominik@strw.LeidenUniv.nl>
+;; Version: 4.10
+;;
+
+;; This file is part of GNU Emacs.
+
+;; GNU Emacs is free software; you can redistribute it and/or modify
+;; it under the terms of the GNU General Public License as published by
+;; the Free Software Foundation; either version 2, or (at your option)
+;; any later version.
+
+;; GNU Emacs is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+;; GNU General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with GNU Emacs; see the file COPYING.  If not, write to the
+;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+;; Boston, MA 02111-1307, USA.
 
 (eval-when-compile (require 'cl))
 (provide 'reftex-sel)

File reftex-toc.el

 ;;; reftex-toc.el - RefTeX's table of contents mode
-;;; Version: 4.9
-;;;
-;;; See main file reftex.el for licensing information
+;; Copyright (c) 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
+
+;; Author:     Carsten Dominik <dominik@strw.LeidenUniv.nl>
+;; Version: 4.10
+;;
+
+;; This file is part of GNU Emacs.
+
+;; GNU Emacs is free software; you can redistribute it and/or modify
+;; it under the terms of the GNU General Public License as published by
+;; the Free Software Foundation; either version 2, or (at your option)
+;; any later version.
+
+;; GNU Emacs is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+;; GNU General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with GNU Emacs; see the file COPYING.  If not, write to the
+;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+;; Boston, MA 02111-1307, USA.
 
 (eval-when-compile (require 'cl))
 (provide 'reftex-toc)

File reftex-vars.el

 ;;; reftex-vars.el - Configuration variables for RefTeX
-;;; Version: 4.9
-;;;
-;;; See main file reftex.el for licensing information
+;; Copyright (c) 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
+
+;; Author:     Carsten Dominik <dominik@strw.LeidenUniv.nl>
+;; Version: 4.10
+;;
+
+;; This file is part of GNU Emacs.
+
+;; GNU Emacs is free software; you can redistribute it and/or modify
+;; it under the terms of the GNU General Public License as published by
+;; the Free Software Foundation; either version 2, or (at your option)
+;; any later version.
+
+;; GNU Emacs is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+;; GNU General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with GNU Emacs; see the file COPYING.  If not, write to the
+;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+;; Boston, MA 02111-1307, USA.
 
 (eval-when-compile (require 'cl))
 (provide 'reftex-vars)
   :group 'reftex-index-support
   :type 'string)
 
+(defcustom reftex-index-phrase-file-extension ".rip"
+  "File extension for the index phrase file.
+This extension will be added to the base name of the master file."
+  :group 'reftex-index-support
+  :type 'string)
+
 (defcustom reftex-index-phrases-logical-and-regexp " *&& *"
   "Regexp matching the `and' operator for index arguments in phrases file.
 When several index arguments in a phrase line are separated by this
   :group 'reftex-optimizations-for-large-documents
   :type 'boolean)
 
+(defcustom reftex-parse-file-extension ".rel"
+  "*File extension for the file in which parser information is stored.
+This extension is added to the base name of the master file."
+  :group 'reftex-optimizations-for-large-documents
+  :type 'string)
+
 (defcustom reftex-use-multiple-selection-buffers nil
   "*Non-nil means use a separate selection buffer for each label type.
 These buffers are kept from one selection to the next and need not to be

File reftex-vcr.el

-;;; reftex-vcr.el - Viewing cross references and citations with RefTeX
-;;; Version: 4.9
-;;;
-;;; See main file reftex.el for licensing information
-
-(eval-when-compile (require 'cl))
-(provide 'reftex-vcr)
-(require 'reftex)
-;;;
-
-(defun reftex-view-crossref (&optional arg auto-how)
-  "View cross reference of macro at point.  Point must be on the KEY
-argument.  When at at `\ref' macro, show corresponding `\label'
-definition, also in external documents (`xr').  When on a label, show
-a locations where KEY is referenced.  Subsequent calls find additional
-locations.  When on a `\cite', show the associated `\bibitem' macro or
-the BibTeX database entry.  When on a `\bibitem', show a `\cite' macro
-which uses this KEY. When on an `\index', show other locations marked
-by the same index entry.
-To define additional cross referencing items, use the option
-`reftex-view-crossref-extra'.  See also `reftex-view-crossref-from-bibtex'.
-With one or two C-u prefixes, enforce rescanning of the document.
-With argument 2, select the window showing the cross reference.
-AUTO-HOW is only for the automatic crossref display and is handed through
-to the functions `reftex-view-cr-cite' and `reftex-view-cr-ref'."
-
-  (interactive "P")
-  ;; See where we are.
-  (let* ((macro (car (reftex-what-macro-safe 1)))
-         (key (reftex-this-word "^{}%\n\r,"))
-	 dw)
-
-    (if (or (null macro) (reftex-in-comment))
-	(error "Not on a crossref macro argument"))
-
-    (setq reftex-call-back-to-this-buffer (current-buffer))
-
-    (cond
-     ((string-match "\\`\\\\cite\\|cite\\*?\\'" macro)
-      ;; A citation macro: search for bibitems or BibTeX entries
-      (setq dw (reftex-view-cr-cite arg key auto-how)))
-     ((string-match "\\`\\\\ref\\|ref\\(range\\)?\\*?\\'" macro)
-      ;; A reference macro: search for labels
-      (setq dw (reftex-view-cr-ref arg key auto-how)))
-     (auto-how nil)  ;; No further action for automatic display (speed)
-     ((or (equal macro "\\label")
-	  (member macro reftex-macros-with-labels))
-      ;; A label macro: search for reference macros
-      (reftex-access-scan-info arg)
-      (setq dw (reftex-view-regexp-match
-		(format reftex-find-reference-format (regexp-quote key))
-		4 nil nil)))
-     ((equal macro "\\bibitem")
-      ;; A bibitem macro: search for citations
-      (reftex-access-scan-info arg)
-      (setq dw (reftex-view-regexp-match
-		(format reftex-find-citation-regexp-format (regexp-quote key))
-		3 nil nil)))
-     ((member macro reftex-macros-with-index)
-      (reftex-access-scan-info arg)
-      (setq dw (reftex-view-regexp-match
-		(format reftex-find-index-entry-regexp-format
-			(regexp-quote key))
-		3 nil nil)))
-     (t 
-      (reftex-access-scan-info arg)
-      (catch 'exit
-	(let ((list reftex-view-crossref-extra)
-	      entry mre action group)
-	  (while (setq entry (pop list))
-	    (setq mre (car entry)
-		  action (nth 1 entry)
-		  group (nth 2 entry))
-	    (when (string-match mre macro)
-	      (setq dw (reftex-view-regexp-match 
-			(format action key) group nil nil))
-	      (throw 'exit t))))
-	(error "Not on a crossref macro argument"))))
-    (if (and (eq arg 2) (windowp dw)) (select-window dw))))
-     
-(defun reftex-view-cr-cite (arg key how)
-  ;; View crossreference of a ref cite.  HOW can have the values 
-  ;; nil:         Show in another window.
-  ;; echo:        Show one-line info in echo area.
-  ;; tmp-window:  Show in small window and arrange for window to disappear.
-
-  ;; Ensure access to scanning info
-  (reftex-access-scan-info (or arg current-prefix-arg))
-
-  (if (eq how 'tmp-window)
-      ;; Remember the window configuration
-      (put 'reftex-auto-view-crossref 'last-window-conf 
-	   (current-window-configuration)))
-
-  (let (files size item (pos (point)) (win (selected-window)) pop-win)
-    ;; Find the citation mode and the file list
-    (cond
-     ((assq 'bib (symbol-value reftex-docstruct-symbol))
-      (setq item nil
-	    files (reftex-get-bibfile-list)))
-     ((assq 'thebib (symbol-value reftex-docstruct-symbol))
-      (setq item t
-	    files (reftex-uniquify
-		   (mapcar 'cdr
-			   (reftex-all-assq 
-			    'thebib (symbol-value reftex-docstruct-symbol))))))
-     (reftex-default-bibliography
-      (setq item nil
-	    files (reftex-default-bibliography)))
-     (how)  ;; don't throw for special display
-     (t (error "Cannot display crossref")))
-
-    (if (eq how 'echo)
-	;; Display in Echo area
-	(reftex-echo-cite key files item)
-      ;; Display in a window
-      (if (not (eq how 'tmp-window))
-	  ;; Normal display
-	  (reftex-pop-to-bibtex-entry key files nil t item)
-	;; A temporary window
-	(condition-case nil
-	    (reftex-pop-to-bibtex-entry key files nil t item)
-	  (error (goto-char pos)
-		 (message "cite: no such citation key %s" key)
-		 (error "")))
-	;; Resize the window
-	(setq size (max 1 (count-lines (point)
-				       (reftex-end-of-bib-entry item))))
-	(let ((window-min-height 2))
-	  (shrink-window (1- (- (window-height) size)))
-	  (recenter 0))
-	;; Arrange restoration
-	(add-hook 'pre-command-hook 'reftex-restore-window-conf))
-
-	;; Normal display in other window
-      (add-hook 'pre-command-hook 'reftex-highlight-shall-die)
-      (setq pop-win (selected-window))
-      (select-window win)
-      (goto-char pos)
-      (when (equal arg 2)
-	(select-window pop-win)))))
-
-(defun reftex-view-cr-ref (arg label how)
-  ;; View crossreference of a ref macro.  HOW can have the values 
-  ;; nil:         Show in another window.
-  ;; echo:        Show one-line info in echo area.
-  ;; tmp-window:  Show in small window and arrange for window to disappear.
-
-  ;; Ensure access to scanning info
-  (reftex-access-scan-info (or arg current-prefix-arg))
-  
-  (if (eq how 'tmp-window)
-      ;; Remember the window configuration
-      (put 'reftex-auto-view-crossref 'last-window-conf 
-	   (current-window-configuration)))
-
-  (let* ((xr-data (assoc 'xr (symbol-value reftex-docstruct-symbol)))
-	 (xr-re (nth 2 xr-data))
-	 (entry (assoc label (symbol-value reftex-docstruct-symbol)))
-	 (win (selected-window)) pop-win (pos (point)))
-
-    (if (and (not entry) (stringp label) xr-re (string-match xr-re label))
-	;; Label is defined in external document
-	(save-excursion
-	  (save-match-data
-	    (set-buffer 
-	     (or (reftex-get-file-buffer-force
-		  (cdr (assoc (match-string 1 label) (nth 1
-							  xr-data))))
-		 (error "Problem with external label %s" label))))
-	  (setq label (substring label (match-end 1)))
-	  (reftex-access-scan-info)
-	  (setq entry 
-		(assoc label (symbol-value reftex-docstruct-symbol)))))
-    (if (eq how 'echo)
-	;; Display in echo area
-	(reftex-echo-ref label entry (symbol-value reftex-docstruct-symbol))
-      (let ((window-conf (current-window-configuration)))
-	(condition-case nil
-	    (reftex-show-label-location entry t nil t t)
-	  (error (set-window-configuration window-conf)
-		 (message "ref: Label %s not found" label)
-		 (error "ref: Label %s not found" label)))) ;; 2nd is line OK
-      (add-hook 'pre-command-hook 'reftex-highlight-shall-die)
-
-      (when (eq how 'tmp-window)
-	;; Resize window and arrange restauration
-	(shrink-window (1- (- (window-height) 9)))
-	(recenter '(4))
-	(add-hook 'pre-command-hook 'reftex-restore-window-conf))
-      (setq pop-win (selected-window))
-      (select-window win)
-      (goto-char pos)
-      (when (equal arg 2)
-	(select-window pop-win)))))
-
-(defun reftex-mouse-view-crossref (ev)
-  "View cross reference of \\ref or \\cite macro where you click.
-If the macro at point is a \\ref, show the corresponding label definition.
-If it is a \\cite, show the BibTeX database entry.
-If there is no such macro at point, search forward to find one.
-With argument, actually select the window showing the cross reference."
-  (interactive "e")
-  (mouse-set-point ev)
-  (reftex-view-crossref current-prefix-arg))
-
-(defun reftex-view-crossref-when-idle ()
-  ;; Display info about crossref at point in echo area or a window.
-  ;; This function was desigend to work with an idle timer.
-  ;; We try to get out of here as quickly as possible if the call is useless.
-  (and reftex-mode
-       ;; Make sure message area is free if we need it.
-       (or (eq reftex-auto-view-crossref 'window) (not (current-message)))
-       ;; Make sure we are not already displaying this one
-       (not (memq last-command '(reftex-view-crossref
-				 reftex-mouse-view-crossref)))
-       ;; Quick precheck if this might be a relevant spot
-       ;; FIXME: Can fail with backslash in comment
-       (save-excursion  
-	 (search-backward "\\" nil t)
-	 (looking-at "\\\\[a-zA-Z]*\\(cite\\|ref\\)"))
-
-       (condition-case nil
-	   (let ((current-prefix-arg nil))
-	     (cond
-	      ((eq reftex-auto-view-crossref t)
-	       (reftex-view-crossref -1 'echo))
-	      ((eq reftex-auto-view-crossref 'window)
-	       (reftex-view-crossref -1 'tmp-window))
-	      (t nil)))
-	 (error nil))))
-
-(defun reftex-restore-window-conf ()
-  (set-window-configuration (get 'reftex-auto-view-crossref 'last-window-conf))
-  (put 'reftex-auto-view-crossref 'last-window-conf nil)
-  (remove-hook 'pre-command-hook 'reftex-restore-window-conf))
-		  
-(defun reftex-echo-ref (label entry docstruct)
-  ;; Display crossref info in echo area.
-  (cond
-   ((null docstruct)
-    (message (substitute-command-keys (format reftex-no-info-message "ref"))))
-   ((null entry)
-    (message "ref: unknown label: %s" label))
-   (t
-    (when (stringp (nth 2 entry))
-      (message "ref(%s): %s" (nth 1 entry) (nth 2 entry)))
-    (let ((buf (get-buffer " *Echo Area*")))
-      (when buf
-	(save-excursion
-	  (set-buffer buf)
-	  (run-hooks 'reftex-display-copied-context-hook)))))))
-
-(defun reftex-echo-cite (key files item)
-  ;; Display citation info in echo area.
-  (let* ((cache (assq 'bibview-cache (symbol-value reftex-docstruct-symbol)))
-	 (cache-entry (assoc key (cdr cache)))
-	 entry string buf (all-files files))
-
-    (if (and reftex-cache-cite-echo cache-entry)
-	;; We can just use the cache
-	(setq string (cdr cache-entry))
-
-      ;; Need to look in the database
-      (unless reftex-revisit-to-echo
-	(setq files (reftex-visited-files files)))
-
-      (setq entry 
-	    (condition-case nil
-		(save-excursion
-		  (reftex-pop-to-bibtex-entry key files nil nil item t))
-	      (error
-	       (if (and files (= (length all-files) (length files)))
-		   (message "cite: no such database entry: %s" key)
-		 (message (substitute-command-keys 
-			   (format reftex-no-info-message "cite"))))
-	       nil)))
-      (when entry
-	(if item
-	    (setq string (reftex-nicify-text entry))
-	  (setq string (reftex-make-cite-echo-string
-			(reftex-parse-bibtex-entry entry)
-			reftex-docstruct-symbol)))))
-    (unless (or (null string) (equal string ""))
-      (message "cite: %s" string))
-    (when (setq buf (get-buffer " *Echo Area*"))
-      (save-excursion
-	(set-buffer buf)
-	(run-hooks 'reftex-display-copied-context-hook)))))
-
-(defvar reftex-use-itimer-in-xemacs nil
-  "*Non-nil means use the idle timers in XEmacs for crossref display.
-Currently, idle timer restart is broken and we use the post-command-hook.")
-
-(defun reftex-toggle-auto-view-crossref ()
-  "Toggle the automatic display of crossref information in the echo area.
-When active, leaving point idle in the argument of a \\ref or \\cite macro
-will display info in the echo area."
-  (interactive)
-  (if reftex-auto-view-crossref-timer
-      (progn
-	(if (featurep 'xemacs)
-	    (if reftex-use-itimer-in-xemacs
-		(delete-itimer reftex-auto-view-crossref-timer)
-	      (remove-hook 'post-command-hook 'reftex-start-itimer-once))
-	  (cancel-timer reftex-auto-view-crossref-timer))
-	(setq reftex-auto-view-crossref-timer nil)
-	(message "Automatic display of crossref information was turned off"))
-    (setq reftex-auto-view-crossref-timer
-	  (if (featurep 'xemacs)
-	      (if reftex-use-itimer-in-xemacs
-		  (start-itimer "RefTeX Idle Timer"
-				'reftex-view-crossref-when-idle 
-				reftex-idle-time reftex-idle-time t)
-		(add-hook 'post-command-hook 'reftex-start-itimer-once)
-		t)
-	    (run-with-idle-timer
-	     reftex-idle-time t 'reftex-view-crossref-when-idle)))
-    (unless reftex-auto-view-crossref
-      (setq reftex-auto-view-crossref t))
-    (message "Automatic display of crossref information was turned on")))
-
-(defun reftex-start-itimer-once ()
-   (and reftex-mode
-	(not (itimer-live-p reftex-auto-view-crossref-timer))
-	(setq reftex-auto-view-crossref-timer
-	      (start-itimer "RefTeX Idle Timer"
-			    'reftex-view-crossref-when-idle 
-			    reftex-idle-time nil t))))
-
-(defun reftex-view-crossref-from-bibtex (&optional arg)
-  "View location in a LaTeX document which cites the BibTeX entry at point.
-Since BibTeX files can be used by many LaTeX documents, this function
-prompts upon first use for a buffer in RefTeX mode.  To reset this
-link to a document, call the function with with a prefix arg.
-Calling this function several times find successive citation locations."
-  (interactive "P")
-  (when arg 
-    ;; Break connection to reference buffer
-    (remprop 'reftex-bibtex-view-cite-locations :ref-buffer))
-  (let ((ref-buffer (get 'reftex-bibtex-view-cite-locations :ref-buffer)))
-    ;; Establish connection to reference buffer
-    (unless ref-buffer
-      (setq ref-buffer
-	    (save-excursion
-	      (completing-read 
-	       "Reference buffer: "
-	       (delq nil
-		     (mapcar 
-		      (lambda (b)
-			(set-buffer b)
-			(if reftex-mode (list (buffer-name b)) nil))
-		      (buffer-list)))
-	       nil t)))
-      (put 'reftex-bibtex-view-cite-locations :ref-buffer ref-buffer))
-    ;; Search for citations
-    (bibtex-beginning-of-entry)
-    (if (looking-at
-	 "@[a-zA-Z]+[ \t\n\r]*[{(][ \t\n\r]*\\([^, \t\r\n}]+\\)")
-	(progn
-	  (goto-char (match-beginning 1))
-	  (reftex-view-regexp-match
-	   (format reftex-find-citation-regexp-format
-		   (regexp-quote (match-string 1)))
-	   3 arg ref-buffer))
-      (error "Cannot find citation key in BibTeX entry"))))
-
-(defun reftex-view-regexp-match (re &optional highlight-group new ref-buffer)
-  ;; Search for RE in current document or in the document of REF-BUFFER.
-  ;; Continue the search, if the same re was searched last.
-  ;; Highlight the group HIGHLIGHT-GROUP of the match.
-  ;; When NEW is non-nil, start a new search regardless.
-  ;; Match point is displayed in another window.
-  ;; Upon success, returns the window which displays the match.
-
-  ;;; Decide if new search or continued search
-  (let* ((oldprop (get 'reftex-view-regexp-match :props))
-	 (newprop (list (current-buffer) re))
-	 (cont (and (not new) (equal oldprop newprop)))
-	 (cnt (if cont (get 'reftex-view-regexp-match :cnt) 0))
-	 (current-window (selected-window))
-	 (window-conf (current-window-configuration))
-	 match pop-window)
-    (switch-to-buffer-other-window (or ref-buffer (current-buffer)))
-    ;; Search
-    (condition-case nil
-	(if cont
-	    (setq match (reftex-global-search-continue))
-	  (reftex-access-scan-info)
-	  (setq match (reftex-global-search re (reftex-all-document-files))))
-      (error nil))
-    ;; Evaluate the match.
-    (if match
-	(progn
-	  (put 'reftex-view-regexp-match :props newprop)
-	  (put 'reftex-view-regexp-match :cnt (incf cnt))
-	  (reftex-highlight 0 (match-beginning highlight-group)
-			    (match-end highlight-group))
-	  (add-hook 'pre-command-hook 'reftex-highlight-shall-die)
-	  (setq pop-window (selected-window)))
-      (remprop 'reftex-view-regexp-match :props)
-      (or cont (set-window-configuration window-conf)))
-    (select-window current-window)
-    (if match
-	(progn
-	  (message "Match Nr. %s" cnt)
-	  pop-window)
-      (if cont
-	  (error "No further matches (total number of matches: %d)" cnt)
-	(error "No matches")))))
-
-(defvar reftex-global-search-marker (make-marker))
-(defun reftex-global-search (regexp file-list)
-  ;; Start a search for REGEXP in all files of FILE-LIST
-  (put 'reftex-global-search :file-list file-list)
-  (put 'reftex-global-search :regexp regexp)
-  (move-marker reftex-global-search-marker nil)
-  (reftex-global-search-continue))
-
-(defun reftex-global-search-continue ()
-  ;; Continue a global search started with `reftex-global-search'
-  (unless (get 'reftex-global-search :file-list)
-    (error "No global search to continue"))
-  (let* ((file-list (get 'reftex-global-search :file-list))
-	 (regexp (get 'reftex-global-search :regexp))
-	 (buf (or (marker-buffer reftex-global-search-marker)
-		  (reftex-get-file-buffer-force (car file-list))))
-	 (pos (or (marker-position reftex-global-search-marker) 1))
-	 file)
-    ;; Take up starting position
-    (unless buf (error "No such buffer %s" buf))
-    (switch-to-buffer buf)
-    (widen)
-    (goto-char pos)
-    ;; Search and switch file if necessary
-    (if (catch 'exit
-	  (while t
-	    (when (re-search-forward regexp nil t)
-	      (move-marker reftex-global-search-marker (point))
-	      (throw 'exit t))
-	    ;; No match - goto next file
-	    (pop file-list)
-	    (or file-list (throw 'exit nil))
-	    (setq file (car file-list)
-		  buf (reftex-get-file-buffer-force file))
-	    (unless buf (error "Cannot access file %s" file))
-	    (put 'reftex-global-search :file-list file-list)
-	    (switch-to-buffer buf)
-	    (widen)
-	    (goto-char 1)))
-	t
-      (move-marker reftex-global-search-marker nil)
-      (error "All files processed"))))
-
-;;; reftex-vcr.el ends here
 ;;; reftex.el --- Minor mode for doing \label, \ref, \cite, \index in LaTeX
-;; Copyright (c) 1997, 1998, 1999 Free Software Foundation, Inc.
+;; Copyright (c) 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
 
 ;; Author:     Carsten Dominik <dominik@strw.LeidenUniv.nl>
-;; Version:    4.9
+;; Version:    4.10
 ;; Keywords:   tex
 
-;; This file is not part of GNU Emacs.
+;; This file is part of GNU Emacs.
 
 ;; GNU Emacs is free software; you can redistribute it and/or modify
 ;; it under the terms of the GNU General Public License as published by
 ;;; Define the formal stuff for a minor mode named RefTeX.
 ;;;
 
-(defconst reftex-version "RefTeX version 4.9"
+(defconst reftex-version "RefTeX version 4.10"
   "Version string for RefTeX.")
 
 (defvar reftex-mode nil
          (master (reftex-TeX-master-file))
 	 (enable-local-variables nil)
          (file (if (string-match "\\.[a-zA-Z]+\\'" master)
-                   (concat (substring master 0 (match-beginning 0)) ".rel")
-                 (concat master ".rel"))))
+                   (concat (substring master 0 (match-beginning 0)) 
+			   reftex-parse-file-extension)
+                 (concat master reftex-parse-file-extension))))
     (cond
      ((eq action 'readable)
       (file-readable-p file))
 ;;;
 ;;; View cross references
 
-(autoload 'reftex-view-crossref "reftex-vcr"
+(autoload 'reftex-view-crossref "reftex-dcr"
  "View cross reference of \\ref or \\cite macro at point." t)
-(autoload 'reftex-mouse-view-crossref "reftex-vcr"
+(autoload 'reftex-mouse-view-crossref "reftex-dcr"
  "View cross reference of \\ref or \\cite macro where you click." t)
-(autoload 'reftex-toggle-auto-view-crossref "reftex-vcr")
-(autoload 'reftex-view-crossref-from-bibtex "reftex-vcr"
+(autoload 'reftex-toggle-auto-view-crossref "reftex-dcr")
+(autoload 'reftex-view-crossref-from-bibtex "reftex-dcr"
  "View location in a LaTeX document which cites the BibTeX entry at point." t)
 
 
 @synindex ky cp
 @syncodeindex vr cp
 @syncodeindex fn cp
-@set VERSION 4.9
-@set EDITION 4.9
-@set DATE December 1999
+@set VERSION 4.10
+@set EDITION 4.10
+@set DATE January 2000
 @set AUTHOR Carsten Dominik
 @set AUTHOR-EMAIL dominik@@strw.leidenuniv.nl
 @set MAINTAINER Carsten Dominik
 This is edition @value{EDITION} of the @b{Ref@TeX{}} User Manual for
 @b{Ref@TeX{}} @value{VERSION}@refill
 
-Copyright (c) 1997, 1998, 1999 Free Software Foundation, Inc.
+Copyright (c) 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
 
 Permission is granted to make and distribute verbatim
 copies of this manual provided the copyright notice and
 
 @author by Carsten Dominik
 @page
-Copyright @copyright{} 1997, 1998, 1999 Free Software Foundation, Inc.
+Copyright @copyright{} 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
 
 @sp 2
 This is edition @value{EDITION} of the @cite{Ref@TeX{} User Manual} for
 @b{Saving Parser Information}@*
 @cindex Saving parser information
 @cindex Parse information, saving to a file
+@vindex reftex-parse-file-extension
 Even with partial scans enabled, @b{Ref@TeX{}} still has to make one full
 scan, when you start working with a document.  To avoid this, parsing
 information can be stored in a file.  The file @file{MASTER.rel} is used
 @file{texmathp.el} library which is part of AUCTeX.@refill
 @end defopt
 
+@defopt reftex-index-phrase-file-extension
+File extension for the index phrase file.  This extension will be added
+to the base name of the master file.
+@end defopt
+
 @defopt reftex-index-phrases-logical-and-regexp
 Regexp matching the @samp{and} operator for index arguments in phrases
 file.  When several index arguments in a phrase line are separated by
 @end itemize
 @end defopt
 
+@defopt reftex-parse-file-extension
+File extension for the file in which parser information is stored.
+This extension is added to the base name of the master file.
+@end defopt
+
 @defopt reftex-allow-automatic-rescan
 Non-@code{nil} means, @b{Ref@TeX{}} may rescan the document when this seems
 necessary.  Applies (currently) only in rare cases, when a new label
 entries for @samp{"begin@{theorem@}"} in
 @code{reftex-setion-levels}.@refill 
 @end itemize
+@noindent @b{Version 4.10}
+@itemize @bullet
+@item
+Renamed @file{reftex-vcr.el} to @file{reftex-dcr.el} because of conflict
+with @file{reftex-vars.el} on DOS machines.
+@item
+New options @code{reftex-parse-file-extension} and
+@code{reftex-index-phrase-file-extension}.
+@end itemize
 
 @node Index,  , , Top
 @unnumbered Index