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.
This commit is contained in:
Tassilo Horn
2015-09-21 16:09:17 +02:00
parent d443345b13
commit aeb17b60f9

View 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