我在用 sdcv
这个辞典包,配置好后查词很方便,现在想实现一个功能,查词后把查的词作为标题,解析作为内容导出到一个 org
文件里。
我绑定的是 sdcv-search-pointer+
这个方法。
(defun sdcv-search-pointer+ ()
"Translate word at point.
Show information using tooltip. This command uses
`sdcv-dictionary-simple-list'."
(interactive)
;; Display simple translate result.
(sdcv-search-simple))
(defun sdcv-search-simple (&optional word)
"Search WORD simple translate result."
(when (ignore-errors (require 'posframe))
(let ((result (sdcv-search-with-dictionary word sdcv-dictionary-simple-list)))
;; Show tooltip at point if word fetch from user cursor.
(posframe-show
sdcv-tooltip-name
:string result
:position (if (derived-mode-p 'eaf-mode) (mouse-absolute-pixel-position) (point))
:timeout sdcv-tooltip-timeout
:background-color (face-attribute 'sdcv-tooltip-face :background)
:foreground-color (face-attribute 'sdcv-tooltip-face :foreground)
:internal-border-width sdcv-tooltip-border-width
:tab-line-height 0
:header-line-height 0)
(unwind-protect
(push (read-event " ") unread-command-events)
(posframe-delete sdcv-tooltip-name)))))
如何把 sdcv-search-simple
的值输出到按照格式输出到一个指定的 org
文件里呢?