From aeb17b60f9d41a40b1b5b9a7817d31bd0cb2c3c0 Mon Sep 17 00:00:00 2001 From: Tassilo Horn Date: Mon, 21 Sep 2015 16:09:17 +0200 Subject: [PATCH] Signal error on invalid regexp * 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 | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lisp/textmodes/reftex-cite.el b/lisp/textmodes/reftex-cite.el index 173c8a8d11d..8f3f2ccd061 100644 --- a/lisp/textmodes/reftex-cite.el +++ b/lisp/textmodes/reftex-cite.el @@ -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 -- 2.39.2