From: jari.aalto@cante.net (Jari+mail.emacs)
Subject: [patch] 21.3 find-dired.el - Add 'g' key to repeat last find command
Date: Fri, 21 Jan 2005 10:02:42 +0200 [thread overview]
Message-ID: <d5vzqkf1.fsf@blue.sea.net> (raw)
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 <jari dot aalto A T cante dot net>
* 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
next reply other threads:[~2005-01-21 8:02 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-01-21 8:02 Jari+mail.emacs [this message]
-- strict thread matches above, loose matches on Subject: below --
2005-01-21 21:50 [patch] 21.3 find-dired.el - Add 'g' key to repeat last find command Luc Teirlinck
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=d5vzqkf1.fsf@blue.sea.net \
--to=jari.aalto@cante.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).