Created
February 26, 2013 05:52
-
-
Save dryman/5036210 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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