help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Interative batch query-replace question


From: Andreas Röhler
Subject: Re: Interative batch query-replace question
Date: Fri, 30 Nov 2007 09:08:55 +0100
User-agent: KMail/1.9.5

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 dir)) 
t "jp\\.co$")))
 (while files
 (let ((file (car files)))
 (when (file-exists-p file)

 DO SOMETHING
 (setq files (cdr files))))))

;;;;;;;

For DO SOMETHING

you could proceed

(if      (string-match ...

     ;; your interactive form
    (y-or-n-p
                   (rename-file ...

                                DO MORE THINGS

;;;;;;;;;;;

HTH

Andreas Röhler




reply via email to

[Prev in Thread] Current Thread [Next in Thread]