From 70d797cd6e055969be39581f7963a8f1eb10b24e Mon Sep 17 00:00:00 2001 From: Carsten Dominik Date: Fri, 8 Jun 2001 08:43:20 +0000 Subject: [PATCH 1/1] * reftex-ref.el (reftex-select-label-help): Added "z" key description. * reftex-sel.el (reftex-select-jump): New command. * reftex-toc.el (reftex-toc-help): Added "z" key description. (reftex-toc-jump): New command. * reftex-cite.el (reftex-parse-bibitem): Regexp changed to parse international characters as well. * reftex.el: Added autoloads for eftex-varioref-vref', eftex-fancyref-fref', eftex-fancyref-Fref' * reftex-vars.el: Protected single backslash in many docstrings. * reftex-dcr.el (reftex-view-crossref): added SPACE and TAB to the key separaotrs. --- lisp/textmodes/reftex-auc.el | 2 +- lisp/textmodes/reftex-cite.el | 6 +++--- lisp/textmodes/reftex-dcr.el | 2 +- lisp/textmodes/reftex-global.el | 2 +- lisp/textmodes/reftex-index.el | 2 +- lisp/textmodes/reftex-parse.el | 2 +- lisp/textmodes/reftex-ref.el | 9 +++++---- lisp/textmodes/reftex-sel.el | 12 +++++++++++- lisp/textmodes/reftex-toc.el | 16 ++++++++++++++-- lisp/textmodes/reftex-vars.el | 19 +++++++++++-------- lisp/textmodes/reftex.el | 10 ++++++++-- 11 files changed, 57 insertions(+), 25 deletions(-) diff --git a/lisp/textmodes/reftex-auc.el b/lisp/textmodes/reftex-auc.el index 1fe6da1dca..e4f40025df 100644 --- a/lisp/textmodes/reftex-auc.el +++ b/lisp/textmodes/reftex-auc.el @@ -2,7 +2,7 @@ ;; Copyright (c) 1997, 1998, 1999, 2000 Free Software Foundation, Inc. ;; Author: Carsten Dominik -;; Version: 4.15 +;; Version: 4.16 ;; ;; This file is part of GNU Emacs. diff --git a/lisp/textmodes/reftex-cite.el b/lisp/textmodes/reftex-cite.el index f9ffc01562..0eb70a5005 100644 --- a/lisp/textmodes/reftex-cite.el +++ b/lisp/textmodes/reftex-cite.el @@ -2,7 +2,7 @@ ;; Copyright (c) 1997, 1998, 1999, 2000 Free Software Foundation, Inc. ;; Author: Carsten Dominik -;; Version: 4.15 +;; Version: 4.16 ;; ;; This file is part of GNU Emacs. @@ -487,7 +487,7 @@ (defun reftex-parse-bibitem (item) ;; Parse a \bibitem entry (let ((key "") (text "")) - (when (string-match "\\`{\\([^}]+\\)}\\([\001-\255]*\\)" item) + (when (string-match "\\`{\\([^}]+\\)}\\([^\000]*\\)" item) (setq key (match-string 1 item) text (match-string 2 item))) ;; Clean up the text a little bit @@ -534,7 +534,7 @@ FORAT-KEY can be used to pre-select a citation format. When called with one or two `C-u' prefixes, first rescans the document. When called with a numeric prefix, make that many citations. When -called with point inside the braces of a `\cite' command, it will +called with point inside the braces of a `\\cite' command, it will add another key, ignoring the value of `reftex-cite-format'. The regular expression uses an expanded syntax: && is interpreted as `and'. diff --git a/lisp/textmodes/reftex-dcr.el b/lisp/textmodes/reftex-dcr.el index 72c981b4c6..1a1d04fb4a 100644 --- a/lisp/textmodes/reftex-dcr.el +++ b/lisp/textmodes/reftex-dcr.el @@ -2,7 +2,7 @@ ;; Copyright (c) 1997, 1998, 1999, 2000 Free Software Foundation, Inc. ;; Author: Carsten Dominik -;; Version: 4.15 +;; Version: 4.16 ;; ;; This file is part of GNU Emacs. diff --git a/lisp/textmodes/reftex-global.el b/lisp/textmodes/reftex-global.el index 2c1d9538f1..07aef17821 100644 --- a/lisp/textmodes/reftex-global.el +++ b/lisp/textmodes/reftex-global.el @@ -2,7 +2,7 @@ ;; Copyright (c) 1997, 1998, 1999, 2000 Free Software Foundation, Inc. ;; Author: Carsten Dominik -;; Version: 4.15 +;; Version: 4.16 ;; ;; This file is part of GNU Emacs. diff --git a/lisp/textmodes/reftex-index.el b/lisp/textmodes/reftex-index.el index 00427cfd97..e2016a54fa 100644 --- a/lisp/textmodes/reftex-index.el +++ b/lisp/textmodes/reftex-index.el @@ -2,7 +2,7 @@ ;; Copyright (c) 1997, 1998, 1999, 2000 Free Software Foundation, Inc. ;; Author: Carsten Dominik -;; Version: 4.15 +;; Version: 4.16 ;; ;; This file is part of GNU Emacs. diff --git a/lisp/textmodes/reftex-parse.el b/lisp/textmodes/reftex-parse.el index 2740f1f0cf..d9d04b4c11 100644 --- a/lisp/textmodes/reftex-parse.el +++ b/lisp/textmodes/reftex-parse.el @@ -2,7 +2,7 @@ ;; Copyright (c) 1997, 1998, 1999, 2000 Free Software Foundation, Inc. ;; Author: Carsten Dominik -;; Version: 4.15 +;; Version: 4.16 ;; ;; This file is part of GNU Emacs. diff --git a/lisp/textmodes/reftex-ref.el b/lisp/textmodes/reftex-ref.el index 683fbe63c2..f2aa24a4a8 100644 --- a/lisp/textmodes/reftex-ref.el +++ b/lisp/textmodes/reftex-ref.el @@ -2,7 +2,7 @@ ;; Copyright (c) 1997, 1998, 1999, 2000 Free Software Foundation, Inc. ;; Author: Carsten Dominik -;; Version: 4.15 +;; Version: 4.16 ;; ;; This file is part of GNU Emacs. @@ -364,6 +364,7 @@ also applies `reftex-translate-to-ascii-function' to the string." " n / p Go to next/previous label (Cursor motion works as well) C-c C-n/p Go to next/previous section heading. b / l Jump back to previous selection / Reuse last referenced label. + z Jump to a specific section, e.g. '3 z' jumps to section 3. g / s Update menu / Switch label type. r / C-u r Reparse document / Reparse entire document. x Switch to label menu of external document (with LaTeX package `xr'). @@ -770,19 +771,19 @@ When called with 2 C-u prefix args, disable magic word recognition." (setq buffer-read-only t)))))) (defun reftex-varioref-vref () - "Insert a reference using the `\vref' macro from the varioref package." + "Insert a reference using the `\\vref' macro from the varioref package." (interactive) (let ((reftex-format-ref-function 'reftex-format-vref)) (reftex-reference))) (defun reftex-fancyref-fref () - "Insert a reference using the `\fref' macro from the fancyref package." + "Insert a reference using the `\\fref' macro from the fancyref package." (interactive) (let ((reftex-format-ref-function 'reftex-format-fref) ;;(reftex-guess-label-type nil) ;FIXME do we want this???? ) (reftex-reference))) (defun reftex-fancyref-Fref () - "Insert a reference using the `\Fref' macro from the fancyref package." + "Insert a reference using the `\\Fref' macro from the fancyref package." (interactive) (let ((reftex-format-ref-function 'reftex-format-Fref) ;;(reftex-guess-label-type nil) ;FIXME do we want this???? diff --git a/lisp/textmodes/reftex-sel.el b/lisp/textmodes/reftex-sel.el index d76dfa5556..fa3f04e8d9 100644 --- a/lisp/textmodes/reftex-sel.el +++ b/lisp/textmodes/reftex-sel.el @@ -2,7 +2,7 @@ ;; Copyright (c) 1997, 1998, 1999, 2000 Free Software Foundation, Inc. ;; Author: Carsten Dominik -;; Version: 4.15 +;; Version: 4.16 ;; ;; This file is part of GNU Emacs. @@ -445,6 +445,15 @@ During a selection process, these are the local bindings. (interactive "p") (setq reftex-callback-fwd nil) (re-search-backward "^[^. \t\n\r]" nil t arg)) +(defun reftex-select-jump (arg) + "Jump to a specific section. E.g. '3 z' jumps to section 3. +Useful for large TOC's." + (interactive "P") + (goto-char (point-min)) + (re-search-forward + (concat "^ *" (number-to-string (if (numberp arg) arg 1)) " ") + nil t) + (beginning-of-line)) (defun reftex-select-next-heading (&optional arg) "Move to next table of contentes line." (interactive "p") @@ -660,6 +669,7 @@ During a selection process, these are the local bindings. (loop for x in '(("b" . reftex-select-jump-to-previous) + ("z" . reftex-select-jump) ("v" . reftex-select-toggle-varioref) ("V" . reftex-select-toggle-fancyref) ("m" . reftex-select-mark) diff --git a/lisp/textmodes/reftex-toc.el b/lisp/textmodes/reftex-toc.el index 83a26fb0f7..7e290ea734 100644 --- a/lisp/textmodes/reftex-toc.el +++ b/lisp/textmodes/reftex-toc.el @@ -2,7 +2,7 @@ ;; Copyright (c) 1997, 1998, 1999, 2000 Free Software Foundation, Inc. ;; Author: Carsten Dominik -;; Version: 4.15 +;; Version: 4.16 ;; ;; This file is part of GNU Emacs. @@ -92,7 +92,8 @@ t Change maximum toc depth (e.g. `3 t' hides levels greater than 3). f / g Toggle follow mode on and off / Refresh *toc* buffer. r / C-u r Reparse the LaTeX document / Reparse entire LaTeX document. . In other window, show position from where `reftex-toc' was called. -x Switch to TOC of external document (with LaTeX package `xr').") +x Switch to TOC of external document (with LaTeX package `xr'). +z Jump to a specific section (e.g. '3 z' goes to section 3") (defun reftex-toc (&optional rebuild) "Show the table of contents for the current document. @@ -426,6 +427,16 @@ With prefix arg 1, restrict index to the section at point." (message "") (message "Switched document")))) +(defun reftex-toc-jump (arg) + "Jump to a specific section. E.g. '3 z' jumps to section 3. +Useful for large TOC's." + (interactive "P") + (goto-char (point-min)) + (re-search-forward + (concat "^ *" (number-to-string (if (numberp arg) arg 1)) " ") + nil t) + (beginning-of-line)) + (defun reftex-toc-visit-location (&optional final no-revisit) ;; Visit the tex file corresponding to the toc entry on the current line. ;; If FINAL is t, stay there @@ -576,6 +587,7 @@ With prefix arg 1, restrict index to the section at point." ("c" . reftex-toc-toggle-context) ("%" . reftex-toc-toggle-commented) ("x" . reftex-toc-external) + ("z" . reftex-toc-jump) ("." . reftex-toc-show-calling-point) ("\C-c\C-n" . reftex-toc-next-heading) ("\C-c\C-p" . reftex-toc-previous-heading)) diff --git a/lisp/textmodes/reftex-vars.el b/lisp/textmodes/reftex-vars.el index 9794c01361..5646779e41 100644 --- a/lisp/textmodes/reftex-vars.el +++ b/lisp/textmodes/reftex-vars.el @@ -2,7 +2,7 @@ ;; Copyright (c) 1997, 1998, 1999, 2000 Free Software Foundation, Inc. ;; Author: Carsten Dominik -;; Version: 4.15 +;; Version: 4.16 ;; ;; This file is part of GNU Emacs. @@ -348,7 +348,7 @@ TYPE-KEY cases in which different environments carry the same label type (like `equation' and `eqnarray'). If the type indicator is nil and the macro has a label argument {*}, - the macro defines neutral labels just like \label. In this case + the macro defines neutral labels just like \\label. In this case the reminder of this entry is ignored. LABEL-PREFIX @@ -731,7 +731,7 @@ AFTER Character class after abbrev point in word." "Function which produces the string to insert as a label definition. Normally should be nil, unless you want to do something fancy. The function will be called with two arguments, the LABEL and the DEFAULT -FORMAT, which usually is `\label{%s}'. The function should return the +FORMAT, which usually is `\\label{%s}'. The function should return the string to insert into the buffer." :group 'reftex-making-and-inserting-labels :type 'function) @@ -788,7 +788,7 @@ get one interactively during selection from the label menu." "Punctuation strings for multiple references. When marking is used in the selection buffer to select several references, this variable associates the 3 marking characters `,-+' with prefix strings -to be inserted into the buffer before the corresponding \ref macro. +to be inserted into the buffer before the corresponding \\ref macro. This is used to string together whole reference sets, like `eqs. 1,2,3-5,6 and 7' in a single call to `reftex-reference'. See manual." :group 'reftex-referencing-labels @@ -832,11 +832,11 @@ a label type. If you set this variable to nil, RefTeX will always prompt." "Function which produces the string to insert as a reference. Normally should be nil, because the format to insert a reference can already be specified in `reftex-label-alist'. -This hook also is used by the special commands to insert `\vref' and `\fref' +This hook also is used by the special commands to insert `\\vref' and `\\fref' references, so even if you set this, your setting will be ignored by the special commands. The function will be called with two arguments, the LABEL and the DEFAULT -FORMAT, which normally is `~\ref{%s}'. The function should return the +FORMAT, which normally is `~\\ref{%s}'. The function should return the string to insert into the buffer." :group 'reftex-referencing-labels :type 'function) @@ -865,7 +865,7 @@ like, which are ignored by RefTeX anyway." (defcustom reftex-default-bibliography nil "*List of BibTeX database files which should be used if none are specified. When `reftex-citation' is called from a document which has neither a -`\bibliography{..}' statement nor a `thebibliography' environment, +`\\bibliography{..}' statement nor a `thebibliography' environment, RefTeX will scan these files instead. Intended for using `reftex-citation' in non-LaTeX files. The files will be searched along the BIBINPUTS or TEXBIB path." @@ -1346,7 +1346,10 @@ DEF-EXT: The default extension for that file type, like \".tex\" or \".bib\". OTHER-EXT: Any number of other legal extensions for this file type. When a files is searched and it does not have any of the legal extensions, -we try the default extension first, and then the naked file name." +we try the default extension first, and then the naked file name. + +If you are using AUCTeX, you also need to add new extensions to +TeX-file-extensions." :group 'reftex-finding-files :type '(repeat (cons (string :tag "File type") (repeat (string :tag "Extension"))))) diff --git a/lisp/textmodes/reftex.el b/lisp/textmodes/reftex.el index 08d6c8baa7..0f57649c0a 100644 --- a/lisp/textmodes/reftex.el +++ b/lisp/textmodes/reftex.el @@ -2,7 +2,7 @@ ;; Copyright (c) 1997, 1998, 1999, 2000 Free Software Foundation, Inc. ;; Author: Carsten Dominik -;; Version: 4.15 +;; Version: 4.16 ;; 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.15" +(defconst reftex-version "RefTeX version 4.16" "Version string for RefTeX.") (defvar reftex-mode nil @@ -1603,6 +1603,12 @@ When DIE is non-nil, throw an error if file not found." "Insert a unique label." t) (autoload 'reftex-reference "reftex-ref" "Make a LaTeX reference." t) +(autoload 'reftex-varioref-vref "reftex-ref" + "Make a varioref reference." t) +(autoload 'reftex-fancyref-fref "reftex-ref" + "Make a fancyref \\fref reference." t) +(autoload 'reftex-fancyref-Fref "reftex-ref" + "Make a fancyref \\Fref reference." t) (autoload 'reftex-show-label-location "reftex-ref") (autoload 'reftex-query-label-type "reftex-ref") -- 2.20.1