[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:05 -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/16/2010 2:22 AM, Antony wrote:
On 8/15/2010 7:29 AM, Antony wrote:
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
answering to myself (in case someone has use for this)
here is what I have working for my needs
;;searching for T O D Os
;;code based on grep command in grep.el
;;got from http://git.savannah.gnu.org/cgit/emacs.git/tree/lisp
;; /progmodes/grep.el
(defun aas-todo (command-args)
(interactive
(progn
(grep-compute-defaults)
(let ((default (grep-default-command)))
(list "grep -nH -r -i -e TODO: ~/git/src | sort -t : -k 4"))))
(compilation-start (if (and grep-use-null-device null-device)
(concat command-args " " null-device)
command-args)
'grep-mode))
(define-key global-map [f11] 'aas-todo)
No idea how it works :) , use at your own risk
-Antony