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 17:24:58 +0200 Message-ID: References: <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 1335021939 26165 80.91.229.3 (21 Apr 2012 15:25:39 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sat, 21 Apr 2012 15:25:39 +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 17:25: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 1SLcBs-0003Jq-TX for geb-bug-gnu-emacs@m.gmane.org; Sat, 21 Apr 2012 17:25:37 +0200 Original-Received: from localhost ([::1]:54000 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SLcBr-00086g-Te for geb-bug-gnu-emacs@m.gmane.org; Sat, 21 Apr 2012 11:25:35 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:41938) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SLcBp-00086a-Iv for bug-gnu-emacs@gnu.org; Sat, 21 Apr 2012 11:25:34 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SLcBn-0002pv-Ml for bug-gnu-emacs@gnu.org; Sat, 21 Apr 2012 11:25:33 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:44782) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SLcBn-0002pr-H6 for bug-gnu-emacs@gnu.org; Sat, 21 Apr 2012 11:25:31 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1SLcCI-0002ty-0Z for bug-gnu-emacs@gnu.org; Sat, 21 Apr 2012 11:26: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 15:26:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 11295 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 11295-submit@debbugs.gnu.org id=B11295.133502193911124 (code B ref 11295); Sat, 21 Apr 2012 15:26:01 +0000 Original-Received: (at 11295) by debbugs.gnu.org; 21 Apr 2012 15:25:39 +0000 Original-Received: from localhost ([127.0.0.1]:45814 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SLcBv-0002tI-DC for submit@debbugs.gnu.org; Sat, 21 Apr 2012 11:25:39 -0400 Original-Received: from mail-wg0-f46.google.com ([74.125.82.46]:54191) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SLcBs-0002t3-RI for 11295@debbugs.gnu.org; Sat, 21 Apr 2012 11:25:38 -0400 Original-Received: by wgbdq11 with SMTP id dq11so11044932wgb.15 for <11295@debbugs.gnu.org>; Sat, 21 Apr 2012 08:25:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=content-type:mime-version:subject:from:in-reply-to:date :content-transfer-encoding:message-id:references:to:x-mailer; bh=ink8UyWk0MI66yAoL7lPX5W7Ohiz6uvA3HTlY5D8wIk=; b=S/wY0momgYIoEwj6B7KiDiN5Xvyv+oJim+x6giOq/fyJfpLwyyzla8HP6i2CUJw8AA 2TXRoPEoCpsCmkvx5jOrA4sKQqfhaaLZHDzNDdr+0ed5AHg6dhiOpXEbVZhTqcof1fyS xzpaOUkfT13XRXPRFH6LlxaiuLJNKznZNw8vIFhIBJWVTJ+rLcFZnRjhsvrtqdOpznZP h5d79D787OCmP9fDzKZ73uYJU+FFdEFfQv3LIgIwzJrhvjAT/vNksg0kVVcfs3NObzlM M2AJ5pKd4x49cXZ62QQDKbJwOU+H+oi+Nn+zas2t7l/49+5UFn9gQjchlwWiMeumLfA6 F06Q== Original-Received: by 10.180.103.35 with SMTP id ft3mr6842215wib.0.1335021900250; Sat, 21 Apr 2012 08:25:00 -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 ff9sm6627923wib.2.2012.04.21.08.24.58 (version=SSLv3 cipher=OTHER); Sat, 21 Apr 2012 08:24:59 -0700 (PDT) In-Reply-To: X-Mailer: Apple Mail (2.1084) 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:59358 Archived-At: On Apr 21, 2012, at 4:24 PM, Stefan Monnier wrote: >> (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))) >=20 > This completion table doesn't sound very good. Much better would be = to > collect all major modes in use and all their parents. That is a much better idea. As I said, I just copy/pasted without = thinking too much. My main use case is for = `ibuffer-saved-filter-groups' so completion doesn't matter at all there. >> 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))) >=20 > Why not use (with-current-buffer buf (derived-mode-p parent))? Uh. That would have been too easy. :-) > Another question: couldn't it simply *replace* the existing mode = filter? > I guess it could be a bit annoying if you want to see fundamental-mode > buffers (since most modes derive from it), but that's the only = downside > I can think of. I thought about it, but I do in fact filter by fundamental-mode (and a = few other modes) to hide "useless" buffers. =20 -Ivan=