mirror of
https://github.com/doomemacs/doomemacs
synced 2025-08-03 12:27:26 -05:00
Use powerthesaurus-lookup-word-dwim in +lookup/word-synonyms
This commit is contained in:
@ -353,18 +353,4 @@ 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"))
|
||||||
(require 'request)
|
(powerthesaurus-lookup-word-dwim))
|
||||||
(require 'powerthesaurus)
|
|
||||||
(request
|
|
||||||
(powerthesaurus-compose-url identifier)
|
|
||||||
:parser (lambda () (libxml-parse-html-region (point) (point-max)))
|
|
||||||
:headers '(("User-Agent" . "Chrome/74.0.3729.169"))
|
|
||||||
:success (cl-function
|
|
||||||
(lambda (&key data &allow-other-keys)
|
|
||||||
;; in order to allow users to quit powerthesaurus prompt
|
|
||||||
;; with C-g, we need to wrap callback with this
|
|
||||||
(with-local-quit
|
|
||||||
(funcall (powerthesaurus-choose-callback
|
|
||||||
(region-beginning) (region-end))
|
|
||||||
(powerthesaurus-pick-synonym data)
|
|
||||||
identifier))))))
|
|
||||||
|
Reference in New Issue
Block a user