summaryrefslogtreecommitdiff
path: root/init
diff options
context:
space:
mode:
authorKyle Meyer <meyerkya@gmail.com>2013-07-14 22:06:45 -0400
committerKyle Meyer <meyerkya@gmail.com>2013-07-14 22:07:54 -0400
commit3cf4269136a316c10aa018d333d889b7e837fac6 (patch)
tree6850adadafe394966b6b6caf0439e25119a3de5f /init
parent5c7f406af3ed114c45f8f664ad8a02986581786b (diff)
downloademacs.d-3cf4269136a316c10aa018d333d889b7e837fac6.tar.gz
hide grep header
Diffstat (limited to 'init')
-rw-r--r--init/km-grep.el12
1 files changed, 12 insertions, 0 deletions
diff --git a/init/km-grep.el b/init/km-grep.el
new file mode 100644
index 0000000..9eea449
--- /dev/null
+++ b/init/km-grep.el
@@ -0,0 +1,12 @@
+;; http://stackoverflow.com/questions/16122801/
+;; remove-header-information-from-rgrep-grep-output-in-emacs
+(defun hide-grep-header ()
+ (save-excursion
+ (with-current-buffer grep-last-buffer
+ (goto-line 5)
+ (narrow-to-region (point) (point-max)))))
+
+(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-header activate) (hide-grep-header))
+(defadvice grep-find (after hide-grep-header activate) (hide-grep-header))