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

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

[elpa] master c960de5 047/348: counsel.el (counsel-grep-or-swiper): Don'


From: Oleh Krehel
Subject: [elpa] master c960de5 047/348: counsel.el (counsel-grep-or-swiper): Don't grep on compressed files
Date: Sat, 8 Apr 2017 11:03:22 -0400 (EDT)

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

    counsel.el (counsel-grep-or-swiper): Don't grep on compressed files
    
    * counsel.el (counsel-compressed-file-regex): New defvar.
    
    Fixes #536
---
 counsel.el | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/counsel.el b/counsel.el
index d3b24b4..94cc98e 100644
--- a/counsel.el
+++ b/counsel.el
@@ -1523,6 +1523,12 @@ the command."
   :type 'integer
   :group 'ivy)
 
+(defvar counsel-compressed-file-regex
+  (progn
+    (require 'jka-compr nil t)
+    (jka-compr-build-file-regexp))
+  "Store the regex for compressed file names.")
+
 ;;;###autoload
 (defun counsel-grep-or-swiper ()
   "Call `swiper' for small buffers and `counsel-grep' for large ones."
@@ -1531,6 +1537,9 @@ the command."
            (not (buffer-narrowed-p))
            (not (ignore-errors
                   (file-remote-p (buffer-file-name))))
+           (not (string-match
+                 counsel-compressed-file-regex
+                 (buffer-file-name)))
            (> (buffer-size)
               (if (eq major-mode 'org-mode)
                   (/ counsel-grep-swiper-limit 4)



reply via email to

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