all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Ke Lu <lu@luxdo.jp>
To: help-gnu-emacs@gnu.org
Subject: Re: Interative batch query-replace question
Date: Fri, 30 Nov 2007 10:58:51 +0900	[thread overview]
Message-ID: <m3tzn4ijdw.fsf@www.luxdo.jp> (raw)
In-Reply-To: mailman.4324.1196369791.18990.help-gnu-emacs@gnu.org

My task is:
1. Use find-dired to Find all java file in a fold.
2. Mark all file in "*Find*" buffer
3. call batch-query-replace-regexp.
(I must do it, because I have about 50 pattern to query-replace-regexp
and I must do it in interative way to confirm if it is right)

>>  (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")
...a lot of pattern to query-replace-regexp
>>  )
>>
Andreas Röhler <andreas.roehler@online.de> writes:

> 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öhler
>
>> 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 <lu@luxdo.jp> writes:
>> > Yes,Only the first one is executed.
>> >
>> > Andreas Röhler <andreas.roehler@online.de> 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 <lu@luxdo.jp> 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

  parent reply	other threads:[~2007-11-30  1:58 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-11-29  3:08 Interative batch query-replace question Ke Lu
2007-11-29  5:56 ` Ke Lu
2007-11-29  7:37   ` Andreas Röhler
     [not found]   ` <mailman.4291.1196321879.18990.help-gnu-emacs@gnu.org>
2007-11-29  9:15     ` Ke Lu
2007-11-29 10:18       ` Ke Lu
2007-11-29 20:55         ` Andreas Röhler
     [not found]         ` <mailman.4324.1196369791.18990.help-gnu-emacs@gnu.org>
2007-11-29 21:16           ` Joel J. Adamson
2007-11-30  1:58           ` Ke Lu [this message]
2007-11-30  8:08             ` Andreas Röhler
     [not found]             ` <mailman.4336.1196410171.18990.help-gnu-emacs@gnu.org>
2007-11-30  9:25               ` Ke Lu
2007-11-30 14:25                 ` Joel J. Adamson
2007-11-30 19:33                 ` Andreas Röhler
     [not found]                 ` <mailman.4365.1196451256.18990.help-gnu-emacs@gnu.org>
2007-12-01  1:00                   ` Ke Lu
2007-12-01  8:19                     ` Andreas Röhler
     [not found]                     ` <mailman.4382.1196497198.18990.help-gnu-emacs@gnu.org>
2007-12-01  9:11                       ` Ke Lu
2007-12-01 15:19                         ` Xah Lee
2007-12-02  2:16                           ` Ke Lu
2007-12-03 15:27                             ` Joel J. Adamson
2007-12-01 17:39                         ` Andreas Röhler
     [not found]                         ` <mailman.4401.1196530793.18990.help-gnu-emacs@gnu.org>
2007-12-02  2:26                           ` Ke Lu
2007-12-03 15:32                             ` jedit.el (was: Interative batch query-replace question) Joel J. Adamson
2007-11-29  6:54 ` Interative batch query-replace question Andreas Röhler

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m3tzn4ijdw.fsf@www.luxdo.jp \
    --to=lu@luxdo.jp \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.