From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Drew Adams" Newsgroups: gmane.emacs.help Subject: RE: Binding a key to an ibuffer filter Date: Sat, 28 Feb 2009 11:54:30 -0800 Message-ID: <001301c999de$5f444970$0200a8c0@us.oracle.com> References: <94c16c01-05fe-49d7-bbf9-bca2fd8d3113@d19g2000yqb.googlegroups.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1235850893 12987 80.91.229.12 (28 Feb 2009 19:54:53 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 28 Feb 2009 19:54:53 +0000 (UTC) To: , Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sat Feb 28 20:56:09 2009 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1LdVI8-0001OA-Mi for geh-help-gnu-emacs@m.gmane.org; Sat, 28 Feb 2009 20:56:08 +0100 Original-Received: from localhost ([127.0.0.1]:36164 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LdVGn-0007Tm-88 for geh-help-gnu-emacs@m.gmane.org; Sat, 28 Feb 2009 14:54:45 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LdVGR-0007SY-KK for help-gnu-emacs@gnu.org; Sat, 28 Feb 2009 14:54:23 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LdVGQ-0007Qx-D2 for help-gnu-emacs@gnu.org; Sat, 28 Feb 2009 14:54:23 -0500 Original-Received: from [199.232.76.173] (port=53555 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LdVGQ-0007Qq-AN for help-gnu-emacs@gnu.org; Sat, 28 Feb 2009 14:54:22 -0500 Original-Received: from acsinet11.oracle.com ([141.146.126.233]:50424) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1LdVGP-0008KV-Py for help-gnu-emacs@gnu.org; Sat, 28 Feb 2009 14:54:22 -0500 Original-Received: from acsinet13.oracle.com (acsinet13.oracle.com [141.146.126.235]) by acsinet11.oracle.com (Switch-3.3.1/Switch-3.3.1) with ESMTP id n1SJslr3028796 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Sat, 28 Feb 2009 19:54:49 GMT Original-Received: from acsmt704.oracle.com (acsmt704.oracle.com [141.146.40.82]) by acsinet13.oracle.com (Switch-3.3.1/Switch-3.3.1) with ESMTP id n1SJsQfi030064; Sat, 28 Feb 2009 19:54:27 GMT Original-Received: from dradamslap1 (/141.144.72.79) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Sat, 28 Feb 2009 11:54:14 -0800 X-Mailer: Microsoft Office Outlook 11 Thread-Index: AcmZ3LLlQwKTm8KOQ2KHTFxCMegYaQAALLjg In-Reply-To: <94c16c01-05fe-49d7-bbf9-bca2fd8d3113@d19g2000yqb.googlegroups.com> X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3350 X-Source-IP: acsmt704.oracle.com [141.146.40.82] X-Auth-Type: Internal IP X-CT-RefId: str=0001.0A09020A.49A99667.028B:SCFSTAT928724,ss=1,fgs=0 X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 1) X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:62484 Archived-At: > > > I'm trying to bind a key to a filter in ibuffer-mode. I created a > > > filter to display only C/C++ source files and it works ok=20 > > > manually (I can switch to it using > > > ibuffer-switch-to-saved-filter). I also added > > > the following code to .emacs: > > > > > (defun ibuffer-display-source-files () > > > =A0 (ibuffer-switch-to-saved-filters "c")) > > > > > (define-key ibuffer-mode-map [f1] 'ibuffer-display-source-files) > > > > > However, when I click F1 in ibuffer I get the following error: > > > > > Wrong type argument: commandp, ibuffer-display-source-files > > > > > Any idea? > > > > The error message is telling you that=20 > > `ibuffer-display-source-files' is not a > > command. A command in Emacs is a function that has an=20 > > `interactive' spec. So do this: > > > > (defun ibuffer-display-source-files () > > =A0 (interactive) ; <=3D=3D=3D=3D MISSING > > =A0 (ibuffer-switch-to-saved-filter "c")) > > > > Consider also adding a doc string, for your users. ;-)> Thanks a = lot. > > Looks like some progress was made. > Now when I click F1 I get an error: "Symbol's function definition is > void: c" >=20 > My filter definition is as follow: > '(ibuffer-saved-filters (quote (("c" ((mode . c++-mode))) ("gnus" ((or > (mode . message-mode) (mode . mail-mode) (mode . gnus-group-mode) > (mode . gnus-summary-mode) (mode . gnus-article-mode)))) > ("programming" ((or (mode . emacs-lisp-mode) (mode . cperl-mode) > (mode . c-mode) (mode . java-mode) (mode . idl-mode) (mode . lisp- > mode))))))) >=20 > And I'm calling the switch function using: > (ibuffer-switch-to-saved-filters "c") > Maybe I'm not passing the parameter correctly? I'm not familiar with Ibuffer; perhaps someone else can help here. The = error message is telling you that `c' is not a function. If someone else doesn't have a suggestion, try: (1) loading the source = files (e.g. ibuf-ext.el), not the byte-compiled files (e.g. ibuf-ext.elc), and = then (2) `M-x debug-on-entry RET ibuffer-switch-to-saved-filters'. Then step = through the debugger using `d' and `c', to see where the problem is.