Fix regex used for searching citation keys.
authorTassilo Horn <tsdh@gnu.org>
Tue, 21 Jan 2014 08:18:30 +0000 (09:18 +0100)
committerTassilo Horn <tsdh@gnu.org>
Tue, 21 Jan 2014 08:18:30 +0000 (09:18 +0100)
* 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
lisp/textmodes/reftex-cite.el

index 1f89970..8f5ae24 100644 (file)
@@ -1,3 +1,9 @@
+2014-01-21  Tassilo Horn  <tsdh@gnu.org>
+
+       * 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  <sdl.web@gmail.com>
 
        * simple.el (read--expression): Don't enable eldoc-mode.
index 1654397..a36fa17 100644 (file)
@@ -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)))