Commit 99f65cfa authored by Ralf Angeli's avatar Ralf Angeli
Browse files

Fix searching for bibitem entries.

parent 283f7b93
2010-10-16 Ralf Angeli <angeli@caeruleus.net>
* textmodes/reftex-cite.el
(reftex-extract-bib-entries-from-thebibliography): Do not move
point when searching for \bibitem entries. Match entries with
spaces or tabs in front of arguments.
2010-10-16 Chong Yidong <cyd@stupidchicken.com> 2010-10-16 Chong Yidong <cyd@stupidchicken.com>
   
* cus-theme.el (customize-create-theme): Delete overlays after * cus-theme.el (customize-create-theme): Delete overlays after
......
...@@ -358,27 +358,30 @@ ...@@ -358,27 +358,30 @@
(message "Scanning thebibliography environment in %s" file) (message "Scanning thebibliography environment in %s" file)
(with-current-buffer buf (with-current-buffer buf
(save-restriction (save-excursion
(widen) (save-restriction
(goto-char (point-min)) (widen)
(while (re-search-forward (goto-char (point-min))
"\\(\\`\\|[\n\r]\\)[ \t]*\\\\begin{thebibliography}" nil t) (while (re-search-forward
(beginning-of-line 2) "\\(\\`\\|[\n\r]\\)[ \t]*\\\\begin{thebibliography}" nil t)
(setq start (point)) (beginning-of-line 2)
(if (re-search-forward (setq start (point))
"\\(\\`\\|[\n\r]\\)[ \t]*\\\\end{thebibliography}" nil t) (if (re-search-forward
(progn "\\(\\`\\|[\n\r]\\)[ \t]*\\\\end{thebibliography}" nil t)
(beginning-of-line 1) (progn
(setq end (point)))) (beginning-of-line 1)
(when (and start end) (setq end (point))))
(setq entries (when (and start end)
(append entries (setq entries
(mapcar 'reftex-parse-bibitem (append entries
(delete "" (mapcar 'reftex-parse-bibitem
(split-string (delete ""
(buffer-substring-no-properties start end) (split-string
"[ \t\n\r]*\\\\bibitem\\(\\[[^]]*]\\)*")))))) (buffer-substring-no-properties
(goto-char end))))) start end)
"[ \t\n\r]*\\\\bibitem\
\\(\\[[^]]*]\\)*\[ \t]*"))))))
(goto-char end))))))
(unless entries (unless entries
(error "No bibitems found")) (error "No bibitems found"))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment