Fix references to old dictionary/thesaurus lookup commands
And pass word explicitly to powerthesaurus.
This commit is contained in:
parent
f313c77ac7
commit
6938f8b97d
2 changed files with 10 additions and 3 deletions
|
@ -353,4 +353,11 @@ Otherwise, falls back on `find-file-at-point'."
|
||||||
(unless +lookup-dictionary-enable-online
|
(unless +lookup-dictionary-enable-online
|
||||||
;; TODO Implement offline synonyms backend
|
;; TODO Implement offline synonyms backend
|
||||||
(user-error "No offline dictionary implemented yet"))
|
(user-error "No offline dictionary implemented yet"))
|
||||||
(powerthesaurus-lookup-word-dwim))
|
;; Necessary because powerthesaurus lacks a way to pass text directly
|
||||||
|
(with-temp-buffer
|
||||||
|
(insert identifier)
|
||||||
|
;; HACK I'd rather use `+lookup-symbol-or-region' for consistency, but
|
||||||
|
;; powerthesaurus lacks a simple way to pass a string directly to any
|
||||||
|
;; of its lookup functions, so...
|
||||||
|
(cl-letf (((symbol-function 'use-region-p) (lambda () t)))
|
||||||
|
(powerthesaurus-lookup-word (point-min) (point-max)))))
|
||||||
|
|
|
@ -193,5 +193,5 @@ See https://github.com/magit/ghub/issues/81"
|
||||||
|
|
||||||
(when (featurep! +dictionary)
|
(when (featurep! +dictionary)
|
||||||
(define-key! text-mode-map
|
(define-key! text-mode-map
|
||||||
[remap +lookup/definition] #'+lookup/word-definition
|
[remap +lookup/definition] #'+lookup/dictionary-definition
|
||||||
[remap +lookup/references] #'+lookup/word-synonyms))
|
[remap +lookup/references] #'+lookup/synonyms))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue