刚发现欧陆词典 LINUX 版很多词典要充会员才能用了,果断换回 Goldendict 了,Goldendict 很好集成:
(defun my/goldendict (&optional read)
"Translate with goldendict."
(interactive "P")
(let* ((default-word (if (member major-mode '(doc-view-mode pdf-view-mode))
nil
(if mark-active
(buffer-substring-no-properties (region-beginning) (region-end))
(current-word))))
(word (if read nil default-word)))
(when (= 0 (length word))
(setq word (read-string (concat "Translate Words: ") default-word)))
(start-process "goldendict" nil "goldendict" word)))