1 ;; If you want to use dictcn-script in emacs,
2 ;; put this file into your load-path and the following into your
5 ;; (define-key global-map (kbd "C-c d") 'dictcn-lookup)
8 (defun dictcn-lookup (pronounce-p)
9 "Prompt for a word to look up in dict.cn.
10 When provided with a prefix argument, pronounce the word
11 `sdcv-dictionary-list' before search."
13 (let* ((guess (or (and transient-mark-mode mark-active
14 (buffer-substring-no-properties
17 (current-word nil t
)))
18 (word (read-string (format "dict.cn (default: %s): " guess
)
20 (shell-command (concat "dictcn -w \"" word
"\"" (if pronounce-p
" -p " ""))