From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Richard Stallman Newsgroups: gmane.emacs.devel Subject: [jari.aalto@cante.net: [patch] 21.3 find-dired.el - Add 'g' key to repeat last find command] Date: Fri, 21 Jan 2005 21:52:54 -0500 Message-ID: Reply-To: rms@gnu.org NNTP-Posting-Host: deer.gmane.org X-Trace: sea.gmane.org 1106364237 7431 80.91.229.6 (22 Jan 2005 03:23:57 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sat, 22 Jan 2005 03:23:57 +0000 (UTC) Cc: jari.aalto@cante.net Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Jan 22 04:23:50 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1CsBsL-0006bN-00 for ; Sat, 22 Jan 2005 04:23:49 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1CsC4R-0006r2-6y for ged-emacs-devel@m.gmane.org; Fri, 21 Jan 2005 22:36:19 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1CsBzl-0004dE-Dv for emacs-devel@gnu.org; Fri, 21 Jan 2005 22:31:30 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1CsBuc-0003sV-L6 for emacs-devel@gnu.org; Fri, 21 Jan 2005 22:26:14 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1CsBuc-0003oF-2j for emacs-devel@gnu.org; Fri, 21 Jan 2005 22:26:10 -0500 Original-Received: from [199.232.76.164] (helo=fencepost.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.34) id 1CsBPv-0006M5-53 for emacs-devel@gnu.org; Fri, 21 Jan 2005 21:54:27 -0500 Original-Received: from rms by fencepost.gnu.org with local (Exim 4.34) id 1CsBOQ-0004sT-Cu; Fri, 21 Jan 2005 21:52:54 -0500 Original-To: emacs-devel@gnu.org 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: main.gmane.org gmane.emacs.devel:32474 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:32474 Providing proper support for g is more filling a gap than adding a feature, so would someone please install this and ack? ------- Start of forwarded message ------- From: jari.aalto@cante.net (Jari+mail.emacs) To: bug-gnu-emacs@gnu.org Date: Fri, 21 Jan 2005 10:02:42 +0200 Subject: [patch] 21.3 find-dired.el - Add 'g' key to repeat last find command Sender: bug-gnu-emacs-bounces+rms=gnu.org@gnu.org X-Spam-Status: No, hits=-0.5 required=5.0 tests=PATCH_UNIFIED_DIFF,RCVD_IN_ORBS,USER_AGENT_GNUS_UA version=2.55 X-Spam-Level: X-Spam-Checker-Version: SpamAssassin 2.55 (1.174.2.19-2003-05-19-exp) As with dired 'g', the results of find-dired can now be repeated. With log files and IMAP mail directories, this feature is quite useful. 2005-01-21 Fri Jari * find-dired.el (find-dired-revert): New function. (find-dir): New variable. (find-dired): Added local `revert-buffer-function' and restored key 'g' to rerun last find command. - --- find-dired.el 2005-01-21 09:33:59+02 1.1 +++ find-dired.el 2005-01-21 09:56:04+02 1.2 @@ -69,9 +69,23 @@ (defvar find-args nil "Last arguments given to `find' by \\[find-dired].") +(defvar find-dir nil + "Last arguments given to `find' by \\[find-dired].") + ;; History of find-args values entered in the minibuffer. (defvar find-args-history nil) +(defun find-dired-revert (&optional ignore-auto noconfirm) + "Rerun last command `find-dired' command. +Optional arguments IGNORE-AUTO and NOCONFIRM are not used." + (interactive) + (let* ((args find-args) + (dir find-dir)) + (if (and dir args) + (find-dired dir args) + (message + "Find dired: no previous information stored to repeat find.")))) + ;;;###autoload (defun find-dired (dir args) "Run `find' and go into Dired mode on a buffer of the output. @@ -92,6 +106,7 @@ ;; Check that it's really a directory. (or (file-directory-p dir) (error "find-dired needs a directory: %s" dir)) + (setq find-dir dir) ; Save for later use (switch-to-buffer (get-buffer-create "*Find*")) ;; See if there's still a `find' running, and offer to kill @@ -124,7 +139,8 @@ ;; This really should rerun the find command, but I don't ;; have time for that. (use-local-map (append (make-sparse-keymap) (current-local-map))) - - (define-key (current-local-map) "g" 'undefined) + ;; (define-key (current-local-map) "g" 'undefined) + (set (make-local-variable 'revert-buffer-function) 'find-dired-revert) ;; Set subdir-alist so that Tree Dired will work: (if (fboundp 'dired-simple-subdir-alist) ;; will work even with nested dired format (dired-nstd.el,v 1.15 _______________________________________________ Bug-gnu-emacs mailing list Bug-gnu-emacs@gnu.org http://lists.gnu.org/mailman/listinfo/bug-gnu-emacs ------- End of forwarded message -------