From 49fd3bad9ba1dac376d8021fc2ad59b42bbaaf70 Mon Sep 17 00:00:00 2001 From: 10sr <8slashes+git@gmail.com> Date: Sat, 18 Jan 2014 23:21:59 +0900 Subject: [PATCH] set ilookup-alist for me --- emacs.el | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/emacs.el b/emacs.el index 8f4e0fa..7a5e091 100644 --- a/emacs.el +++ b/emacs.el @@ -2338,8 +2338,6 @@ this is test, does not rename files." ;; TODO: enter to lookup word at point -;; TODO: enter on prompt to wait for output of command - (defvar ilookup-prompt ">>> " "Prompt string for ilookup input.") @@ -2414,6 +2412,20 @@ Each element should be in the form of (NAME . FUNCTION). FUNCTION must accept one argument as word to search and return the string of result for that word.") +(setq ilookup-alist + '( + ("en" . (lambda (word) + (shell-command-to-string + (format "sdcv -n -u dictd_www.dict.org_gcide '%s'" + word)))) + ("ja" . (lambda (word) + (shell-command-to-string + (format "sdcv -n -u jmdict-en-ja '%s'" + word)))) + )) + +(setq ilookup-default "ja") + (defun ilookup--timer-add () "Entry idle timer for ilookup." (and (eq ilookup-buffer @@ -2463,8 +2475,11 @@ This function insert newline if required." (not (eq ilookup--last-input input)) outpoint - (let* ((inputl (split-string input + (let* ( + ;; colon sepatated list of input + (inputl (split-string input ":")) + ;; funcname for `ilookup-alist' (fname (if (eq (length inputl) 2) (car inputl)