summaryrefslogtreecommitdiff
path: root/lisp/textmodes/reftex-cite.el
diff options
context:
space:
mode:
authorRalf Angeli <angeli@caeruleus.net>2010-10-16 17:08:47 +0200
committerRalf Angeli <angeli@caeruleus.net>2010-10-16 17:08:47 +0200
commit99f65cface3bf5f8a8af7b9bd8a7159b5c77fad9 (patch)
treeb4a88d7109b168c65206d86bd1eb65294555178c /lisp/textmodes/reftex-cite.el
parent283f7b939efc51946f8474601163c43182417a48 (diff)
downloademacs-99f65cface3bf5f8a8af7b9bd8a7159b5c77fad9.tar.gz
Fix searching for bibitem entries.
Diffstat (limited to 'lisp/textmodes/reftex-cite.el')
-rw-r--r--lisp/textmodes/reftex-cite.el45
1 files changed, 24 insertions, 21 deletions
diff --git a/lisp/textmodes/reftex-cite.el b/lisp/textmodes/reftex-cite.el
index 79797b4791b..5edd9f24122 100644
--- a/lisp/textmodes/reftex-cite.el
+++ b/lisp/textmodes/reftex-cite.el
@@ -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"))