Created
August 20, 2011 10:50
Revisions
-
hitode909 revised this gist
Aug 20, 2011 . 2 changed files with 22 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,15 @@ #!/usr/bin/python2.5 import sys from DictionaryServices import * def main(): word = sys.argv[1].decode('utf-8') result = DCSCopyTextDefinition(None, word, (0, len(word))) if result: print result.encode('utf-8') else: print "nil" if __name__ == '__main__': main() This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -1,3 +1,10 @@ ;; 非同期に辞書を引く ;; ;; (+ "http://d.hatena.ne.jp/a666666/20100529/1275138722" ;; "http://sakito.jp/mac/dictionary.html" ;; "http://d.hatena.ne.jp/tomoya/20091218/1261138091" ;; "http://d.hatena.ne.jp/tomoya/20100103/1262482873") (require 'cl) (require 'deferred) -
hitode909 created this gist
Aug 20, 2011 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,14 @@ (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))))))))