From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: etay.meiri@gmail.com Newsgroups: gmane.emacs.help Subject: Re: Binding a key to an ibuffer filter Date: Sat, 28 Feb 2009 10:49:04 -0800 (PST) Organization: http://groups.google.com Message-ID: <94c16c01-05fe-49d7-bbf9-bca2fd8d3113@d19g2000yqb.googlegroups.com> References: 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 1235850074 10772 80.91.229.12 (28 Feb 2009 19:41:14 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 28 Feb 2009 19:41:14 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sat Feb 28 20:42:31 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 1LdV4w-0005WP-3y for geh-help-gnu-emacs@m.gmane.org; Sat, 28 Feb 2009 20:42:30 +0100 Original-Received: from localhost ([127.0.0.1]:41391 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LdV3b-0006pA-0n for geh-help-gnu-emacs@m.gmane.org; Sat, 28 Feb 2009 14:41:07 -0500 Original-Path: news.stanford.edu!newsfeed.stanford.edu!postnews.google.com!d19g2000yqb.googlegroups.com!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 56 Original-NNTP-Posting-Host: 89.138.115.216 Original-X-Trace: posting.google.com 1235846944 14435 127.0.0.1 (28 Feb 2009 18:49:04 GMT) Original-X-Complaints-To: groups-abuse@google.com Original-NNTP-Posting-Date: Sat, 28 Feb 2009 18:49:04 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: d19g2000yqb.googlegroups.com; posting-host=89.138.115.216; posting-account=aYPwpgoAAABJuXxIZDkDtoDErg2phi4C User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.0.6) Gecko/2009020410 Fedora/3.0.6-1.fc10 Firefox/3.0.6, gzip(gfe), gzip(gfe) Original-Xref: news.stanford.edu gnu.emacs.help:167182 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:62483 Archived-At: 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" 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))))))) And I'm calling the switch function using: (ibuffer-switch-to-saved-filters "c") Maybe I'm not passing the parameter correctly? Thanks, -Etay On Feb 28, 7:50=A0pm, "Drew Adams" wrote: > > 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 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 `ibuffer-display-source-files' is n= ot a > command. A command in Emacs is a function that has an `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. ;-)