浏览代码

add my-grep

pull/1/head
10sr 11 年前
父节点
当前提交
a2fc457a73
共有 1 个文件被更改,包括 31 次插入5 次删除
  1. +31
    -5
      emacs.el

+ 31
- 5
emacs.el 查看文件

@@ -659,6 +659,9 @@ found, otherwise returns nil."
(when (require 'flycheck nil t)
(add-hook 'after-init-hook #'global-flycheck-mode))

(defun my-install-packages ()
nil)

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; window

@@ -722,11 +725,6 @@ found, otherwise returns nil."
(fset 'makefile-warn-suspicious-lines 'ignore)
))

(defun make ()
"Run \"make -k\" in current directory."
(interactive)
(compile "make -k"))

(add-hook 'verilog-mode-hook
(lambda ()
(define-key verilog-mode-map ";" 'self-insert-command)))
@@ -1786,6 +1784,34 @@ if arg given, use that eshell buffer, otherwise make new eshell buffer."
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; misc funcs

(defun my-grep ()
"Use git-grep if avaliable.."
(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)
(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)))

(defun make ()
"Run \"make -k\" in current directory."
(interactive)
(compile "make -k"))

(defvar sed-in-place-history nil
"History of `sed-in-place'")



正在加载...
取消
保存