emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] master aeb17b6: Signal error on invalid regexp


From: Tassilo Horn
Subject: [Emacs-diffs] master aeb17b6: Signal error on invalid regexp
Date: Mon, 21 Sep 2015 14:10:23 +0000

branch: master
commit aeb17b60f9d41a40b1b5b9a7817d31bd0cb2c3c0
Author: Tassilo Horn <address@hidden>
Commit: Tassilo Horn <address@hidden>

    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 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/lisp/textmodes/reftex-cite.el b/lisp/textmodes/reftex-cite.el
index 173c8a8..8f3f2cc 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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]