From 79bcb1d2eabe76f790ffa5093ddd2238fbbf1a0a Mon Sep 17 00:00:00 2001 From: 10sr <8slashes+git@gmail.com> Date: Fri, 3 May 2013 18:13:57 +0900 Subject: [PATCH] update my-grep --- emacs.el | 30 ++++++++++++++---------------- 1 file changed, 14 insertions(+), 16 deletions(-) diff --git a/emacs.el b/emacs.el index aadedf3..8c1063e 100644 --- a/emacs.el +++ b/emacs.el @@ -1789,23 +1789,21 @@ if arg given, use that eshell buffer, otherwise make new eshell buffer." (interactive) (require 'grep) (let ((--grep-command-bak grep-command) - (--grep-use-null-device-bak grep-use-null-device) - (grep-command (if (eq 0 - (shell-command "git rev-parse --git-dir")) - "git --no-pager grep -nH -e " - grep-command - ))) - (grep-apply-setting 'grep-command - grep-command) - (grep-apply-setting 'grep-use-null-device - nil) + (--grep-use-null-device-bak grep-use-null-device)) (if (called-interactively-p 'any) - (call-interactively 'grep) - (message "my-grep only allow interactive call.")) - (grep-apply-setting 'grep-command - --grep-command-bak) - (grep-apply-setting 'grep-use-null-device - --grep-use-null-device-bak))) + (progn + (when (eq 0 + (shell-command "git rev-parse --git-dir")) + (grep-apply-setting 'grep-command + "git --no-pager grep -nH -e ") + (grep-apply-setting 'grep-use-null-device + nil)) + (call-interactively 'grep) + (grep-apply-setting 'grep-command + --grep-command-bak) + (grep-apply-setting 'grep-use-null-device + --grep-use-null-device-bak)) + (message "my-grep only allow interactive call.")))) (defun make () "Run \"make -k\" in current directory."