help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Binding a key to an ibuffer filter


From: etay . meiri
Subject: Re: Binding a key to an ibuffer filter
Date: Sat, 28 Feb 2009 10:49:04 -0800 (PST)
User-agent: G2/1.0

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 pm, "Drew Adams" <address@hidden> 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 ()
> >   (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 not a
> command. A command in Emacs is a function that has an `interactive' spec. So 
> do
> this:
>
> (defun ibuffer-display-source-files ()
>   (interactive) ; <==== MISSING
>   (ibuffer-switch-to-saved-filter "c"))
>
> Consider also adding a doc string, for your users. ;-)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]