Ads by Google

Saturday, July 4, 2009

Quickly looking up words in Google through Emacs

Here is a post by Joe Fineman that outlines how to quickly look up something in Emacs.  You need to have w3m installed for it to work.  And it is indeed easier than switching to the browser and looking it up.

(defun google (what)
"Use google to search for WHAT."
(interactive "sSearch: ")
(let ((dir default-directory))
(w3m-browse-url (concat ""
(w3m-url-encode-string what)))
(cd dir)

(global-set-key "\C-Cg" 'google)