summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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))