[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: grep and sort
From: |
Antony |
Subject: |
Re: grep and sort |
Date: |
Wed, 08 Dec 2010 15:25:04 -0000 |
User-agent: |
Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.1.11) Gecko/20100711 Thunderbird/3.0.6 |
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