tools/lookup: add +offline feature
For offline dictionary/thesaurus lookup, using wordnut and synosaurus.
This commit is contained in:
parent
7cf197d8ae
commit
038e52d709
4 changed files with 46 additions and 20 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue