[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Nested grep

From: address@hidden
Subject: Re: Nested grep
Date: 14 Nov 2006 09:32:44 -0800
User-agent: G2/1.0

address@hidden írta:
> Markus Triska írta:
> > "address@hidden" <address@hidden> writes:
> >
> > > Will I also be able to use next-error on the results of the first grep
> > > from the match I left off after I'm done with the second grep?
> >
> > Yes.
> It really does work. Awesome! :)

I quickly made some convenience bindings for the grep buffer to support
this. Hey, Drew! Don't you want to add something like this to
grep-plus? It would be a good fit.

(require 'compile)
(require 'cl)

(defvar my-grep-stack nil)

(define-key compilation-minor-mode-map "s" 'my-grep-stack-buffer-push)
(define-key compilation-minor-mode-map "q" 'my-grep-stack-buffer-pop)

(defun my-grep-stack-buffer-push ()
  (push (current-buffer) my-grep-stack)
  (message "Grep buffer pushed to stack."))

(defun my-grep-stack-buffer-pop ()
  (if my-grep-stack
      (let ((buffer (pop my-grep-stack)))
        (switch-to-buffer buffer)
        (message "Grep buffer popped from stack."))))

reply via email to

[Prev in Thread] Current Thread [Next in Thread]