X-Git-Url: https://code.delx.au/gnu-emacs/blobdiff_plain/565c0ca57e89ab1a1b4c378c615a998eb8fc0f99..73b0cd50031a714347109169ceb8bacae338612a:/lisp/textmodes/reftex-cite.el diff --git a/lisp/textmodes/reftex-cite.el b/lisp/textmodes/reftex-cite.el index 79797b4791..78d80da41a 100644 --- a/lisp/textmodes/reftex-cite.el +++ b/lisp/textmodes/reftex-cite.el @@ -1,7 +1,6 @@ ;;; reftex-cite.el --- creating citations with RefTeX -;; Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, -;; 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc. +;; Copyright (C) 1997-2011 Free Software Foundation, Inc. ;; Author: Carsten Dominik ;; Maintainer: auctex-devel@gnu.org @@ -358,27 +357,30 @@ (message "Scanning thebibliography environment in %s" file) (with-current-buffer buf - (save-restriction - (widen) - (goto-char (point-min)) - (while (re-search-forward - "\\(\\`\\|[\n\r]\\)[ \t]*\\\\begin{thebibliography}" nil t) - (beginning-of-line 2) - (setq start (point)) - (if (re-search-forward - "\\(\\`\\|[\n\r]\\)[ \t]*\\\\end{thebibliography}" nil t) - (progn - (beginning-of-line 1) - (setq end (point)))) - (when (and start end) - (setq entries - (append entries - (mapcar 'reftex-parse-bibitem - (delete "" - (split-string - (buffer-substring-no-properties start end) - "[ \t\n\r]*\\\\bibitem\\(\\[[^]]*]\\)*")))))) - (goto-char end))))) + (save-excursion + (save-restriction + (widen) + (goto-char (point-min)) + (while (re-search-forward + "\\(\\`\\|[\n\r]\\)[ \t]*\\\\begin{thebibliography}" nil t) + (beginning-of-line 2) + (setq start (point)) + (if (re-search-forward + "\\(\\`\\|[\n\r]\\)[ \t]*\\\\end{thebibliography}" nil t) + (progn + (beginning-of-line 1) + (setq end (point)))) + (when (and start end) + (setq entries + (append entries + (mapcar 'reftex-parse-bibitem + (delete "" + (split-string + (buffer-substring-no-properties + start end) + "[ \t\n\r]*\\\\bibitem[ \t]*\ +\\(\\[[^]]*]\\)*\[ \t]*")))))) + (goto-char end)))))) (unless entries (error "No bibitems found")) @@ -1144,9 +1146,8 @@ The sequence in the new file is the same as it was in the old database." (save-restriction (widen) (goto-char (point-min)) - (while (re-search-forward - "^[ \t]*@[a-zA-Z]+[ \t]*{\\([^ \t\r\n]+\\)," - nil t) + (while (re-search-forward "^[ \t]*@\\(?:\\w\\|\\s_\\)+[ \t\n\r]*\ +\[{(][ \t\n\r]*\\([^ \t\n\r,]+\\)" nil t) (setq key (match-string 1) beg (match-beginning 0) end (progn @@ -1172,5 +1173,4 @@ The sequence in the new file is the same as it was in the old database." (length entries)))) -;; arch-tag: d53d0a5a-ab32-4b52-a846-2a7c3527cd89 ;;; reftex-cite.el ends here