From: Thien-Thi Nguyen <ttn@gnu.org>
To: gentsquash <gentsquash@gmail.com>
Cc: help-gnu-emacs@gnu.org
Subject: Re: Continuing after an interactive command?
Date: Tue, 28 May 2013 09:39:09 +0200 [thread overview]
Message-ID: <87wqqjtuxu.fsf@zigzag.favinet> (raw)
In-Reply-To: <58d9e5c4-a663-4837-8025-c52a9ef2439c@2g2000yqr.googlegroups.com> (gentsquash@gmail.com's message of "Mon, 27 May 2013 19:24:54 -0700 (PDT)")
[-- Attachment #1: Type: text/plain, Size: 1129 bytes --]
() gentsquash <gentsquash@gmail.com>
() Mon, 27 May 2013 19:24:54 -0700 (PDT)
(defun foo ()
(ns-narrow-to-region 100 200)
(goto-char (point-min))
(dired-jump)
;; This next cmd interacts with the user.
(dired-do-query-replace-regexp FROM TO)
;; If the above cmd terminates normally, I'd like these
;; to be executed:
(dired-find-file)
(ns-widen)
)
That's like leaving the house and walking around the block (complaining
loudly to annoy the neighbors) to get from the kitchen to the bathroom.
If you really must, then try:
(ignore-errors
(save-excursion
(dired-do-query-replace-regexp FROM TO)))
which catches the throw out of the stateful query-replace loop and
furthermore preserves context such that ‘dired-find-file’ does not
complain. That is like remembering to lock the door (to thwart
negative neighborly retribution) and bring a key.
But i have to wonder... Why do you treat your neighbors so?
Is it really their business that your soup is too spicy?
--
Thien-Thi Nguyen
GPG key: 4C807502
[-- Attachment #2: Type: application/pgp-signature, Size: 197 bytes --]
next prev parent reply other threads:[~2013-05-28 7:39 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-05-28 2:24 Continuing after an interactive command? gentsquash
2013-05-28 7:39 ` Thien-Thi Nguyen [this message]
[not found] ` <mailman.502.1369726605.22516.help-gnu-emacs@gnu.org>
2013-05-29 2:34 ` gentsquash
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
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87wqqjtuxu.fsf@zigzag.favinet \
--to=ttn@gnu.org \
--cc=gentsquash@gmail.com \
--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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).