From e7d807cae81ea3ea843898f9bce28ef2b9debafe Mon Sep 17 00:00:00 2001 From: Tassilo Horn Date: Tue, 21 Jan 2014 09:18:30 +0100 Subject: [PATCH] Fix regex used for searching citation keys. * lisp/textmodes/reftex-cite.el (reftex-all-used-citation-keys): Fix regex used for scanning for citation keys which failed for citations with optional arguments. --- lisp/ChangeLog | 6 ++++++ lisp/textmodes/reftex-cite.el | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 1f899700d46..8f5ae243eeb 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,9 @@ +2014-01-21 Tassilo Horn + + * textmodes/reftex-cite.el (reftex-all-used-citation-keys): Fix + regex used for scanning for citation keys which failed for + citations with optional arguments. + 2014-01-21 Leo Liu * simple.el (read--expression): Don't enable eldoc-mode. diff --git a/lisp/textmodes/reftex-cite.el b/lisp/textmodes/reftex-cite.el index 1654397dc67..a36fa17fca5 100644 --- a/lisp/textmodes/reftex-cite.el +++ b/lisp/textmodes/reftex-cite.el @@ -1130,7 +1130,7 @@ recommended for follow mode. It works OK for individual lookups." (save-restriction (widen) (goto-char (point-min)) - (while (re-search-forward "\\(?:^\\|\\=\\)[^%\n\r]*?\\\\\\(bibentry\\|[a-zA-Z]*cite[a-zA-Z]*\\)\\(\\[[^\\]]*\\]\\)?{\\([^}]+\\)}" nil t) + (while (re-search-forward "\\(?:^\\|\\=\\)[^%\n\r]*?\\\\\\(bibentry\\|[a-zA-Z]*cite[a-zA-Z]*\\)\\(\\[[^]]*\\]\\)?{\\([^}]+\\)}" nil t) (setq kk (match-string-no-properties 3)) (while (string-match "%.*\n?" kk) (setq kk (replace-match "" t t kk))) -- 2.39.2