changeset 96954:ad71105ebd5b

(Buffer-menu-marked-buffers) (Buffer-menu-isearch-buffers) (Buffer-menu-isearch-buffers-regexp): New functions. (Buffer-menu-mode-map): Bind "M-s a C-s" to `Buffer-menu-isearch-buffers', and "M-s a M-C-s" to `Buffer-menu-isearch-buffers-regexp'. (list-buffers-noselect): Add one space after Info file name according to the Info address convention.
author Juri Linkov <juri@jurta.org>
date Wed, 23 Jul 2008 23:52:33 +0000
parents df8cf5e076d6
children 57fc87925078
files lisp/buff-menu.el
diffstat 1 files changed, 20 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/buff-menu.el	Wed Jul 23 23:51:42 2008 +0000
+++ b/lisp/buff-menu.el	Wed Jul 23 23:52:33 2008 +0000
@@ -151,6 +151,8 @@
     (define-key map "T" 'Buffer-menu-toggle-files-only)
     (define-key map [mouse-2] 'Buffer-menu-mouse-select)
     (define-key map [follow-link] 'mouse-face)
+    (define-key map (kbd "M-s a C-s")   'Buffer-menu-isearch-buffers)
+    (define-key map (kbd "M-s a M-C-s") 'Buffer-menu-isearch-buffers-regexp)
     map)
   "Local keymap for `Buffer-menu-mode' buffers.")
 
@@ -455,6 +457,23 @@
       (other-window 1)  			;back to the beginning!
 )))
 
+(defun Buffer-menu-marked-buffers ()
+  "Return a list of buffers marked with the \\<Buffer-menu-mode-map>\\[Buffer-menu-mark] command."
+  (let (buffers)
+    (Buffer-menu-beginning)
+    (while (re-search-forward "^>" nil t)
+      (setq buffers (cons (Buffer-menu-buffer t) buffers)))
+    (nreverse buffers)))
+
+(defun Buffer-menu-isearch-buffers ()
+  "Search for a string through all marked buffers using Isearch."
+  (interactive)
+  (multi-isearch-buffers (Buffer-menu-marked-buffers)))
+
+(defun Buffer-menu-isearch-buffers-regexp ()
+  "Search for a regexp through all marked buffers using Isearch."
+  (interactive)
+  (multi-isearch-buffers-regexp (Buffer-menu-marked-buffers)))
 
 
 (defun Buffer-menu-visit-tags-table ()
@@ -778,7 +797,7 @@
 			  (t
 			   (setq file (concat "("
 					      (file-name-nondirectory file)
-					      ")"
+					      ") "
 					      Info-current-node)))))))
 		(push (list buffer bits name (buffer-size) mode file)
 		      list))))))