(add-to-list 'load-path "/usr/share/emacs/site-lisp/edict-el") (add-to-list 'load-path "/usr/share/emacs21/site-lisp/edict-el") (require 'edict) (setq edict-dictionaries '("/usr/share/edict/edict" "/usr/share/edict/compdic" "/usr/share/edict/enamdic")) (defun sacha/edict-search-english (word) "Looks up an English word." (interactive "MEnglish: ") (edict-search-and-display word 'english)) (defun sacha/edict-search-kanji (word) "Looks up an Japanese word." (interactive "MKanji/kana: ") (edict-init) (edict-search-and-display word 'ÆüËܸì)) (defun sacha/edict-search-example (phrase) "Look up an example." (interactive (list (read-string "Search for: " nil nil (and (point) (mark) (buffer-substring (point) (mark)))))) (with-temp-buffer (cd "/home/sachac/notebook/japan/") (let ((default-process-coding-system '(euc-jp . euc-jp))) (grep (concat "grep -i -h " (shell-quote-argument phrase) " examples* 2> /dev/null")) (save-excursion (save-window-excursion (pop-to-buffer grep-last-buffer) (goto-char (point-min)) (highlight-phrase phrase 'hi-yellow))))))