diff --git a/helm-dictionary.el b/helm-dictionary.el index b9bd0a8..6a09399 100644 --- a/helm-dictionary.el +++ b/helm-dictionary.el @@ -115,7 +115,7 @@ (require 'cl-lib) (require 'helm) (require 'helm-net) -(require 'helm-plugin) +(require 'helm-easymenu) (defgroup helm-dictionary nil "Helm plugin for looking up a dictionary." @@ -237,24 +237,22 @@ browser in `helm-browse-url-default-browser-alist'" (defvar helm-source-dictionary - '((name . "Search dictionary") - (candidates-file . helm-dictionary-database) - (candidate-transformer . helm-dictionary-transformer) - (action . (("Insert source language term" . helm-dictionary-insert-l1term) - ("Insert target language term" . helm-dictionary-insert-l2term))))) + (helm-build-in-file-source "Search dictionary" helm-dictionary-database + :candidate-transformer 'helm-dictionary-transformer + :action '(("Insert source language term" . helm-dictionary-insert-l1term) + ("Insert target language term" . helm-dictionary-insert-l2term)))) (defvar helm-source-dictionary-online - '((name . "Look up online") - (match (lambda (_candidate) t)) - (candidates . helm-dictionary-online-dicts) - (no-matchplugin) - (nohighlight) - (action - . (lambda (cand) - (let ((browse-url-browser-function - (or helm-dictionary-browser-function - browse-url-browser-function))) - (helm-browse-url (format cand (url-hexify-string helm-pattern))))))) + (helm-build-sync-source "Look up online" + :match (lambda (_candidate) t) + :candidates helm-dictionary-online-dicts + :matchplugin nil + :nohighlight t + :action (lambda (cand) + (let ((browse-url-browser-function + (or helm-dictionary-browser-function + browse-url-browser-function))) + (helm-browse-url (format cand (url-hexify-string helm-pattern)))))) "Source for online look-up.") ;;;###autoload