]> code.delx.au - gnu-emacs/commitdiff
Signal error on invalid regexp
authorTassilo Horn <tsdh@gnu.org>
Mon, 21 Sep 2015 14:09:17 +0000 (16:09 +0200)
committerTassilo Horn <tsdh@gnu.org>
Mon, 21 Sep 2015 14:09:17 +0000 (16:09 +0200)
* lisp/textmodes/reftex-cite.el (reftex-extract-bib-entries): Signal an
error when the user tries searching with a regexp matching the empty
string.

lisp/textmodes/reftex-cite.el

index 173c8a8d11de6d4dff9fa53ac851857adcbf2a48..8f3f2ccd0615139a2a182982a56b33edffa41011 100644 (file)
@@ -210,7 +210,9 @@ Return list with entries."
     (setq first-re (car re-list)    ; We'll use the first re to find things,
           rest-re  (cdr re-list))   ; the others to narrow down.
     (if (string-match "\\`[ \t]*\\'" (or first-re ""))
-        (error "Empty regular expression"))
+        (user-error "Empty regular expression"))
+    (if (string-match first-re "")
+        (user-error "Regular expression matches the empty string."))
 
     (save-excursion
       (save-window-excursion