From 56ef4d8800c6eb124d30d8b9bfd7719d85ec877e Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Thu, 2 Jan 2020 19:52:10 -0500 Subject: [PATCH] Use powerthesaurus-lookup-word-dwim in +lookup/word-synonyms --- modules/tools/lookup/autoload/lookup.el | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/modules/tools/lookup/autoload/lookup.el b/modules/tools/lookup/autoload/lookup.el index ceba1552b..9e21437e6 100644 --- a/modules/tools/lookup/autoload/lookup.el +++ b/modules/tools/lookup/autoload/lookup.el @@ -353,18 +353,4 @@ Otherwise, falls back on `find-file-at-point'." (unless +lookup-dictionary-enable-online ;; TODO Implement offline synonyms backend (user-error "No offline dictionary implemented yet")) - (require 'request) - (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)))))) + (powerthesaurus-lookup-word-dwim))