diff options
| author | Ralf Angeli | 2010-10-16 17:08:47 +0200 |
|---|---|---|
| committer | Ralf Angeli | 2010-10-16 17:08:47 +0200 |
| commit | 99f65cface3bf5f8a8af7b9bd8a7159b5c77fad9 (patch) | |
| tree | b4a88d7109b168c65206d86bd1eb65294555178c | |
| parent | 283f7b939efc51946f8474601163c43182417a48 (diff) | |
| download | emacs-99f65cface3bf5f8a8af7b9bd8a7159b5c77fad9.tar.gz emacs-99f65cface3bf5f8a8af7b9bd8a7159b5c77fad9.zip | |
Fix searching for bibitem entries.
| -rw-r--r-- | lisp/ChangeLog | 7 | ||||
| -rw-r--r-- | lisp/textmodes/reftex-cite.el | 45 |
2 files changed, 31 insertions, 21 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 931ee696482..109b4d99f95 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,10 @@ | |||
| 1 | 2010-10-16 Ralf Angeli <angeli@caeruleus.net> | ||
| 2 | |||
| 3 | * textmodes/reftex-cite.el | ||
| 4 | (reftex-extract-bib-entries-from-thebibliography): Do not move | ||
| 5 | point when searching for \bibitem entries. Match entries with | ||
| 6 | spaces or tabs in front of arguments. | ||
| 7 | |||
| 1 | 2010-10-16 Chong Yidong <cyd@stupidchicken.com> | 8 | 2010-10-16 Chong Yidong <cyd@stupidchicken.com> |
| 2 | 9 | ||
| 3 | * cus-theme.el (customize-create-theme): Delete overlays after | 10 | * cus-theme.el (customize-create-theme): Delete overlays after |
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 @@ | |||
| 358 | (message "Scanning thebibliography environment in %s" file) | 358 | (message "Scanning thebibliography environment in %s" file) |
| 359 | 359 | ||
| 360 | (with-current-buffer buf | 360 | (with-current-buffer buf |
| 361 | (save-restriction | 361 | (save-excursion |
| 362 | (widen) | 362 | (save-restriction |
| 363 | (goto-char (point-min)) | 363 | (widen) |
| 364 | (while (re-search-forward | 364 | (goto-char (point-min)) |
| 365 | "\\(\\`\\|[\n\r]\\)[ \t]*\\\\begin{thebibliography}" nil t) | 365 | (while (re-search-forward |
| 366 | (beginning-of-line 2) | 366 | "\\(\\`\\|[\n\r]\\)[ \t]*\\\\begin{thebibliography}" nil t) |
| 367 | (setq start (point)) | 367 | (beginning-of-line 2) |
| 368 | (if (re-search-forward | 368 | (setq start (point)) |
| 369 | "\\(\\`\\|[\n\r]\\)[ \t]*\\\\end{thebibliography}" nil t) | 369 | (if (re-search-forward |
| 370 | (progn | 370 | "\\(\\`\\|[\n\r]\\)[ \t]*\\\\end{thebibliography}" nil t) |
| 371 | (beginning-of-line 1) | 371 | (progn |
| 372 | (setq end (point)))) | 372 | (beginning-of-line 1) |
| 373 | (when (and start end) | 373 | (setq end (point)))) |
| 374 | (setq entries | 374 | (when (and start end) |
| 375 | (append entries | 375 | (setq entries |
| 376 | (mapcar 'reftex-parse-bibitem | 376 | (append entries |
| 377 | (delete "" | 377 | (mapcar 'reftex-parse-bibitem |
| 378 | (split-string | 378 | (delete "" |
| 379 | (buffer-substring-no-properties start end) | 379 | (split-string |
| 380 | "[ \t\n\r]*\\\\bibitem\\(\\[[^]]*]\\)*")))))) | 380 | (buffer-substring-no-properties |
| 381 | (goto-char end))))) | 381 | start end) |
| 382 | "[ \t\n\r]*\\\\bibitem\ | ||
| 383 | \\(\\[[^]]*]\\)*\[ \t]*")))))) | ||
| 384 | (goto-char end)))))) | ||
| 382 | (unless entries | 385 | (unless entries |
| 383 | (error "No bibitems found")) | 386 | (error "No bibitems found")) |
| 384 | 387 | ||