mirror of
https://git.savannah.gnu.org/git/emacs.git
synced 2024-12-30 11:09:23 +00:00
Updated to RefTeX 4.18
This commit is contained in:
parent
51922c041c
commit
7ac7387b8e
@ -2,7 +2,7 @@
|
||||
;; Copyright (c) 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
|
||||
|
||||
;; Author: Carsten Dominik <dominik@science.uva.nl>
|
||||
;; Version: 4.17
|
||||
;; Version: 4.18
|
||||
|
||||
;; This file is part of GNU Emacs.
|
||||
|
||||
|
@ -2,7 +2,7 @@
|
||||
;; Copyright (c) 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
|
||||
|
||||
;; Author: Carsten Dominik <dominik@science.uva.nl>
|
||||
;; Version: 4.17
|
||||
;; Version: 4.18
|
||||
|
||||
;; This file is part of GNU Emacs.
|
||||
|
||||
@ -164,13 +164,16 @@
|
||||
(let* (re-list first-re rest-re
|
||||
(buffer-list (if (listp buffers) buffers (list buffers)))
|
||||
found-list entry buffer1 buffer alist
|
||||
key-point start-point end-point)
|
||||
key-point start-point end-point default)
|
||||
|
||||
;; Read a regexp, completing on known citation keys.
|
||||
(setq default (regexp-quote (reftex-get-bibkey-default)))
|
||||
(setq re-list
|
||||
(split-string
|
||||
(completing-read
|
||||
"RegExp [ && RegExp...]: "
|
||||
(concat
|
||||
"Regex { && Regex...}: "
|
||||
"[" default "]: ")
|
||||
(if reftex-mode
|
||||
(if (fboundp 'LaTeX-bibitem-list)
|
||||
(LaTeX-bibitem-list)
|
||||
@ -180,6 +183,9 @@
|
||||
nil nil nil 'reftex-cite-regexp-hist)
|
||||
"[ \t]*&&[ \t]*"))
|
||||
|
||||
(if (or (null re-list ) (equal re-list '("")))
|
||||
(setq re-list (list default)))
|
||||
|
||||
(setq first-re (car re-list) ; We'll use the first re to find things,
|
||||
rest-re (cdr re-list)) ; the others to narrow down.
|
||||
(if (string-match "\\`[ \t]*\\'" (or first-re ""))
|
||||
@ -315,7 +321,7 @@
|
||||
;; Parsing is not as good as for the BibTeX database stuff.
|
||||
;; The environment should be located in file FILE.
|
||||
|
||||
(let* (start end buf entries re re-list file)
|
||||
(let* (start end buf entries re re-list file default)
|
||||
(unless files
|
||||
(error "Need file name to find thebibliography environment"))
|
||||
(while (setq file (pop files))
|
||||
@ -351,10 +357,26 @@
|
||||
(unless entries
|
||||
(error "No bibitems found"))
|
||||
|
||||
(setq re-list (split-string
|
||||
(read-string "RegExp [ && RegExp...]: "
|
||||
nil 'reftex-cite-regexp-hist)
|
||||
"[ \t]*&&[ \t]*"))
|
||||
;; Read a regexp, completing on known citation keys.
|
||||
(setq default (regexp-quote (reftex-get-bibkey-default)))
|
||||
(setq re-list
|
||||
(split-string
|
||||
(completing-read
|
||||
(concat
|
||||
"Regex { && Regex...}: "
|
||||
"[" default "]: ")
|
||||
(if reftex-mode
|
||||
(if (fboundp 'LaTeX-bibitem-list)
|
||||
(LaTeX-bibitem-list)
|
||||
(cdr (assoc 'bibview-cache
|
||||
(symbol-value reftex-docstruct-symbol))))
|
||||
nil)
|
||||
nil nil nil 'reftex-cite-regexp-hist)
|
||||
"[ \t]*&&[ \t]*"))
|
||||
|
||||
(if (or (null re-list ) (equal re-list '("")))
|
||||
(setq re-list (list default)))
|
||||
|
||||
(if (string-match "\\`[ \t]*\\'" (car re-list))
|
||||
(error "Empty regular expression"))
|
||||
|
||||
@ -375,6 +397,16 @@
|
||||
|
||||
entries))
|
||||
|
||||
(defun reftex-get-bibkey-default ()
|
||||
;; Return the word before the cursor. If the cursor is in a
|
||||
;; citation macro, return the word before the macro.
|
||||
(let* ((macro (reftex-what-macro 1)))
|
||||
(save-excursion
|
||||
(if (and macro (string-match "cite" (car macro)))
|
||||
(goto-char (cdr macro)))
|
||||
(skip-chars-backward "^a-zA-Z0-9")
|
||||
(reftex-this-word))))
|
||||
|
||||
;; Parse and format individual entries
|
||||
|
||||
(defun reftex-get-bib-names (field entry)
|
||||
|
@ -2,7 +2,7 @@
|
||||
;; Copyright (c) 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
|
||||
|
||||
;; Author: Carsten Dominik <dominik@science.uva.nl>
|
||||
;; Version: 4.17
|
||||
;; Version: 4.18
|
||||
;;
|
||||
|
||||
;; This file is part of GNU Emacs.
|
||||
|
@ -2,7 +2,7 @@
|
||||
;; Copyright (c) 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
|
||||
|
||||
;; Author: Carsten Dominik <dominik@science.uva.nl>
|
||||
;; Version: 4.17
|
||||
;; Version: 4.18
|
||||
|
||||
;; This file is part of GNU Emacs.
|
||||
|
||||
|
@ -2,7 +2,7 @@
|
||||
;; Copyright (c) 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
|
||||
|
||||
;; Author: Carsten Dominik <dominik@science.uva.nl>
|
||||
;; Version: 4.17
|
||||
;; Version: 4.18
|
||||
|
||||
;; This file is part of GNU Emacs.
|
||||
|
||||
@ -299,6 +299,10 @@ Here are all local bindings.
|
||||
" R<" 'reftex-index-restriction-indicator ">"
|
||||
" -%-"))
|
||||
(setq truncate-lines t)
|
||||
(when (featurep 'xemacs)
|
||||
;; XEmacs needs the call to make-local-hook
|
||||
(make-local-hook 'post-command-hook)
|
||||
(make-local-hook 'pre-command-hook))
|
||||
(make-local-variable 'reftex-last-follow-point)
|
||||
(easy-menu-add reftex-index-menu reftex-index-map)
|
||||
(add-hook 'post-command-hook 'reftex-index-post-command-hook nil t)
|
||||
|
@ -2,7 +2,7 @@
|
||||
;; Copyright (c) 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
|
||||
|
||||
;; Author: Carsten Dominik <dominik@science.uva.nl>
|
||||
;; Version: 4.17
|
||||
;; Version: 4.18
|
||||
;;
|
||||
|
||||
;; This file is part of GNU Emacs.
|
||||
@ -335,7 +335,8 @@ of master file."
|
||||
(goto-char (point-min))
|
||||
(if (re-search-forward
|
||||
(concat
|
||||
"\\(\\`\\|[\n\r]\\)[^%]*\\\\\\("
|
||||
; "\\(\\`\\|[\n\r]\\)[^%]*\\\\\\("
|
||||
"\\(^\\)[^%]*\\\\\\("
|
||||
(mapconcat 'identity reftex-bibliography-commands "\\|")
|
||||
"\\){[ \t]*\\([^}]+\\)") nil t)
|
||||
(setq files
|
||||
|
@ -2,7 +2,7 @@
|
||||
;; Copyright (c) 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
|
||||
|
||||
;; Author: Carsten Dominik <dominik@science.uva.nl>
|
||||
;; Version: 4.17
|
||||
;; Version: 4.18
|
||||
|
||||
;; This file is part of GNU Emacs.
|
||||
|
||||
@ -646,7 +646,7 @@ When called with 2 C-u prefix args, disable magic word recognition."
|
||||
selection-buffers)
|
||||
(reftex-kill-temporary-buffers))
|
||||
;; Add the prefixes, put together the relevant information in the form
|
||||
;; (LABEL TYPEKEY SEPERATOR) and return a list of those.
|
||||
;; (LABEL TYPEKEY SEPARATOR) and return a list of those.
|
||||
(mapcar (lambda (x)
|
||||
(if (listp x)
|
||||
(list (concat prefix (car (car x)))
|
||||
|
@ -2,7 +2,7 @@
|
||||
;; Copyright (c) 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
|
||||
|
||||
;; Author: Carsten Dominik <dominik@science.uva.nl>
|
||||
;; Version: 4.17
|
||||
;; Version: 4.18
|
||||
|
||||
;; This file is part of GNU Emacs.
|
||||
|
||||
@ -49,6 +49,10 @@ During a selection process, these are the local bindings.
|
||||
|
||||
(interactive)
|
||||
(kill-all-local-variables)
|
||||
(when (featurep 'xemacs)
|
||||
;; XEmacs needs the call to make-local-hook
|
||||
(make-local-hook 'pre-command-hook)
|
||||
(make-local-hook 'post-command-hook))
|
||||
(setq major-mode 'reftex-select-label-mode
|
||||
mode-name "LSelect")
|
||||
(set (make-local-variable 'reftex-select-marked) nil)
|
||||
@ -75,6 +79,10 @@ During a selection process, these are the local bindings.
|
||||
\\{reftex-select-label-map}"
|
||||
(interactive)
|
||||
(kill-all-local-variables)
|
||||
(when (featurep 'xemacs)
|
||||
;; XEmacs needs the call to make-local-hook
|
||||
(make-local-hook 'pre-command-hook)
|
||||
(make-local-hook 'post-command-hook))
|
||||
(setq major-mode 'reftex-select-bib-mode
|
||||
mode-name "BSelect")
|
||||
(set (make-local-variable 'reftex-select-marked) nil)
|
||||
|
@ -2,7 +2,7 @@
|
||||
;; Copyright (c) 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
|
||||
|
||||
;; Author: Carsten Dominik <dominik@science.uva.nl>
|
||||
;; Version: 4.17
|
||||
;; Version: 4.18
|
||||
|
||||
;; This file is part of GNU Emacs.
|
||||
|
||||
@ -62,6 +62,10 @@ Here are all local bindings.
|
||||
" T<" 'reftex-toc-max-level-indicator ">"
|
||||
" -%-"))
|
||||
(setq truncate-lines t)
|
||||
(when (featurep 'xemacs)
|
||||
;; XEmacs needs the call to make-local-hook
|
||||
(make-local-hook 'post-command-hook)
|
||||
(make-local-hook 'pre-command-hook))
|
||||
(make-local-variable 'reftex-last-follow-point)
|
||||
(add-hook 'post-command-hook 'reftex-toc-post-command-hook nil t)
|
||||
(add-hook 'pre-command-hook 'reftex-toc-pre-command-hook nil t)
|
||||
|
@ -2,7 +2,7 @@
|
||||
;; Copyright (c) 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
|
||||
|
||||
;; Author: Carsten Dominik <dominik@science.uva.nl>
|
||||
;; Version: 4.17
|
||||
;; Version: 4.18
|
||||
|
||||
;; This file is part of GNU Emacs.
|
||||
|
||||
|
@ -2,7 +2,7 @@
|
||||
;; Copyright (c) 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
|
||||
|
||||
;; Author: Carsten Dominik <dominik@science.uva.nl>
|
||||
;; Version: 4.17
|
||||
;; Version: 4.18
|
||||
;; 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.17"
|
||||
(defconst reftex-version "RefTeX version 4.18"
|
||||
"Version string for RefTeX.")
|
||||
|
||||
(defvar reftex-mode nil
|
||||
@ -1101,7 +1101,8 @@ This enforces rescanning the buffer on next use."
|
||||
;; Calculate the regular expressions
|
||||
(let* (
|
||||
; (wbol "\\(\\`\\|[\n\r]\\)[ \t]*")
|
||||
(wbol "\\(\\`\\|[\n\r]\\)[ \t]*")
|
||||
(wbol "\\(^\\)[ \t]*") ; Need to keep the empty group because
|
||||
;;; because match number are hard coded
|
||||
(label-re "\\\\label{\\([^}]*\\)}")
|
||||
(include-re (concat wbol
|
||||
"\\\\\\("
|
||||
|
Loading…
Reference in New Issue
Block a user