emacs-devel
[Top][All Lists]
Advanced

[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: Sat, 19 Aug 2006 10:09:32 +0200
User-agent: Thunderbird 1.5.0.5 (Windows/20060719)

David Kastrup wrote:
Lennart Borgman <address@hidden> 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?




reply via email to

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