]> code.delx.au - gnu-emacs-elpa/commitdiff
gist-git-grep mods - i think i've been using this.
authorKen Manheimer <ken.manheimer@gmail.com>
Mon, 14 Dec 2015 08:05:47 +0000 (03:05 -0500)
committerKen Manheimer <ken.manheimer@gmail.com>
Mon, 14 Dec 2015 08:05:47 +0000 (03:05 -0500)
gist-git-grep.el

index a8550ce44cc7d704df21e1a00e507cc0dcbf9eee..34067f1bacccb6f09869a43b9813f1765f97871a 100644 (file)
        (when (not root)
          (setq root git-grep-default-work-tree)
          (message "git-grep: %s doesn't look like a git working tree; searching from %s instead" default-directory root))
-       (list (read-shell-command "Run git-grep (like this): "
-                                 (format (concat
-                                          "cd %s && "
-                                          "%s -e %s")
-                                         root
-                                         git-grep-switches
-                                         (let ((thing (and
-
-                                        ; don't snarf stuff from the
-                                        ; buffer if we're not looking
-                                        ; at a file.  Perhaps we
-                                        ; should also check to see if
-                                        ; the file is part of a git
-                                        ; repo.
-                                                       buffer-file-name
-                                                       (thing-at-point 'symbol))))
-                                           (or (and thing (progn
-                                                            (set-text-properties 0 (length thing) nil thing)
-                                                            (shell-quote-argument (regexp-quote thing))))
-                                               "")))
+       (list (read-shell-command
+              "Run git-grep (like this): "
+              (format (concat
+                       "cd %s && "
+                       "%s -e %s")
+                      root
+                      git-grep-switches
+                      (let ((thing (and
+                                    ;; Don't snarf stuff from the buffer if
+                                    ;; we're not looking at a file.
+                                    ;; Perhaps we should also check to see
+                                    ;; if the file is part of a git repo.
+                                    buffer-file-name
+                                    (thing-at-point
+                                     'symbol))))
+                        (or (and thing (progn
+                                         (set-text-properties 0
+                                                              (length thing)
+                                                              nil thing)
+                                         (shell-quote-argument
+                                          (regexp-quote thing))))
+                            "")))
                                  'git-grep-history))))
     (let ((grep-use-null-device nil))
       (grep command-args))))