From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Andreas =?utf-8?q?R=C3=B6hler?= Newsgroups: gmane.emacs.help Subject: Re: Interative batch query-replace question Date: Sat, 1 Dec 2007 18:39:03 +0100 Message-ID: <200712011839.03300.andreas.roehler@online.de> References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1196530823 20779 80.91.229.12 (1 Dec 2007 17:40:23 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 1 Dec 2007 17:40:23 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sat Dec 01 18:40:29 2007 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1IyWKL-0002z3-DE for geh-help-gnu-emacs@m.gmane.org; Sat, 01 Dec 2007 18:40:29 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IyWK5-0000Ic-7z for geh-help-gnu-emacs@m.gmane.org; Sat, 01 Dec 2007 12:40:13 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1IyWJk-0000G8-7X for help-gnu-emacs@gnu.org; Sat, 01 Dec 2007 12:39:52 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1IyWJi-0000FK-SM for help-gnu-emacs@gnu.org; Sat, 01 Dec 2007 12:39:51 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IyWJi-0000FH-K8 for help-gnu-emacs@gnu.org; Sat, 01 Dec 2007 12:39:50 -0500 Original-Received: from moutng.kundenserver.de ([212.227.126.186]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1IyWJi-00055W-6Y for help-gnu-emacs@gnu.org; Sat, 01 Dec 2007 12:39:50 -0500 Original-Received: from noname (p54BE9216.dip0.t-ipconnect.de [84.190.146.22]) by mrelayeu.kundenserver.de (node=mrelayeu1) with ESMTP (Nemesis) id 0MKwpI-1IyWJh10s2-0004cY; Sat, 01 Dec 2007 18:39:49 +0100 User-Agent: KMail/1.9.5 In-Reply-To: Content-Disposition: inline X-Provags-ID: V01U2FsdGVkX1+ziEIUmY8qaZzTMEyyCncv1ef+K6jE/4yOqJT Ylzdjg/rnAjpbTshaqo+fhmHVH7v+Sm8RFFSOBcdvE5GU4uvCQ F0QJEbAmFHySI8bFiPPeg== X-detected-kernel: by monty-python.gnu.org: Linux 2.6? (barebone, rare!) 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:49761 Archived-At: Am Samstag, 1. Dezember 2007 10:11 schrieb Ke Lu: > Perhaps my explain is not quite enough. > > I want to query-replace some files.(not filename) =2E.. So we have basically two tasks 1 - find the list of files 2 - operate on them Dired probably isn't TRT here, because it's for manually operation. Maybe run this at your dir to have some impression how it may start: (defun my-list-of-files () " " (interactive) (let ((my-endings-list '(".co$" ".java$"))) (dolist (el my-endings-list) (let ((files (directory-files default-directory t el))) (while files (let ((file (car files))) (when (file-exists-p file) (when (y-or-n-p (concat "You agree to change \""file"\" later"))) (message "Later we will change name and contents of %s " file)) (setq files (cdr files)))))))) Andreas R=C3=B6hler