Comments (2)
Hello, I combined the power of sdcv with fanyi.el:
(require 'sdcv)
(defun kimim/sdcv-translate-result-advice (word dictionary-list)
(let* ((arguments
(cons word
(mapcan
(lambda (d) (list "-u" d)) dictionary-list)))
(result (mapconcat
(lambda (result)
(let-alist result
(format
"## %s\n%s\n\n" .dict .definition)))
(apply #'sdcv-call-process arguments)
"")))
(if (string-empty-p result)
sdcv-fail-notify-string
result)))
(advice-add 'sdcv-translate-result
:override
#'kimim/sdcv-translate-result-advice)
(defun kimim/fanyi-dwim-add-sdcv (word)
(let ((buf (get-buffer fanyi-buffer-name)))
(with-current-buffer buf
(let ((inhibit-read-only t)
(inhibit-point-motion-hooks t))
;; Clear the previous search result.
(point-max)
(insert "# SDCV\n\n")
(insert
(sdcv-search-with-dictionary
word sdcv-dictionary-complete-list))
(insert "\n\n")
(beginning-of-buffer)))))
(advice-add 'fanyi-dwim :after
#'kimim/fanyi-dwim-add-sdcv)
from fanyi.el.
我在 emacs-china 上看到你发的帖子了!
from fanyi.el.
Related Issues (20)
- audio button icon not shown HOT 4
- error when lookup buttons with longman dict provider HOT 2
- [longman] certain lookup take long time HOT 3
- longman: `in` throws exception
- longman: `broadcast` throws exceptions HOT 1
- DeepL support
- wordreference support HOT 1
- 通过 M-x `fanyi-dwim2` 时单词没有出现了 `fanyi-history` 里
- Suggestion: rename fanyi-dwim2 -> fanyi-dwim-at-point HOT 2
- Too slow HOT 4
- 建议查词结果buffer保持开启,但焦点仍在阅读buffer里 HOT 14
- 建议增加生词熟词区分功能
- 可以把 libretranslate 删了?
- `start` 翻译提示错误 HOT 2
- longman backand cannot get useful information HOT 2
- dragon 出现解析失败的情况
- 有道
- 读取kill-ring HOT 2
- Remove trailing whitespace
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fanyi.el.