bug-gnu-emacs
[Top][All Lists]
Advanced

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

Re: no way to stop find-grep-dired


From: Kevin Rodgers
Subject: Re: no way to stop find-grep-dired
Date: Mon, 06 Oct 2003 10:47:30 -0600
User-agent: Mozilla/5.0 (X11; U; SunOS i86pc; en-US; rv:0.9.4.1) Gecko/20020406 Netscape6/6.2.2

Dan Jacobson wrote:

find-grep-dired's docstring should say how to interrupt it.
Apparently one does a kill-buffer, which takes with it all its
output so far.

Better yet, a new command to do what you want (what would be a good
local binding -- maybe C-k?):


*** emacs-21.3/lisp/find-dired.el.orig  Thu Dec 27 19:13:31 2001
--- emacs-21.3/lisp/find-dired.el       Mon Oct  6 10:41:17 2003
***************
*** 101,110 ****
        (if (or (not (eq (process-status find) 'run))
                (yes-or-no-p "A `find' process is running; kill it? "))
            (condition-case nil
!               (progn
!                 (interrupt-process find)
!                 (sit-for 1)
!                 (delete-process find))
              (error nil))
          (error "Cannot have two processes in `%s' at once" (buffer-name)))))

--- 101,107 ----
        (if (or (not (eq (process-status find) 'run))
                (yes-or-no-p "A `find' process is running; kill it? "))
            (condition-case nil
!                 (kill-find-dired find)
              (error nil))
          (error "Cannot have two processes in `%s' at once" (buffer-name)))))

***************
*** 150,155 ****
--- 147,165 ----
      (setq mode-line-process '(":%s"))))

  ;;;###autoload
+ (defun kill-find-dired (&optional process)
+   "Kill the PROCESS made by the \\[find-dired] command."
+   (interactive)
+   (or (and process
+            (equal (process-name process) find-dired-find-program))
+       (setq process
+             (get-process find-dired-find-program))
+       (error "No %s process" find-dired-find-program))
+   (interrupt-process process)
+   (sit-for 1)
+   (delete-process process)))
+
+ ;;;###autoload
  (defun find-name-dired (dir pattern)
    "Search DIR recursively for files matching the globbing pattern PATTERN,
  and run dired on those files.

--
Kevin Rodgers





reply via email to

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