diff options
Diffstat (limited to 'lisp')
-rw-r--r-- | lisp/init-buffile.el | 19 |
1 files changed, 5 insertions, 14 deletions
diff --git a/lisp/init-buffile.el b/lisp/init-buffile.el index 33fa74d..c26c323 100644 --- a/lisp/init-buffile.el +++ b/lisp/init-buffile.el @@ -71,21 +71,12 @@ The search is limited to file names matching shell pattern FILES. FILES may use abbreviations defined in `grep-files-aliases', e.g. entering `ch' is equivalent to `*.[ch]'.") -;; http://stackoverflow.com/questions/16122801/ -;; remove-header-information-from-rgrep-grep-output-in-emacs -(defun hide-grep-header () +(defun km/grep-hide-header () (save-excursion - (with-current-buffer grep-last-buffer - (goto-line 5) - (narrow-to-region (point) (point-max))))) - -(after 'grep - (defadvice grep (after hide-grep-header activate) (hide-grep-header)) - (defadvice rgrep (after hide-grep-header activate) (hide-grep-header)) - (defadvice lgrep (after hide-grep-hxoeader activate) (hide-grep-header)) - (defadvice grep-find (after hide-grep-header activate) (hide-grep-header))) -(after 'vc-git - (defadvice vc-git-grep (after hide-grep-header activate) (hide-grep-header))) + (goto-char (point-min)) + (forward-line 4) + (narrow-to-region (point) (point-max)))) +(add-hook 'grep-setup-hook 'km/grep-hide-header) (key-chord-define-global ",z" 'rgrep) |