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

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

Re: Continuing after an interactive command?


From: Thien-Thi Nguyen
Subject: Re: Continuing after an interactive command?
Date: Tue, 28 May 2013 09:39:09 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.2 (gnu/linux)

() 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: pgpL53E8b5I2A.pgp
Description: PGP signature


reply via email to

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