unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Antony <spam+lisp_dot_linux@gmail.com>
To: help-gnu-emacs@gnu.org
Subject: Re: grep and sort
Date: Mon, 16 Aug 2010 02:22:20 -0700	[thread overview]
Message-ID: <i4b00d$4j0$1@speranza.aioe.org> (raw)
In-Reply-To: i48tl3$nn2$1@speranza.aioe.org

On 8/15/2010 7:29 AM, Antony wrote:
> Hi
>
> I'd like to find and sort all lines that contain 'TODO:'
> Sorting needs to be based on content and ignore filename
>
> rgrep works except for the sorting part
> The results should be in a grep like buffer so I can click on them
>
> If I can get some basic elisp code for this, that would be nice.
> I don't know how to modify the regrep command.
>
Let me try rephrasing

I'd like something like

(defun aas-show-todo ()
   (interactive)
   (grep  "-nH -r -i -e 'TODO: ' ~/git/src | sort -t : -k 2"))


then do
M-x aas-show-todo

and have it show me matching lines sorted appropriately in a grep buffer 
such that clicking on them takes me to the appropriate file/linenumber

The above code does not work, but hopefully makes my intention more clear

I looked at
http://git.savannah.gnu.org/cgit/emacs.git/tree/lisp/progmodes/grep.el
Couldn't find anything to help.


-Antony


  parent reply	other threads:[~2010-08-16  9:22 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-08-15 14:29 grep and sort Antony
2010-08-15 14:58 ` David Kastrup
2010-08-16  9:22 ` Antony [this message]
     [not found]   ` <i4b4o3$e53$1@speranza.aioe.org>
2010-09-05  2:27     ` David Combs

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='i4b00d$4j0$1@speranza.aioe.org' \
    --to=spam+lisp_dot_linux@gmail.com \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).