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

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

Re: ;;; anything.el --- open anything


From: Mathias Dahl
Subject: Re: ;;; anything.el --- open anything
Date: Mon, 25 Jun 2007 10:12:38 +0200
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1 (windows-nt)

"address@hidden" <address@hidden> writes:

> This is a prototype for an idea I've been contemplating for a while.
> When I want to open something I often find it cumbersome that I have
> to specify *what* I want to open. Why not just type something and
> emacs show me everything it can offer (configurable) and I simply
> select something and let emacs worry about how to open it (files,
> buffers, manual pages, etc.).

Hehe, I have been thinking of such a thing for quite a while and
started doing a small proof of concept just some weeks ago, mostly to
see how the "completion buffer" could look. I probably wouldn't have
finished it... And now, out of the blue, this hack! You just solved
the problem for me! :)

I changed the sources to suit my needs better, adding recentf history
and bookmarks:

(setq anything-sources '(((name . "Buffers")
                            (candidates . anything-buffer-list)
                            (action . switch-to-buffer))

                           ((name . "File Name History")
                            (candidates . file-name-history)
                            (action . find-file))

                           ((name . "Recentf History")
                            (candidates . recentf-list)
                            (action . find-file))

                           ((name . "Bookmarks")
                            (candidates . bookmark-all-names)
                            (action . bookmark-jump))

                           ((name . "Files from Current Directory")
                            (candidates . (lambda ()
                                            (directory-files ".")))
                            (action . find-file))))

I might also try to extend it to find my Jabber buddies and start
chatting with them.

Will this work with interactive action functions as well? I can see
how that could be useful sometimes.

One idea I had when thinking about my hack was to have some
keybindings for jumping to the next group of hits, to the next
source. Maybe that is something you want to look into?

Also, my idea was to format the hit list by indenting each hit, to
make it easier to find the relevant source:

Buffers
 some buffer 1
 some buffer 2

File Name History
 some file 1
 some file 2

Maybe you could try and see how that looks with your code as well?

Anyway, thanks for a really cool hack!

/Mathias

PS. This could probably be extended to be something very similar to
QuickSilver.


reply via email to

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