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: Sat, 19 Aug 2006 10:09:32 +0200 Message-ID: <44E6C73C.7030302@student.lu.se> References: <44E5DACB.10608@student.lu.se> <44E6C066.7010008@student.lu.se> <85hd09mao0.fsf@lola.goethe.zz> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1155975014 11020 80.91.229.2 (19 Aug 2006 08:10:14 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sat, 19 Aug 2006 08:10:14 +0000 (UTC) Cc: rms@gnu.org, emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Aug 19 10:10:12 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 1GELuF-00079r-TS for ged-emacs-devel@m.gmane.org; Sat, 19 Aug 2006 10:10:12 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GELuE-0001c8-OC for ged-emacs-devel@m.gmane.org; Sat, 19 Aug 2006 04:10:10 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1GELtg-0001an-T8 for emacs-devel@gnu.org; Sat, 19 Aug 2006 04:09:36 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1GELtf-0001aM-Rp for emacs-devel@gnu.org; Sat, 19 Aug 2006 04:09:36 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GELtf-0001a8-L6 for emacs-devel@gnu.org; Sat, 19 Aug 2006 04:09:35 -0400 Original-Received: from [81.228.8.83] (helo=pne-smtpout1-sn2.hy.skanova.net) by monty-python.gnu.org with esmtp (Exim 4.52) id 1GEM0X-0007sT-En; Sat, 19 Aug 2006 04:16:41 -0400 Original-Received: from [192.168.123.121] (83.249.218.244) by pne-smtpout1-sn2.hy.skanova.net (7.2.075) id 44A2E86F00A88F40; Sat, 19 Aug 2006 10:09:33 +0200 User-Agent: Thunderbird 1.5.0.5 (Windows/20060719) Original-To: David Kastrup In-Reply-To: <85hd09mao0.fsf@lola.goethe.zz> 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:58504 Archived-At: David Kastrup wrote: > Lennart Borgman writes: > > >> Richard Stallman wrote: >> >>> How do you stop a command like `find-grep-dired'? I tried C-g >>> and M-ESC-ESC but none of them worked. I looked in the menus, >>> but I found nothing obvious there. (I did this on w32.) >>> >>> Since the buffer fills asynchronously, C-g won't stop it. >>> Killing the buffer should do so. Does that work? >>> >>> >> It does, but suppose you want the information that is already there? >> That could be the case for `grep-find' for example. Why not bind C-g >> to something like this in those buffers (or globally)? >> >> (defun keyboard-process-quit() >> "Delete buffer process if there is one or signal a `quit' condition." >> (interactive) >> (if (get-buffer-process (current-buffer)) >> (delete-process (current-buffer)) >> (keyboard-quit))) >> > > Because C-g is used to abort a lot of actions, like searching, > incomplete key sequences and so on. When we are doing M-!, Emacs > stays busy and so C-g is an unambiguous way of stopping a program. > But in comint buffers, I'd want something more explicit like C-c C-c > (incidentally, isn't that the way to kill already?). > In the *grep* buffer C-c C-c runs `compile-goto-error'. I would like it very simple and always beeing able to use C-g for stopping seems desireable to me. How about asking before deleting the process? Something like this: (defun keyboard-process-quit() "Delete buffer process if there is one or signal a `quit' condition." (interactive) (let* ((buf-proc (get-buffer-process (current-buffer))) (del-proc (when buf-proc (y-or-n-p (format "Delete process %s in current buffer? " buf-proc))))) (if del-proc (progn (delete-process (current-buffer)) (goto-char (point-max))) (keyboard-quit)))) BTW, how do you see if a process is asynchronous?