From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Ryan Krauss" Newsgroups: gmane.emacs.help Subject: Re: creating a tags file for interactive search and replace regexp Date: Mon, 19 Jun 2006 22:21:17 -0400 Message-ID: References: <878xns1u6a.fsf@offby1.atm01.sea.blarg.net> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1150770100 22103 80.91.229.2 (20 Jun 2006 02:21:40 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 20 Jun 2006 02:21:40 +0000 (UTC) Cc: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue Jun 20 04:21:38 2006 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1FsVrx-00035C-3n for geh-help-gnu-emacs@m.gmane.org; Tue, 20 Jun 2006 04:21:33 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FsVrw-0007oM-AC for geh-help-gnu-emacs@m.gmane.org; Mon, 19 Jun 2006 22:21:32 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1FsVrj-0007oH-VO for help-gnu-emacs@gnu.org; Mon, 19 Jun 2006 22:21:20 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1FsVri-0007o4-E7 for help-gnu-emacs@gnu.org; Mon, 19 Jun 2006 22:21:19 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FsVri-0007nx-6a for help-gnu-emacs@gnu.org; Mon, 19 Jun 2006 22:21:18 -0400 Original-Received: from [64.233.184.235] (helo=wr-out-0506.google.com) by monty-python.gnu.org with esmtp (Exim 4.52) id 1FsW28-0000I5-Jg for help-gnu-emacs@gnu.org; Mon, 19 Jun 2006 22:32:04 -0400 Original-Received: by wr-out-0506.google.com with SMTP id i3so471741wra for ; Mon, 19 Jun 2006 19:21:17 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=T5gkkPvt4/25f59eLBbANlFD34FdjJQWqB3/eaWs94iwuKeIeUBJ80YtB9O4Vvw07bXtPWDJ/l2SvS8RHB05XEe2qO0n3sUglhq1rq6yCzuz3eym4lZFM86lcs9lFlwfhsL/vS0aYNJzNla/BMmbi5GwjAdnJ9K7PMpqKJ7V2TY= Original-Received: by 10.64.125.17 with SMTP id x17mr28472qbc; Mon, 19 Jun 2006 19:21:17 -0700 (PDT) Original-Received: by 10.64.47.13 with HTTP; Mon, 19 Jun 2006 19:21:17 -0700 (PDT) Original-To: "Eric Hanchrow" In-Reply-To: <878xns1u6a.fsf@offby1.atm01.sea.blarg.net> Content-Disposition: inline X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:35550 Archived-At: Thanks Eric, this seems like a good start. It seems like your shell script is just passing a list of file names or paths to etags. Is that true? If I already have a python script that finds only the files I want, can I just use python to call etags file1.tex file2.tex ... ? Is there a way to do the dired-do-query-replace-regexp based on marked files in the standard buffer list? The reason I ask is that it is very easy for me to use python to open emacs with only the files I want (basically doing emacs file1.tex file2.tex ...). The buffer list will already have all the files I want and only the files I want. Basically, I have a directory tree with my thesis in it. I want to search and replace the Latex files I actually use in the thesis. But the tree is a mess with many files I don't think I use but don't dare delete yet and many subfolders. So, there are .tex files everywhere. I have written a python script that parses the main Latex file looking for \input lines and based on the \input files (and the files they input), python gives me a list of the *.tex files actually used. There are 40 "good" *.tex files and over 1300 total *.tex files in the tree. So, I really need to do something with the list of filenames/paths coming out of Python - i.e I need to pass the list to something, generate my own etags file, or work on the emacs buffer list. I know I have made this mess myself, but can someone show me a good way out of it? Thanks, Ryan On 6/19/06, Eric Hanchrow wrote: > >>>>> "Ryan" == Ryan Krauss writes: > > Ryan> I want to do an interactive regexp search and replace on a > Ryan> list of files. I don't want to search all the files in one > Ryan> directory and the files are actually in many different > Ryan> directories. How do I do this search and replace on a > Ryan> specified list? I think I need a list of tag files. But I > Ryan> cannot find an example of the syntax of such a tag file. > > Sometimes I make a TAGS file, and then do tags-query-replace. Read > the man page for etags; it's pretty flexible. Here's an example of a > shell script that creates a TAGS file for certain files only: > > find . \ > \( \ > -type d \ > \( -iname boring -prune \) \ > -o \( -iname also-boring -prune \) \ > \) \ > -o \ > \( \ > -type f \ > \( \ > -name '*.pas' \ > -o -name '*.dfm' \ > -o -name '*.p[lm]' \ > -o -name '*.js' \ > -o -name '*.sql' \ > \) -print \ > \) | etags - > > You can also do "find-dired", then mark any or all of the resulting > files, then type Q (dired-do-query-replace-regexp). > > -- > One of the fundamental philosophical questions of our time is > why Goofy is a person and Pluto is a dog. > -- Roger Ebert > > > > _______________________________________________ > help-gnu-emacs mailing list > help-gnu-emacs@gnu.org > http://lists.gnu.org/mailman/listinfo/help-gnu-emacs >