all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Matthias Meulien <orontee@gmail.com>
To: 14673@debbugs.gnu.org
Subject: bug#14673: Fwd: Show all lines in marked buffers matching a regexp (with patch)
Date: Thu, 20 Jun 2013 09:30:20 +0200	[thread overview]
Message-ID: <51C2AF8C.1010005@gmail.com> (raw)
In-Reply-To: <87a9mn0vxh.fsf_-_@gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1428 bytes --]

Severity: wishlist
Tags: patch


-------- Message original --------
Return-Path: <orontee@gmail.com>
Received: from choubidou.localdomain 
(jau31-3-82-239-20-84.fbx.proxad.net. [82.239.20.84])        by 
mx.google.com with ESMTPSA id ev19sm5719919wid.2.2013.06.18.17.42.47 
     for <emacs-devel@gnu.org>        (version=TLSv1.2 cipher=RC4-SHA 
bits=128/128);        Tue, 18 Jun 2013 17:42:48 -0700 (PDT)
From: Matthias Meulien <orontee@gmail.com>
To: emacs-devel@gnu.org
Subject: Show all lines in marked buffers matching a regexp (with patch)
References: <20130618.092933.35336000126336498.kazu@iij.ad.jp> 
<20130618.112719.2252126271017151770.kazu@iij.ad.jp> 
<8338sfs5ct.fsf@gnu.org> <20130619.064010.988324446963344956.kazu@iij.ad.jp>
Date: Wed, 19 Jun 2013 02:46:18 +0200
In-Reply-To: <20130619.064010.988324446963344956.kazu@iij.ad.jp> ("Kazu 
Yamamoto \=\?utf-8\?B\?KOWxseacrOWSjOW9pikiJ3M\=\?\= message of "Wed, 19 
Jun 2013 06:40:10 +0900 (JST)")
Message-ID: <87a9mn0vxh.fsf_-_@gmail.com>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux)
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="=-=-="

Don't you think the Buffer List should have a command to show all
lines in marked buffers matching a regexp?

An analog of `M-s a C-s' and `M-s a M-C-s' but using Multi Occur
in place of ISearch.

Here is a patch to lisp/buff-menu.el that adds such a command with
key binding `M-s a C-o'.
-- 
Matthias



[-- Attachment #2: 0001-Extend-buffer-menu-with-command-to-show-lines-in-mar.patch --]
[-- Type: text/x-patch, Size: 2542 bytes --]

From a4f8d342ebad3f357ba470c8e7b56a36e57c4379 Mon Sep 17 00:00:00 2001
From: Matthias Meulien <orontee@gmail.com>
Date: Wed, 19 Jun 2013 02:28:22 +0200
Subject: [PATCH] Extend buffer menu with command to show lines in marked
 buffers matching a regexp

---
 lisp/buff-menu.el | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)

diff --git a/lisp/buff-menu.el b/lisp/buff-menu.el
index 6c02233..0ac109d 100644
--- a/lisp/buff-menu.el
+++ b/lisp/buff-menu.el
@@ -129,7 +129,8 @@ 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,13 @@ 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))))
+
 \f
 (defun Buffer-menu-visit-tags-table ()
   "Visit the tags table in the buffer on this line.  See `visit-tags-table'."
-- 
1.8.3.1



[-- Attachment #3: Portion de message joint --]
[-- Type: text/plain, Size: 33 bytes --]


Comments welcome,
-- 
Matthias


  parent reply	other threads:[~2013-06-20  7:30 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-17  3:36 EXC_BAD_ACCESS on Mac Kazu Yamamoto
2013-06-17 15:03 ` Eli Zaretskii
2013-06-17 18:16   ` Kazu Yamamoto
2013-06-17 18:43     ` Eli Zaretskii
2013-06-17 19:37       ` Kazu Yamamoto
2013-06-17 19:48         ` Eli Zaretskii
2013-06-17 22:17           ` Kazu Yamamoto
2013-06-17 19:44       ` Kazu Yamamoto
2013-06-17 22:42         ` Paul Eggert
2013-06-18  0:29           ` Kazu Yamamoto
2013-06-18  2:27             ` Kazu Yamamoto
2013-06-18  2:45               ` Eli Zaretskii
2013-06-18  2:50                 ` Kazu Yamamoto
2013-06-24 21:16                   ` Jan Djärv
2013-06-25  1:30                     ` Kazu Yamamoto
2013-06-18 17:20               ` Eli Zaretskii
2013-06-18 21:40                 ` Kazu Yamamoto
2013-06-19  0:46                   ` Show all lines in marked buffers matching a regexp (with patch) Matthias Meulien
2013-06-19 21:37                     ` Juri Linkov
2013-06-20  7:30                     ` Matthias Meulien [this message]
2013-06-20 23:10                       ` bug#14673: Fwd: " Juri Linkov
2013-07-03 23:05                       ` Juri Linkov
2013-06-20  1:29                   ` EXC_BAD_ACCESS on Mac Kazu Yamamoto
2013-06-25  2:12                     ` Kazu Yamamoto
2013-06-25  4:25                       ` Kazu Yamamoto
2013-06-25 14:48                         ` Eli Zaretskii
2013-07-03  4:36                           ` Kazu Yamamoto
2013-07-03 13:27                             ` Eli Zaretskii
2013-07-03 14:19                               ` Kazu Yamamoto
2013-07-03 16:36                                 ` Eli Zaretskii
2013-07-04  1:04                                   ` Kazu Yamamoto
2013-07-04 16:06                                     ` Eli Zaretskii
2013-06-18  2:45           ` Eli Zaretskii
2013-06-18  2:48         ` Eli Zaretskii

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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=51C2AF8C.1010005@gmail.com \
    --to=orontee@gmail.com \
    --cc=14673@debbugs.gnu.org \
    /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 external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.