(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))))