From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Ivan Andrus Newsgroups: gmane.emacs.bugs Subject: bug#11295: 24.0.95; New ibuffer filter derived-mode Date: Sat, 21 Apr 2012 13:11:35 +0200 Message-ID: <5DACA6C4-9C85-4464-B488-5FEEB6919839@gmail.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1335006760 26391 80.91.229.3 (21 Apr 2012 11:12:40 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sat, 21 Apr 2012 11:12:40 +0000 (UTC) To: 11295@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Apr 21 13:12:39 2012 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1SLYF4-0005zm-UV for geb-bug-gnu-emacs@m.gmane.org; Sat, 21 Apr 2012 13:12:39 +0200 Original-Received: from localhost ([::1]:52897 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SLYF4-00028a-4A for geb-bug-gnu-emacs@m.gmane.org; Sat, 21 Apr 2012 07:12:38 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:55261) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SLYF1-00027J-6i for bug-gnu-emacs@gnu.org; Sat, 21 Apr 2012 07:12:36 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SLYEz-0002jy-7y for bug-gnu-emacs@gnu.org; Sat, 21 Apr 2012 07:12:34 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:44124) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SLYEz-0002jq-22 for bug-gnu-emacs@gnu.org; Sat, 21 Apr 2012 07:12:33 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1SLYFR-0004Yy-Va for bug-gnu-emacs@gnu.org; Sat, 21 Apr 2012 07:13:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Ivan Andrus Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 21 Apr 2012 11:13:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 11295 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.133500674517491 (code B ref -1); Sat, 21 Apr 2012 11:13:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 21 Apr 2012 11:12:25 +0000 Original-Received: from localhost ([127.0.0.1]:45158 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SLYEr-0004Y3-3S for submit@debbugs.gnu.org; Sat, 21 Apr 2012 07:12:25 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:41813) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SLYEo-0004Xo-Dm for submit@debbugs.gnu.org; Sat, 21 Apr 2012 07:12:23 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SLYED-0002b3-SR for submit@debbugs.gnu.org; Sat, 21 Apr 2012 07:11:47 -0400 Original-Received: from lists.gnu.org ([208.118.235.17]:44529) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SLYED-0002au-Ma for submit@debbugs.gnu.org; Sat, 21 Apr 2012 07:11:45 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:48615) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SLYEB-00022T-Uy for bug-gnu-emacs@gnu.org; Sat, 21 Apr 2012 07:11:45 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SLYE9-0002ZM-0s for bug-gnu-emacs@gnu.org; Sat, 21 Apr 2012 07:11:43 -0400 Original-Received: from mail-wi0-f169.google.com ([209.85.212.169]:41357) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SLYE8-0002Ye-Ny for bug-gnu-emacs@gnu.org; Sat, 21 Apr 2012 07:11:40 -0400 Original-Received: by wibhm17 with SMTP id hm17so1302356wib.0 for ; Sat, 21 Apr 2012 04:11:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:content-type:content-transfer-encoding:subject:date:message-id :to:mime-version:x-mailer; bh=Di8LWDmgdL1Kpfebh0hJTs5FTVmOC0b4aY65SHU4Rcg=; b=XVmirM6wzyqx/2s+oAwCnT5ErgpJa6KXfYospOjDVWi2Zt+lRZQVSu93dPzdkVPh39 alIXCkVPdOwz1MUDAGmX/f+1LM0+UeOz2qjvhditALfSZ3639rPucvnFrqqmNU5VsoDi xqZAG4dRTDwm//wpHXnsqsH8mZtMEzTu88tIaRBTb7iisO6LpJ9otHTsbL+aQSNk3zTm iHcAAzmNP0QUuTnLLuW13zT1midcI1Lhny1vq8H9+6CDhn3eBCaWjikjXBPqo/woFdBd HVHl2GtbiMM0UbIIsxTF6+7g5EoPJeyeO25MEkQiAtZPghZdIEbrmUW5t6/iW+DVbJ8O N5sA== Original-Received: by 10.180.95.34 with SMTP id dh2mr5393901wib.15.1335006698046; Sat, 21 Apr 2012 04:11:38 -0700 (PDT) Original-Received: from [10.0.2.16] (catv-80-99-177-93.catv.broadband.hu. [80.99.177.93]) by mx.google.com with ESMTPS id ca3sm4863576wib.6.2012.04.21.04.11.36 (version=SSLv3 cipher=OTHER); Sat, 21 Apr 2012 04:11:37 -0700 (PDT) X-Mailer: Apple Mail (2.1084) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:59354 Archived-At: I have often wished to be able to use derived-mode instead of mode when filtering in ibuffer. This allows, for example, grouping all make files without specifying each variant make file mode individually. I finally looked into adding this and it's very easy. I have attached one possible implemention below. I feel it's definitely a trivial addition (I don't have papers on file with the FSF) since it consists mostly of copy/paste from `derived-mode-p' and the `mode' ibuffer-filter. If, however, you disagree that it's not trivial, please reimplement as needed. You can also contact me about papers, though it seems like a lot of work for such a small addition. (define-ibuffer-filter derived-mode "Toggle current view to buffers whose major mode inherits from = QUALIFIER." (:description "major mode" :reader (intern (completing-read "Filter by major mode: " obarray #'(lambda (e) (string-match "-mode$" (symbol-name e))) t (let ((buf = (ibuffer-current-buffer))) (if (and buf (buffer-live-p buf)) (symbol-name = (buffer-local-value 'major-mode buf)) ""))))) (let ((parent (buffer-local-value 'major-mode buf))) (while (and (not (eq parent qualifier)) (setq parent (get parent 'derived-mode-parent)))) (eq parent qualifier))) In GNU Emacs 24.0.95.1 (i386-apple-darwin10.8.0, NS = apple-appkit-1038.36) of 2012-04-07 on oroszlan.local