changeset 96964:bd2850789ce2

(vc-dir-search, vc-dir-isearch) (vc-dir-isearch-regexp): New functions. (vc-dir-mode-map, vc-dir-menu-map): Bind them.
author Dan Nicolaescu <dann@ics.uci.edu>
date Thu, 24 Jul 2008 02:39:04 +0000
parents 4abff057d348
children 545e75d84073
files lisp/ChangeLog lisp/vc-dir.el
diffstat 2 files changed, 25 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/ChangeLog	Thu Jul 24 01:57:24 2008 +0000
+++ b/lisp/ChangeLog	Thu Jul 24 02:39:04 2008 +0000
@@ -1,7 +1,8 @@
 2008-07-24  Dan Nicolaescu  <dann@ics.uci.edu>
 
-	* vc-dir.el (vc-dir-search): New function.
-	(vc-dir-mode-map, vc-dir-menu-map): Bind it.
+	* vc-dir.el (vc-dir-search, vc-dir-isearch)
+	(vc-dir-isearch-regexp): New functions.
+	(vc-dir-mode-map, vc-dir-menu-map): Bind them.
 
 2008-07-23  Juri Linkov  <juri@jurta.org>
 
--- a/lisp/vc-dir.el	Thu Jul 24 01:57:24 2008 +0000
+++ b/lisp/vc-dir.el	Thu Jul 24 02:39:04 2008 +0000
@@ -157,11 +157,17 @@
 
     (define-key map [sepopn] '("--"))
     (define-key map [qr]
-      '(menu-item "Query Replace in Files" vc-dir-query-replace-regexp
+      '(menu-item "Query Replace in Files..." vc-dir-query-replace-regexp
 		  :help "Replace a string in the marked files"))
     (define-key map [se]
-      '(menu-item "Search Files" vc-dir-search
+      '(menu-item "Search Files..." vc-dir-search
 		  :help "Search a regexp in the marked files"))
+    (define-key map [ires]
+      '(menu-item "Isearch Regexp Files..." vc-dir-isearch-regexp
+		  :help "Incremental search a regexp in the marked files"))
+    (define-key map [ise]
+      '(menu-item "Isearch Files..." vc-dir-isearch
+		  :help "Incremental search a string in the marked files"))
     (define-key map [open-other]
       '(menu-item "Open in other window" vc-dir-find-file-other-window
 		  :help "Find the file on the current line, in another window"))
@@ -255,6 +261,8 @@
     (define-key map "x" 'vc-dir-hide-up-to-date)
     (define-key map "S" 'vc-dir-search) ;; FIXME: Maybe use A like dired?
     (define-key map "Q" 'vc-dir-query-replace-regexp)
+    (define-key map (kbd "M-s a C-s")   'vc-dir-isearch)
+    (define-key map (kbd "M-s a M-C-s") 'vc-dir-isearch-regexp)
 
     ;; Hook up the menu.
     (define-key map [menu-bar vc-dir-mode]
@@ -683,6 +691,18 @@
   (interactive)
   (find-file-other-window (vc-dir-current-file)))
 
+(defun vc-dir-isearch ()
+  "Search for a string through all marked buffers using Isearch."
+  (interactive)
+  (multi-isearch-files
+   (mapcar 'car (vc-dir-marked-only-files-and-states))))
+
+(defun vc-dir-isearch-regexp ()
+  "Search for a regexp through all marked buffers using Isearch."
+  (interactive)
+  (multi-isearch-files-regexp
+   (mapcar 'car (vc-dir-marked-only-files-and-states))))
+
 (defun vc-dir-search (regexp)
   "Search through all marked files for a match for REGEXP.
 For marked directories, use the files displayed from those directories.