From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Andreas =?iso-8859-1?q?R=F6hler?= Newsgroups: gmane.emacs.help Subject: Re: Interative batch query-replace question Date: Fri, 30 Nov 2007 09:08:55 +0100 Message-ID: <200711300908.56487.andreas.roehler@online.de> References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1196410211 7423 80.91.229.12 (30 Nov 2007 08:10:11 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 30 Nov 2007 08:10:11 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Nov 30 09:10:20 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 1Iy0wz-00037K-NV for geh-help-gnu-emacs@m.gmane.org; Fri, 30 Nov 2007 09:10:17 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Iy0wj-00054I-Pn for geh-help-gnu-emacs@m.gmane.org; Fri, 30 Nov 2007 03:10:01 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Iy0wD-000527-3x for help-gnu-emacs@gnu.org; Fri, 30 Nov 2007 03:09:29 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Iy0wB-00051p-7o for help-gnu-emacs@gnu.org; Fri, 30 Nov 2007 03:09:28 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Iy0wB-00051m-3v for help-gnu-emacs@gnu.org; Fri, 30 Nov 2007 03:09:27 -0500 Original-Received: from mx20.gnu.org ([199.232.41.8]) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1Iy0wA-0005an-HT for help-gnu-emacs@gnu.org; Fri, 30 Nov 2007 03:09:26 -0500 Original-Received: from moutng.kundenserver.de ([212.227.126.183]) by mx20.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Iy0w9-0004ir-Rs for help-gnu-emacs@gnu.org; Fri, 30 Nov 2007 03:09:26 -0500 Original-Received: from noname (p54BE9E0F.dip0.t-ipconnect.de [84.190.158.15]) by mrelayeu.kundenserver.de (node=mrelayeu2) with ESMTP (Nemesis) id 0MKwtQ-1Iy0w72qbx-00017x; Fri, 30 Nov 2007 09:09:24 +0100 User-Agent: KMail/1.9.5 In-Reply-To: Content-Disposition: inline X-Provags-ID: V01U2FsdGVkX18f9dvygPSkBQc4yO6lBT3RpgxzAjqRasUwI8S Pw2/uYKRxqC7trJ8r/TFRIFVXKErdaW7nGU75QukHazjW4QYVZ p9gY9JGQbRXVLmPN1Y3+g== X-detected-kernel: by mx20.gnu.org: Linux 2.6? (barebone, rare!) X-detected-kernel: by monty-python.gnu.org: Linux 2.6, seldom 2.4 (older, 4) 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:49715 Archived-At: Am Freitag, 30. November 2007 02:58 schrieb Ke Lu: > jp\\.co To question is: Must you do that just once and only renaming is at stake? If yes, I'd choose `wdired'. Should you have the same renamings to perform repeatedly and/or other tasks than renaming with this files--backups, contents changes or whatever--I would write a skript aside from dired. BTW the *Find*" buffer usually is write-protected. Editing them looks special for me. To get the appropriate files in directory I'd choose something like (let ((files (directory-files (expand-file-name (substitute-in-file-name di= r))=20 t "jp\\.co$"))) (while files (let ((file (car files))) (when (file-exists-p file) DO SOMETHING (setq files (cdr files)))))) ;;;;;;; =46or DO SOMETHING you could proceed (if (string-match ... ;; your interactive form (y-or-n-p (rename-file ... DO MORE THINGS ;;;;;;;;;;; HTH Andreas R=F6hler