Skip to content

Commit

Permalink
Merge pull request #23 from emacs-helm/divers_improvements
Browse files Browse the repository at this point in the history
Divers improvements
  • Loading branch information
tmalsburg committed Mar 9, 2016
2 parents 2aeafba + 88c2fae commit d492904
Showing 1 changed file with 15 additions and 17 deletions.
32 changes: 15 additions & 17 deletions helm-dictionary.el
Original file line number Diff line number Diff line change
Expand Up @@ -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."
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit d492904

Please sign in to comment.