Wednesday, February 4, 2009

Anything - more Emacs goodies

While restructuring my emacs files for faster load times I remembered that I had not really played too much with the wonderful anything. To put it simply anything calls up a bunch of functions provides a list of results that they return. Each return element has a context sensitive action menu. So for example, I call "anything" and type "riley". Because I have the anything-c-source-bbdb plugin set I see my bbdb entries which contain "riley". Also I have anything-c-source-w3m-bookmarks so I see any w3m bookmarks containing that word. Even more useful is anything-c-source-man-pages. There are hosts of plugins out there and more being developed. Give it a go. Here's my set up:


  • (autoload 'anything "my-anything" nil t)


  • (require 'anything-extension)
  • (require 'anything-config)

  • (setq anything-sources
  • (list
  • anything-c-source-man-pages
  • anything-c-source-bbdb
  • anything-c-source-locate
  • anything-c-source-w3m-bookmarks
  • anything-c-source-occur)
  • anything-idle-delay 0.2
  • anything-samewindow t
  • anything-input-idle-delay 0.2
  • anything-candidate-number-limit 10)
  • (provide 'my-anything)
And finally a key binding and a wrapper:

  • (global-set-key (kbd "") 'rgr/anything)
  • (defun rgr/anything ()
  • "default to thing at point for anything"
  • (interactive)
  • (anything nil (region-or-word-at-point)))

No comments:

Post a Comment