From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: gentsquash Newsgroups: gmane.emacs.help Subject: Continuing after an interactive command? Date: Mon, 27 May 2013 19:24:54 -0700 (PDT) Message-ID: <58d9e5c4-a663-4837-8025-c52a9ef2439c@2g2000yqr.googlegroups.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 X-Trace: ger.gmane.org 1369723771 17272 80.91.229.3 (28 May 2013 06:49:31 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 28 May 2013 06:49:31 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue May 28 08:49:32 2013 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1UhDit-00027e-TK for geh-help-gnu-emacs@m.gmane.org; Tue, 28 May 2013 08:49:32 +0200 Original-Received: from localhost ([::1]:45269 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UhDit-0000Xr-JF for geh-help-gnu-emacs@m.gmane.org; Tue, 28 May 2013 02:49:31 -0400 X-Received: by 10.224.59.205 with SMTP id m13mr16496365qah.7.1369707894212; Mon, 27 May 2013 19:24:54 -0700 (PDT) X-Received: by 10.49.96.8 with SMTP id do8mr2313986qeb.30.1369707894195; Mon, 27 May 2013 19:24:54 -0700 (PDT) Original-Path: usenet.stanford.edu!ch1no2030295qab.0!news-out.google.com!y6ni51517qax.0!nntp.google.com!ch1no2030293qab.0!postnews.google.com!2g2000yqr.googlegroups.com!not-for-mail Original-Newsgroups: gnu.emacs.help Complaints-To: groups-abuse@google.com Injection-Info: 2g2000yqr.googlegroups.com; posting-host=24.136.39.217; posting-account=LepcaQgAAACr4mTxtqQZ5RIS3kaWpFxN Original-NNTP-Posting-Host: 24.136.39.217 User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:20.0) Gecko/20100101 Firefox/20.0,gzip(gfe) Injection-Date: Tue, 28 May 2013 02:24:54 +0000 Original-Xref: usenet.stanford.edu gnu.emacs.help:198829 X-Mailman-Approved-At: Tue, 28 May 2013 02:48:56 -0400 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:91095 Archived-At: How can I define a function which contains a command that I interact with, which then continues? I seek a function like the following, executed when in a buffer: (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) ) Typically, when the `dired-do-query-replace-regexp' runs, I'll hit "!" to have it do all the replacements. I then would like to end up in the buffer, widened. However, in the above function, when the `dired-do-query-replace-regexp' terminates, it seems to terminate `foo' as well. --Jonathan