[Top][All Lists]

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

Re: How to stop find-grep-dired?

From: Lennart Borgman
Subject: Re: How to stop find-grep-dired?
Date: Mon, 21 Aug 2006 11:14:34 +0200
User-agent: Thunderbird (Windows/20060719)

Ehud Karni wrote:
On Sun, 20 Aug 2006 00:32:30 -0400, Richard Stallman <address@hidden> 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"
       (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").

reply via email to

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