diff options
| author | Tassilo Horn | 2015-09-21 16:09:17 +0200 |
|---|---|---|
| committer | Tassilo Horn | 2015-09-21 16:09:17 +0200 |
| commit | aeb17b60f9d41a40b1b5b9a7817d31bd0cb2c3c0 (patch) | |
| tree | 81d459a440e2c4204178d8814f79fe4af1ca4398 | |
| parent | d443345b13ccb761257878217d10d6881eabaac6 (diff) | |
| download | emacs-aeb17b60f9d41a40b1b5b9a7817d31bd0cb2c3c0.tar.gz emacs-aeb17b60f9d41a40b1b5b9a7817d31bd0cb2c3c0.zip | |
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.
| -rw-r--r-- | lisp/textmodes/reftex-cite.el | 4 |
1 files changed, 3 insertions, 1 deletions
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." | |||
| 210 | (setq first-re (car re-list) ; We'll use the first re to find things, | 210 | (setq first-re (car re-list) ; We'll use the first re to find things, |
| 211 | rest-re (cdr re-list)) ; the others to narrow down. | 211 | rest-re (cdr re-list)) ; the others to narrow down. |
| 212 | (if (string-match "\\`[ \t]*\\'" (or first-re "")) | 212 | (if (string-match "\\`[ \t]*\\'" (or first-re "")) |
| 213 | (error "Empty regular expression")) | 213 | (user-error "Empty regular expression")) |
| 214 | (if (string-match first-re "") | ||
| 215 | (user-error "Regular expression matches the empty string.")) | ||
| 214 | 216 | ||
| 215 | (save-excursion | 217 | (save-excursion |
| 216 | (save-window-excursion | 218 | (save-window-excursion |