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: Thu, 29 Nov 2007 21:55:44 +0100 Message-ID: <200711292155.44970.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 1196369834 1988 80.91.229.12 (29 Nov 2007 20:57:14 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 29 Nov 2007 20:57:14 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Nov 29 21:57:21 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 1IxqRP-0006fL-BS for geh-help-gnu-emacs@m.gmane.org; Thu, 29 Nov 2007 21:57:00 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IxqR9-0004D8-Q5 for geh-help-gnu-emacs@m.gmane.org; Thu, 29 Nov 2007 15:56:43 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1IxqQw-0004BM-BB for help-gnu-emacs@gnu.org; Thu, 29 Nov 2007 15:56:30 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1IxqQu-00048K-RN for help-gnu-emacs@gnu.org; Thu, 29 Nov 2007 15:56:30 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IxqQu-000489-Ol for help-gnu-emacs@gnu.org; Thu, 29 Nov 2007 15:56:28 -0500 Original-Received: from moutng.kundenserver.de ([212.227.126.177]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1IxqQu-0008V2-9w for help-gnu-emacs@gnu.org; Thu, 29 Nov 2007 15:56:28 -0500 Original-Received: from noname (p54BEB3C3.dip0.t-ipconnect.de [84.190.179.195]) by mrelayeu.kundenserver.de (node=mrelayeu8) with ESMTP (Nemesis) id 0ML31I-1IxqQV37H9-0003BO; Thu, 29 Nov 2007 21:56:27 +0100 User-Agent: KMail/1.9.5 In-Reply-To: Content-Disposition: inline X-Provags-ID: V01U2FsdGVkX19AWaG66GRvkY4WjOvm6CIW4Ghle8l5+Eveayg MfIfOv2Kw3Y+dvqfoEMH7Vy4mSVjkZL8lTF26SooqMnj7PVIvN O6MZVYrFlxtH4sME3EmlA== 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:49695 Archived-At: If you could give a short description of your task, that may help to find the code. AFAIK `dired-' is designed to be called from the dired-buffer. If you do query-replace from a program, you probably should use other functions. Andreas R=F6hler > The problem is: > (defun batch-query-replace-regexp() > (interactive) > (switch-to-buffer "*Find*") > (dired-do-query-replace-regexp "jp\\.co" "jp.co2") > ->can't reach here (switch-to-buffer "*Find*") > (dired-do-query-replace-regexp "java" "java2") > ) > > Ke Lu writes: > > Yes,Only the first one is executed. > > > > Andreas R=F6hler writes: > >> Am Donnerstag, 29. November 2007 06:56 schrieb Ke Lu: > >>> Sorry, I forgot to move point to the begining of buffer, > >>> It is ok now. > >>> > >>> But dired-do-query-replace-regexp still have some peoblem. > >>> My function looks like: > >>> (defadvice query-replace-regexp (before > >>> move-start-after-query-replace-regexp activate) > >>> (goto-char (point-min))) > >>> > >>> (defun batch-query-replace-regexp() > >>> (interactive) > >>> (switch-to-buffer "*Find*") > >>> (dired-do-query-replace-regexp "jp\\.co" "jp.co2") > >>> (switch-to-buffer "*Find*") > >>> (dired-do-query-replace-regexp "java" "java2") > >>> ) > >>> > >>> But the second one can't be executed and there is not any > >>> error message. > >>> What is the reason? > >>> > >>> Ke Lu writes: > >>> > I want to do a Interative batch query-replace which looks like: > >>> > (defun a-batch-query-relace() > >>> > (interactive) > >>> > (query-replace "jp.co" "jp.co2") > >>> > (query-replace "java" "java2") > >>> > ..... > >>> > ) > >>> > But only first query-replace be excuted,I would like to know why > >>> > and how to solve it. > >>> > >>> _______________________________________________ > >> > >> Same problem? > > _______________________________________________ > help-gnu-emacs mailing list > help-gnu-emacs@gnu.org > http://lists.gnu.org/mailman/listinfo/help-gnu-emacs