* lisp/buff-menu.el (Buffer-menu-multi-occur): Add args and move the
authorJuri Linkov <juri@jurta.org>
Wed, 3 Jul 2013 23:11:58 +0000 (02:11 +0300)
committerJuri Linkov <juri@jurta.org>
Wed, 3 Jul 2013 23:11:58 +0000 (02:11 +0300)
call of `occur-read-primary-args' to interactive spec.

* lisp/ibuffer.el (ibuffer-mode-map): Bind "M-s a C-o" to
`ibuffer-do-occur' like in buff-menu.el.

Fixes: debbugs:14673

etc/NEWS
lisp/ChangeLog
lisp/buff-menu.el
lisp/ibuffer.el

index f83d824..cd17d80 100644 (file)
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -218,6 +218,10 @@ The default separator is changed to allow surrounding spaces around the comma.
 
 *** Battery information via the BSD `apm' utility is now supported.
 
+** Buffer Menu
+
+*** `M-s a C-o' shows lines matching a regexp in marked buffers using Occur.
+
 ** Calendar and Diary
 
 +++
index f1b7302..8a54c5a 100644 (file)
@@ -1,3 +1,11 @@
+2013-07-03  Juri Linkov  <juri@jurta.org>
+
+       * buff-menu.el (Buffer-menu-multi-occur): Add args and move the
+       call of `occur-read-primary-args' to interactive spec.
+
+       * ibuffer.el (ibuffer-mode-map): Bind "M-s a C-o" to
+       `ibuffer-do-occur' like in buff-menu.el.  (Bug#14673)
+
 2013-07-03  Matthias Meulien  <orontee@gmail.com>
 
        * buff-menu.el (Buffer-menu-mode-map): Bind "M-s a C-o" to
index 1eda9f1..1db9b72 100644 (file)
@@ -482,11 +482,10 @@ If UNMARK is non-nil, unmark them."
   (interactive)
   (multi-isearch-buffers-regexp (Buffer-menu-marked-buffers)))
 
-(defun Buffer-menu-multi-occur ()
+(defun Buffer-menu-multi-occur (regexp &optional nlines)
   "Show all lines in marked buffers containing a match for a regexp."
-  (interactive)
-  (let ((regexp (occur-read-primary-args)))
-    (multi-occur (Buffer-menu-marked-buffers) (car regexp))))
+  (interactive (occur-read-primary-args))
+  (multi-occur (Buffer-menu-marked-buffers) regexp nlines))
 
 \f
 (defun Buffer-menu-visit-tags-table ()
index 8f7d584..a4f1820 100644 (file)
@@ -462,6 +462,7 @@ directory, like `default-directory'."
     (define-key map (kbd "M-g") 'ibuffer-jump-to-buffer)
     (define-key map (kbd "M-s a C-s") 'ibuffer-do-isearch)
     (define-key map (kbd "M-s a M-C-s") 'ibuffer-do-isearch-regexp)
+    (define-key map (kbd "M-s a C-o") 'ibuffer-do-occur)
     (define-key map (kbd "DEL") 'ibuffer-unmark-backward)
     (define-key map (kbd "M-DEL") 'ibuffer-unmark-all)
     (define-key map (kbd "* *") 'ibuffer-unmark-all)