Skip to content

Instantly share code, notes, and snippets.

@hitode909
Created August 20, 2011 10:50
Show Gist options
  • Save hitode909/1158955 to your computer and use it in GitHub Desktop.
Save hitode909/1158955 to your computer and use it in GitHub Desktop.
非同期に辞書を引く
(require 'cl)
(require 'deferred)
(defvar dict-bin "~/bin/dict.py"
"dict 実行ファイルのパス")
(defun my-dictionary ()
(interactive)
(lexical-let ((current-word (thing-at-point 'word)))
(when current-word
(deferred:$
(deferred:process dict-bin current-word)
(deferred:nextc it
(lambda (res) (popup-tip (concat current-word "\n" res))))))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment