From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Lennart Borgman Newsgroups: gmane.emacs.devel Subject: Re: How to stop find-grep-dired? Date: Mon, 21 Aug 2006 11:14:34 +0200 Message-ID: <44E9797A.4030408@student.lu.se> References: <44E5DACB.10608@student.lu.se> <44E6C066.7010008@student.lu.se> <200608210856.k7L8u2mx020108@beta.mvs.co.il> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-8-I; format=flowed Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1156151775 16699 80.91.229.2 (21 Aug 2006 09:16:15 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 21 Aug 2006 09:16:15 +0000 (UTC) Cc: rms@gnu.org, emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Aug 21 11:16:13 2006 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1GF5t7-0005dn-3n for ged-emacs-devel@m.gmane.org; Mon, 21 Aug 2006 11:16:06 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GF5t6-0007qJ-4T for ged-emacs-devel@m.gmane.org; Mon, 21 Aug 2006 05:16:04 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1GF5rs-0007ZW-Tz for emacs-devel@gnu.org; Mon, 21 Aug 2006 05:14:49 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1GF5rp-0007Wb-Ca for emacs-devel@gnu.org; Mon, 21 Aug 2006 05:14:47 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GF5ro-0007W9-C6 for emacs-devel@gnu.org; Mon, 21 Aug 2006 05:14:44 -0400 Original-Received: from [81.228.11.98] (helo=pne-smtpout1-sn1.fre.skanova.net) by monty-python.gnu.org with esmtp (Exim 4.52) id 1GF5z9-00030f-0D; Mon, 21 Aug 2006 05:22:19 -0400 Original-Received: from [192.168.123.121] (83.249.218.244) by pne-smtpout1-sn1.fre.skanova.net (7.2.075) id 44E94C200000FC70; Mon, 21 Aug 2006 11:14:39 +0200 User-Agent: Thunderbird 1.5.0.5 (Windows/20060719) Original-To: ehud@unix.mvs.co.il In-Reply-To: <200608210856.k7L8u2mx020108@beta.mvs.co.il> X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:58603 Archived-At: Ehud Karni wrote: > On Sun, 20 Aug 2006 00:32:30 -0400, Richard Stallman wrote: > >> Does M-x kill-grep kill the process for find-grep-dired? >> If not, I think we should make it work. >> >> That could be the case for `grep-find' for example. Why not bind C-g to >> something like this in those buffers (or globally)? >> >> I get a bad feeling about that. People type C-g to try to cancel >> commands, and sometimes do so by mistake in betweeen commands. This >> is a matter of habit. If the habit activates itself while >> find-grep-dired is running, it could kill the process when you >> don't want to. >> > > I suggest to use C-x C-g to kill the buffer's associated process (any, > not just grep) like this: > > (defun kill-async-process () > "Kill the asynchronous process associated with this buffer" > (interactive) > (delete-process nil)) > > (global-set-key "\C-x\C-g" 'kill-async-process) > > This can not harm, because you must use it in the relevant buffer. > I was going to make the same kind of suggestion. However maybe C-c C-g is better since this kind of key sequences are reserved for major modes (see "(info) Key Binding Conventions") and the actual command to use for stopping/killing is dependent on the major mode. Typing it several times could maybe make Emacs try harder to stop the subprocess. This is the same idea as is used today for synch subprocesses where typing C-g once sends SIGINT and if C-g is typed again then SIGKILL is sent to the subprocess (see "(info) Creating Synchronous Processes").