Look up a word’s definition in Emacs

Look up a word’s definition in Emacs

Here’s a quick lisp snippet I found in my .emacs. I put it together some time back and referenced this great site in the comments.

  (defun word-definition-lookup ()
"Look up the word under cursor in a browser."
(interactive)
(browse-url
(concat "http://www.google.co.in/search?hl=en&q=define%3A"
(thing-at-point 'word)))
)

The above code is called with an M-x word-definition-lookup

It causes Emacs to use google’s define keyword for the word at point. It ought to use the system’s default browser to do this.

Comments are closed.
%d bloggers like this: