unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Kevin Rodgers <ihs_4664@yahoo.com>
Subject: Re: Finding files with tags
Date: Mon, 13 Mar 2006 11:56:06 -0700	[thread overview]
Message-ID: <dv4f9d$q2v$1@sea.gmane.org> (raw)
In-Reply-To: <3350075.post@talk.nabble.com>

mlathe wrote:
> Is it possible get a listing of all the filenames that match a grep on TAGS?
> Ideally you wouldn't need to cycle through the list but rather you would
> simply get a listing in a buffer similar to dired or grep-find (no sure
> about the exact term) that actually open the buffer.
> 
> Currently i use an index that i created using find, and some various tools i
> wrote to do greps on that list. However i need to do this in the emacs
> shell, then copy it into the find-file. Its not exactly ideal.

Here's what I came up with (note the literal DEL character immediately
after the first comma in the sed regex):

(defun dired-tags-table (tags)
   "Use Dired mode to edit the files listed in the TAGS table."
   ;; (interactive ...) copied from visit-tags-table:
   (interactive (list (read-file-name "Dired tags table: (default TAGS) "
				     default-directory
				     (expand-file-name "TAGS"
						       default-directory)
				     t)))
   (dired (cons (file-name-directory tags)
                (split-string
                 (shell-command-to-string
                  (format "sed -n 's/^\\([^,\x7f]*\\),[1-9][0-9]*$/\\1/p' %s"
                          tags))))))


-- 
Kevin Rodgers

  parent reply	other threads:[~2006-03-13 18:56 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-03-11  1:35 Finding files with tags mlathe
2006-03-11 11:15 ` Eli Zaretskii
2006-03-13 18:02   ` mlathe
2006-03-13 18:56 ` Kevin Rodgers [this message]
2006-03-13 20:48   ` mlathe
2006-03-13 23:32     ` Kevin Rodgers
2006-03-14  2:47       ` mlathe
2006-03-15 22:24         ` Kevin Rodgers
2006-03-16 16:57           ` Kevin Rodgers

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='dv4f9d$q2v$1@sea.gmane.org' \
    --to=ihs_4664@yahoo.com \
    /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).