changeset 473:f86c1048a46d

emacs: hack up my textmate.el some more to add searching config This gives up and use a bonus grep for extension filtering because I can't quite make the rg flags work like the grep one, and this gets the job done with minimal fuss.
author Augie Fackler <raf@durin42.com>
date Fri, 01 Feb 2019 16:25:05 -0500
parents 79110d94a0c2
children e71b87fa8ea1
files .elisp/textmate.el
diffstat 1 files changed, 5 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/.elisp/textmate.el
+++ b/.elisp/textmate.el
@@ -156,6 +156,8 @@ completing filenames and symbols (`ido' 
   "string to give to grep -V to exclude some VCS paths from being grepped."
   )
 
+(defvar *textmate-grep-command* "egrep --color=never -n" "Base grep command.")
+
 (defvar *textmate-find-in-project-default* nil)
 
 (defvar *textmate-find-in-project-type-default* nil)
@@ -280,7 +282,7 @@ in a grep-mode buffer."
                                   ": "
                                   ) nil nil *textmate-find-in-project-type-default*)))
     (setq *textmate-find-in-project-type-default* pat)
-    (textmate-find-in-project (concat "*." pat))))
+    (textmate-find-in-project (concat ".*\\." pat "$"))))
 
 (defun textmate-start-compile-in-root (command &optional mode
                                                          name-function
@@ -316,7 +318,6 @@ specific type of file."
                          (if (and default (> (length default) 0))
                              (format "[\"%s\"]" default)) ": ")
                  nil 'textmate-find-in-project-history default))
-          (incpat (if pattern pattern "*"))
           (type (textmate-project-root-type (textmate-project-root)))
           (command
            (cond ((not (string= type "unknown"))
@@ -326,8 +327,8 @@ specific type of file."
                                (concat " | egrep --color=never -v "
                                        (shell-quote-argument *textmate-vcs-exclude*))
                              "")
-                           " | xargs egrep --color=never -n "
-                           (if pattern (concat " --include='" pattern "' ") "")
+                           (if pattern (concat " | egrep '" pattern "' "))
+                           " | xargs " *textmate-grep-command*  " "
                            " -- "
                            (shell-quote-argument re)))
                   (t (concat "egrep --color=never -nR --exclude='"