Skip to content

Instantly share code, notes, and snippets.

@dryman
Created February 26, 2013 05:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dryman/5036210 to your computer and use it in GitHub Desktop.
Save dryman/5036210 to your computer and use it in GitHub Desktop.
(defun wordnet (word)
"Check word definition from WordNet command line program"
(interactive
(list (read-string "Check for word: "
(apply 'buffer-substring
(let (bounds)
(if (use-region-p)
(setq bounds (cons (region-beginning) (region-end)))
(setq bounds (bounds-of-thing-at-point 'word)))
(list (car bounds) (cdr bounds)))))))
(with-output-to-temp-buffer "*WordNet*"
(princ (shell-command-to-string (format "wn %s -over" word)))))
(global-set-key (kbd "C-c w") 'wordnet)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment