From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Kevin Rodgers Newsgroups: gmane.emacs.bugs Subject: Re: dired-do-shell-command blocks C-z suspension, switching buffers Date: Wed, 24 Dec 2003 10:36:25 -0700 Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Message-ID: <3FE9CE99.9060700@yahoo.com> References: <87vfofwgfn.fsf@jidanni.org> NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1072287486 6107 80.91.224.253 (24 Dec 2003 17:38:06 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 24 Dec 2003 17:38:06 +0000 (UTC) Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Dec 24 18:37:58 2003 Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1AZCxK-0000wL-00 for ; Wed, 24 Dec 2003 18:37:58 +0100 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.24) id 1AZDtv-0003uy-Ni for geb-bug-gnu-emacs@m.gmane.org; Wed, 24 Dec 2003 13:38:31 -0500 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.24) id 1AZDts-0003te-BN for bug-gnu-emacs@prep.ai.mit.edu; Wed, 24 Dec 2003 13:38:28 -0500 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.24) id 1AZDtM-0003d3-EG for bug-gnu-emacs@prep.ai.mit.edu; Wed, 24 Dec 2003 13:38:27 -0500 Original-Received: from [132.239.1.53] (helo=mailbox1.ucsd.edu) by monty-python.gnu.org with esmtp (Exim 4.24) id 1AZDtL-0003bc-Hw for bug-gnu-emacs@prep.ai.mit.edu; Wed, 24 Dec 2003 13:37:55 -0500 Original-Received: from mail.fu-berlin.de (mail.fu-berlin.de [160.45.11.165]) by mailbox1.ucsd.edu (8.12.10/8.12.9) with ESMTP id hBOHaPdx002613 for ; Wed, 24 Dec 2003 09:36:25 -0800 (PST) Original-Received: by mail.fu-berlin.de (Smail3.2.0.98) from Curry.ZEDAT.FU-Berlin.DE (160.45.10.36) with esmtp id ; Wed, 24 Dec 2003 18:36:25 +0100 (MET) Original-Received: by Curry.ZEDAT.FU-Berlin.DE (Smail3.2.0.98) from news.fu-berlin.de with bsmtp id ; Wed, 24 Dec 2003 18:36:25 +0100 (MET) Original-To: gnu-emacs-bug@moderators.isc.org Original-Path: 170.207.51.80!not-for-mail Original-Newsgroups: gnu.emacs.bug Original-Lines: 54 X-Orig-NNTP-Posting-Host: 170.207.51.80 X-Orig-X-Trace: news.uni-berlin.de 1072287384 12047210 170.207.51.80 ([82742]) User-Agent: Mozilla/5.0 (X11; U; SunOS i86pc; en-US; rv:0.9.4.1) Gecko/20020406 Netscape6/6.2.2 X-Accept-Language: en-us X-Spamscanner: mailbox1.ucsd.edu (v1.4 Oct 30 2003 22:20:52, 1.4/5.0 2.60) X-MailScanner: PASSED (v1.2.8 85661 hBOHaPdx002613 mailbox1.ucsd.edu) X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.1.2 Precedence: list List-Id: Bug reports for GNU Emacs, the Swiss army knife of text editors List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.bugs:6381 X-Report-Spam: http://spam.gmane.org/gmane.emacs.bugs:6381 Dan Jacobson wrote: > RMS> This command is defined to wait for the shell command to finish. > RMS> You can interrupt it by typing C-g. > > Well, we are sort of thrown back to the age of MSDOS single tasking > systems, when we cannot pop in and out of emacs with a ^Z (-nw or > not), without affecting subjobs... and I don't see what is gained this > way, other than code simplicity perhaps. > > Hmm, plain old ESC ! (shell-command) acts that way too. > > Anyway, let's examine what we might do when the user types > ESC ! sleep 111 RET C-z > 1. nothing, not even a message. (current behavior) > 2. suspension, just as if when the user had typed sleep 111& > 3. suspension, even suspending the sleep job > > Anyway, at least there could be some message printed for [1], > especially since you aren't saving our C-z intending to send it to the > stdin of our subjob. shell-command is used to run a command synchronously (unless it ends with "&"), with standard input effectively bound to null-device. You can see that by running `ESC ! cat RET', which returns immediately with the message "(Shell command succeeded with no output)" instead of waiting for EOF. If you want the command to read its standard input from the minibuffer, I'm sure a patch would be welcome. Even then, the command would still be run synchronously. However, it ought to be possible to stop and then resume an asynchronous command: (defun stop-async-shell-command () "Stop executing the current asynchronous shell command." (interactive) (stop-process (get-buffer-process (or (get-buffer "*Async Shell Command*") (error "No asynchronous shell command is running"))))) (defun continue-async-shell-command () "Resume executing the current asynchronous shell command." (interactive) (continue-process (get-buffer-process (or (get-buffer "*Async Shell Command*") (error "No asynchronous shell command is running"))))) ;; (global-set-key "\C-c\C-z" 'stop-async-shell-command) ;; (global-set-key "\C-c\C-a" 'continue-async-shell-command) -- Kevin Rodgers