Support for bibentry.
(reftex-compile-variables): Fixed problem with end of section-re.
* texmodes/reftex-dcr.el (reftex-view-crossref,
reftex-view-crossref-from-bibtex): Deal with changed
`reftex-find-citation-regexp-format'.
(reftex-view-regexp-match, reftex-view-crossref-from-bibtex):
Replaced `remprop' with `put'.
(reftex-view-crossref, reftex-view-crossref-when-idle): Support
for bibentry.
* textmodes/reftex-vars.el (reftex-cite-format-builtin): New entry for
bibentry package.
* textmodes/reftex-parse.el (reftex-locate-bibliography-files): Regexp also
matches "\nobibliography".
* textmodes/reftex-global.el (reftex-renumber-simple-labels): Call
`reftex-ensure-write-access' before doing anything.
(reftex-ensure-write-access): New function.
;; Copyright (c) 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
;; Author: Carsten Dominik <dominik@strw.LeidenUniv.nl>
-;; Version: 4.11
+;; Version: 4.14
;;
;; This file is part of GNU Emacs.
;; Copyright (c) 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
;; Author: Carsten Dominik <dominik@strw.LeidenUniv.nl>
-;; Version: 4.11
+;; Version: 4.14
;;
;; This file is part of GNU Emacs.
;; Copyright (c) 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
;; Author: Carsten Dominik <dominik@strw.LeidenUniv.nl>
-;; Version: 4.11
+;; Version: 4.14
;;
;; This file is part of GNU Emacs.
(setq reftex-call-back-to-this-buffer (current-buffer))
(cond
- ((string-match "\\`\\\\cite\\|cite\\*?\\'" macro)
+ ((string-match "\\`\\\\cite\\|cite\\*?\\'\\|bibentry" 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)
(reftex-access-scan-info arg)
(setq dw (reftex-view-regexp-match
(format reftex-find-citation-regexp-format (regexp-quote key))
- 3 nil nil)))
+ 4 nil nil)))
((member macro reftex-macros-with-index)
(reftex-access-scan-info arg)
(setq dw (reftex-view-regexp-match
;; FIXME: Can fail with backslash in comment
(save-excursion
(search-backward "\\" nil t)
- (looking-at "\\\\[a-zA-Z]*\\(cite\\|ref\\)"))
+ (looking-at "\\\\[a-zA-Z]*\\(cite\\|ref\\|bibentry\\)"))
(condition-case nil
(let ((current-prefix-arg nil))
(interactive "P")
(when arg
;; Break connection to reference buffer
- (remprop 'reftex-bibtex-view-cite-locations :ref-buffer))
+ (put 'reftex-bibtex-view-cite-locations :ref-buffer nil))
(let ((ref-buffer (get 'reftex-bibtex-view-cite-locations :ref-buffer)))
;; Establish connection to reference buffer
(unless ref-buffer
(reftex-view-regexp-match
(format reftex-find-citation-regexp-format
(regexp-quote (match-string 1)))
- 3 arg ref-buffer))
+ 4 arg ref-buffer))
(error "Cannot find citation key in BibTeX entry"))))
(defun reftex-view-regexp-match (re &optional highlight-group new ref-buffer)
(match-end highlight-group))
(add-hook 'pre-command-hook 'reftex-highlight-shall-die)
(setq pop-window (selected-window)))
- (remprop 'reftex-view-regexp-match :props)
+ (put 'reftex-view-regexp-match :props nil)
(or cont (set-window-configuration window-conf)))
(select-window current-window)
(if match
;; Copyright (c) 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
;; Author: Carsten Dominik <dominik@strw.LeidenUniv.nl>
-;; Version: 4.11
+;; Version: 4.14
;;
;; This file is part of GNU Emacs.
(unless changed-sequence
(error "Simple labels are already in correct sequence"))
+ (reftex-ensure-write-access (reftex-all-document-files))
+
;; Save all document buffers before this operation
(reftex-save-all-document-buffers)
(set-buffer buffer)
(save-buffer))))))
+(defun reftex-ensure-write-access (files)
+ "Make sure we have write access to all files in FILES.
+Also checks if buffers visiting the files are in read-only mode."
+ (let (file buf)
+ (while (setq file (pop files))
+ (unless (file-exists-p file)
+ (ding)
+ (or (y-or-n-p (format "No such file %s. Continue? " file))
+ (error "Abort")))
+ (unless (file-writable-p file)
+ (ding)
+ (or (y-or-n-p (format "No write access to %s. Continue? " file))
+ (error "Abort")))
+ (when (and (setq buf (reftex-get-buffer-visiting file))
+ (save-excursion
+ (set-buffer buf)
+ buffer-read-only))
+ (ding)
+ (or (y-or-n-p (format "Buffer %s is read-only. Continue? "
+ (buffer-name buf)))
+ (error "Abort"))))))
;;; reftex-global.el ends here
;; Copyright (c) 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
;; Author: Carsten Dominik <dominik@strw.LeidenUniv.nl>
-;; Version: 4.11
+;; Version: 4.14
;;
;; This file is part of GNU Emacs.
;; Copyright (c) 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
;; Author: Carsten Dominik <dominik@strw.LeidenUniv.nl>
-;; Version: 4.11
+;; Version: 4.14
;;
;; This file is part of GNU Emacs.
(save-excursion
(goto-char (point-min))
(if (re-search-forward
- "\\(\\`\\|[\n\r]\\)[ \t]*\\\\bibliography{[ \t]*\\([^}]+\\)" nil t)
+ "\\(\\`\\|[\n\r]\\)[ \t]*\\\\\\(no\\)?bibliography{[ \t]*\\([^}]+\\)" nil t)
(setq files
- (split-string (reftex-match-string 2)
+ (split-string (reftex-match-string 3)
"[ \t\n\r]*,[ \t\n\r]*")))))
(when files
(setq files
;; Copyright (c) 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
;; Author: Carsten Dominik <dominik@strw.LeidenUniv.nl>
-;; Version: 4.11
+;; Version: 4.14
;;
;; This file is part of GNU Emacs.
;; Copyright (c) 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
;; Author: Carsten Dominik <dominik@strw.LeidenUniv.nl>
-;; Version: 4.11
+;; Version: 4.14
;;
;; This file is part of GNU Emacs.
;; Copyright (c) 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
;; Author: Carsten Dominik <dominik@strw.LeidenUniv.nl>
-;; Version: 4.11
+;; Version: 4.14
;;
;; This file is part of GNU Emacs.
;; Copyright (c) 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
;; Author: Carsten Dominik <dominik@strw.LeidenUniv.nl>
-;; Version: 4.11
+;; Version: 4.14
;;
;; This file is part of GNU Emacs.
(?a . "\\citeauthor{%l}")
(?A . "\\citeauthor*{%l}")
(?y . "\\citeyear{%l}")))
+ (bibentry "The Bibentry package"
+ "\\bibentry{%l}")
(harvard "The Harvard package"
((?\C-m . "\\cite{%l}")
(?p . "\\cite{%l}")
;; Copyright (c) 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
;; Author: Carsten Dominik <dominik@strw.LeidenUniv.nl>
-;; Version: 4.11
+;; Version: 4.14
;; Keywords: tex
;; This file is part of GNU Emacs.
;;; Define the formal stuff for a minor mode named RefTeX.
;;;
-(defconst reftex-version "RefTeX version 4.11"
+(defconst reftex-version "RefTeX version 4.14"
"Version string for RefTeX.")
(defvar reftex-mode nil
(defvar reftex-everything-regexp-no-index nil)
(defvar reftex-index-re nil)
(defvar reftex-find-citation-regexp-format
- "\\\\[a-zA-Z]*cite[*a-zA-Z]*\\*?\\(\\[[^]]*\\]\\|{[^}]*}\\)*{\\([^}]*,\\)?\\(%s\\)[},]")
+ "\\\\\\([a-zA-Z]*cite[*a-zA-Z]*\\*?\\|bibentry\\)\\(\\[[^]]*\\]\\|{[^}]*}\\)*{\\([^}]*,\\)?\\(%s\\)[},]")
(defvar reftex-find-reference-format
"\\\\\\(ref[a-zA-Z]*\\|[a-zA-Z]*ref\\(range\\)?\\)\\*?\\(\\[[^]]*\\]\\|{[^}]*}\\)*{\\(%s\\)}")
(defvar reftex-macros-with-labels nil)
(concat wbol "\\\\\\("
(mapconcat (lambda (x) (regexp-quote (car x)))
reftex-section-levels-all "\\|")
- "\\)\\*?\\(\\[[^]]*\\]\\)?{?"))
+ "\\)\\*?\\(\\[[^]]*\\]\\)?[[{ \t\r\n]"))
(appendix-re (concat wbol "\\(\\\\appendix\\)"))
(macro-re
(if macros-with-labels
;;;
;;; BibTeX citations.
+(autoload 'reftex-citep "reftex-cite")
+(autoload 'reftex-citet "reftex-cite")
(autoload 'reftex-make-cite-echo-string "reftex-cite")
(autoload 'reftex-get-bibfile-list "reftex-cite")
(autoload 'reftex-pop-to-bibtex-entry "reftex-cite")