tools/lookup: add +offline feature

For offline dictionary/thesaurus lookup, using wordnut and synosaurus.
This commit is contained in:
Henrik Lissner 2020-01-25 16:55:04 -05:00
parent 7cf197d8ae
commit 038e52d709
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395
4 changed files with 46 additions and 20 deletions

View file

@ -85,15 +85,15 @@ If the argument is interactive (satisfies `commandp'), it is called with
argument: the identifier at point. See `set-lookup-handlers!' about adding to
this list.")
(defvar +lookup-dictionary-enable-online t
(defvar +lookup-dictionary-prefer-offline (featurep! +offline)
"If non-nil, look up dictionaries online.
Setting this to nil will force it to use offline backends, which may be less
than perfect, but available without an internet connection.
Used by `+lookup/word-definition' and `+lookup/word-synonyms'.
Used by `+lookup/dictionary-definition' and `+lookup/synonyms'.
For `+lookup/word-definition', this is ignored on Mac, where Emacs users
For `+lookup/dictionary-definition', this is ignored on Mac, where Emacs users
Dictionary.app behind the scenes to get definitions.")
@ -196,3 +196,7 @@ See https://github.com/magit/ghub/issues/81"
(define-key! text-mode-map
[remap +lookup/definition] #'+lookup/dictionary-definition
[remap +lookup/references] #'+lookup/synonyms))
;;;###package synosaurus
(setq synosaurus-choose-method 'default) ; use ivy/helm instead of ido