summaryrefslogtreecommitdiff
path: root/lisp/buff-menu.el
diff options
context:
space:
mode:
authorMatthias Meulien <orontee@gmail.com>2013-07-04 02:04:55 +0300
committerJuri Linkov <juri@jurta.org>2013-07-04 02:04:55 +0300
commit924494f4c00822767ec350aab7466a928c05d168 (patch)
tree2aef4459c5bc8f602e43e93464655a708e4bbcc3 /lisp/buff-menu.el
parent5aa43a3add89cc1775757fe99d4028dd9a9c30ac (diff)
downloademacs-924494f4c00822767ec350aab7466a928c05d168.tar.gz
* lisp/buff-menu.el (Buffer-menu-mode-map): Bind "M-s a C-o" to
`Buffer-menu-multi-occur'. Add it to the menu. (Buffer-menu-mode): Document it in docstring. (Buffer-menu-multi-occur): New command. Fixes: debbugs:14673
Diffstat (limited to 'lisp/buff-menu.el')
-rw-r--r--lisp/buff-menu.el11
1 files changed, 11 insertions, 0 deletions
diff --git a/lisp/buff-menu.el b/lisp/buff-menu.el
index 6c02233e1e2..1eda9f19625 100644
--- a/lisp/buff-menu.el
+++ b/lisp/buff-menu.el
@@ -129,6 +129,7 @@ commands.")
(define-key map "T" 'Buffer-menu-toggle-files-only)
(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)
+ (define-key map (kbd "M-s a C-o") 'Buffer-menu-multi-occur)
(define-key map [mouse-2] 'Buffer-menu-mouse-select)
(define-key map [follow-link] 'mouse-face)
@@ -169,6 +170,9 @@ commands.")
(bindings--define-key menu-map [ir]
'(menu-item "Isearch Marked Buffers..." Buffer-menu-isearch-buffers
:help "Search for a string through all marked buffers using Isearch"))
+ (bindings--define-key menu-map [mo]
+ '(menu-item "Multi Occur Marked Buffers..." Buffer-menu-multi-occur
+ :help "Show lines matching a regexp in marked buffers using Occur"))
(bindings--define-key menu-map [s3] menu-bar-separator)
(bindings--define-key menu-map [by]
'(menu-item "Bury" Buffer-menu-bury
@@ -226,6 +230,7 @@ In Buffer Menu mode, the following commands are defined:
buffer selected before this one in another window.
\\[Buffer-menu-isearch-buffers] Incremental search in the marked buffers.
\\[Buffer-menu-isearch-buffers-regexp] Isearch for regexp in the marked buffers.
+\\[Buffer-menu-multi-occur] Show lines matching regexp in the marked buffers.
\\[Buffer-menu-visit-tags-table] visit-tags-table this buffer.
\\[Buffer-menu-not-modified] Clear modified-flag on that buffer.
\\[Buffer-menu-save] Mark that buffer to be saved, and move down.
@@ -477,6 +482,12 @@ If UNMARK is non-nil, unmark them."
(interactive)
(multi-isearch-buffers-regexp (Buffer-menu-marked-buffers)))
+(defun Buffer-menu-multi-occur ()
+ "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))))
+
(defun Buffer-menu-visit-tags-table ()
"Visit the tags table in the buffer on this line. See `visit-tags-table'."