Skip to content

Instantly share code, notes, and snippets.

@TauPan
Created January 28, 2013 12:09
Show Gist options
  • Save TauPan/4655015 to your computer and use it in GitHub Desktop.
Save TauPan/4655015 to your computer and use it in GitHub Desktop.
discipline M-x grep + git-grep
;; grep-mode is stupid and does its parsing too early
(pushnew (lambda (buffer string)
(when (eq major-mode 'grep-mode)
(grep-mode)))
compilation-finish-functions)
(defun git-grep ()
(interactive)
(require 'grep)
(let ((grep-command "git --no-pager grep -nH -e ")
(grep-use-null-device nil))
(grep-apply-setting 'grep-command grep-command)
(grep-apply-setting 'grep-use-null-device grep-use-null-device )
(call-interactively #'grep))
(grep-apply-setting 'grep-command grep-command)
(grep-apply-setting 'grep-use-null-device grep-use-null-device))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment