emacs-elpa-diffs
[Top][All Lists]
Advanced

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

[elpa] master de5833e 51/57: Don't error on incomplete bad regexp in cou


From: Oleh Krehel
Subject: [elpa] master de5833e 51/57: Don't error on incomplete bad regexp in counsel-git-grep
Date: Tue, 19 May 2015 14:21:40 +0000

branch: master
commit de5833ee3de2e6a15ec0ac8cd887fc7bef97cbf3
Author: Oleh Krehel <address@hidden>
Commit: Oleh Krehel <address@hidden>

    Don't error on incomplete bad regexp in counsel-git-grep
    
    counsel.el (counsel-git-grep-matcher): Update.
---
 counsel.el |   27 ++++++++++++++-------------
 1 files changed, 14 insertions(+), 13 deletions(-)

diff --git a/counsel.el b/counsel.el
index ea5496e..194322f 100644
--- a/counsel.el
+++ b/counsel.el
@@ -250,19 +250,20 @@
               :unwind #'swiper--cleanup)))
 
 (defun counsel-git-grep-matcher (x)
-  (when (string-match "^[^:]+:[^:]+:" x)
-    (setq x (substring x (match-end 0)))
-    (if (stringp ivy--old-re)
-        (string-match ivy--old-re x)
-      (let ((res t))
-        (dolist (re ivy--old-re)
-          (setq res
-                (and res
-                     (ignore-errors
-                       (if (cdr re)
-                           (string-match (car re) x)
-                         (not (string-match (car re) x)))))))
-        res))))
+  (ignore-errors
+    (when (string-match "^[^:]+:[^:]+:" x)
+      (setq x (substring x (match-end 0)))
+      (if (stringp ivy--old-re)
+          (string-match ivy--old-re x)
+        (let ((res t))
+          (dolist (re ivy--old-re)
+            (setq res
+                  (and res
+                       (ignore-errors
+                         (if (cdr re)
+                             (string-match (car re) x)
+                           (not (string-match (car re) x)))))))
+          res)))))
 
 (defun counsel-locate-function (str &rest _u)
   (if (< (length str) 3)



reply via email to

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