Skip to content

Instantly share code, notes, and snippets.

Created October 7, 2011 15:07
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save masutaka/1270473 to your computer and use it in GitHub Desktop.
A dictionary tool which can switch commandline-dictionary-app and sdic.
(require 'sdic)
;; hg clone
(defvar dict-bin "/Users/masutaka/repository/commandline-dictionary-app/src/dict"
"a path of commandline-dictionary-app")
(defun dictionary-app (word)
"Display the meaning of word using"
(interactive (list (sdic-read-from-minibuffer)))
(set-buffer (get-buffer-create sdic-buffer-name))
(or (string= mode-name sdic-mode-name) (sdic-mode))
(setq buffer-read-only nil)
(insert (format "============================================================\n%s\n" word))
(call-process dict-bin
nil sdic-buffer-name t word
"Japanese-English" "Japanese" "Japanese Synonyms")
(setq buffer-read-only t)
(set-buffer-modified-p nil)
(sdic-display-buffer 0))
(defun my-dictionary (arg)
(interactive "P")
(if arg
(sdic-describe-word (sdic-read-from-minibuffer))
(dictionary-app (sdic-read-from-minibuffer))))
Copy link

masutaka commented Oct 7, 2011

The detail is the following.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment