* grep and sort
@ 2010-08-15 14:29 Antony
2010-08-15 14:58 ` David Kastrup
2010-08-16 9:22 ` Antony
0 siblings, 2 replies; 4+ messages in thread
From: Antony @ 2010-08-15 14:29 UTC (permalink / raw)
To: help-gnu-emacs
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.
Any pointers?
-Antony
PS:
Reason for sorting
I follow my TODO with a space and two digit number like TOOD: 01 or
TODO: 80 with the numbers representing priority. This has worked very
well as a task management mechanism for me in eclispe and visual studio.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: grep and sort
2010-08-15 14:29 grep and sort Antony
@ 2010-08-15 14:58 ` David Kastrup
2010-08-16 9:22 ` Antony
1 sibling, 0 replies; 4+ messages in thread
From: David Kastrup @ 2010-08-15 14:58 UTC (permalink / raw)
To: help-gnu-emacs
Antony <spam+lisp_dot_linux@gmail.com> writes:
> 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.
>
>
> Any pointers?
grep ... | sort -t : -k 2
--
David Kastrup
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: grep and sort
2010-08-15 14:29 grep and sort Antony
2010-08-15 14:58 ` David Kastrup
@ 2010-08-16 9:22 ` Antony
[not found] ` <i4b4o3$e53$1@speranza.aioe.org>
1 sibling, 1 reply; 4+ messages in thread
From: Antony @ 2010-08-16 9:22 UTC (permalink / raw)
To: help-gnu-emacs
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
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2010-09-05 2:27 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-08-15 14:29 grep and sort Antony
2010-08-15 14:58 ` David Kastrup
2010-08-16 9:22 ` Antony
[not found] ` <i4b4o3$e53$1@speranza.aioe.org>
2010-09-05 2:27 ` David Combs
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.