Browse Source

update my-grep

pull/1/head
10sr 11 years ago
parent
commit
79bcb1d2ea
1 changed files with 14 additions and 16 deletions
  1. +14
    -16
      emacs.el

+ 14
- 16
emacs.el View File

@@ -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."


Loading…
Cancel
Save