Mercurial > emacs
diff lisp/textmodes/reftex-cite.el @ 111015:2ab042032557
Fix searching for bibitem entries.
author | Ralf Angeli <angeli@caeruleus.net> |
---|---|
date | Sat, 16 Oct 2010 17:08:47 +0200 |
parents | 280c8ae2476d |
children | 898b96cf89b3 |
line wrap: on
line diff
--- a/lisp/textmodes/reftex-cite.el Sat Oct 16 01:55:08 2010 +0000 +++ b/lisp/textmodes/reftex-cite.el Sat Oct 16 17:08:47 2010 +0200 @@ -358,27 +358,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]*")))))) + (goto-char end)))))) (unless entries (error "No bibitems found"))