diff --git a/modules/tools/lookup/autoload/lookup.el b/modules/tools/lookup/autoload/lookup.el index 7ed72136d..270b39227 100644 --- a/modules/tools/lookup/autoload/lookup.el +++ b/modules/tools/lookup/autoload/lookup.el @@ -353,4 +353,11 @@ 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")) - (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))))) diff --git a/modules/tools/lookup/config.el b/modules/tools/lookup/config.el index 017619f84..f441031ea 100644 --- a/modules/tools/lookup/config.el +++ b/modules/tools/lookup/config.el @@ -193,5 +193,5 @@ See https://github.com/magit/ghub/issues/81" (when (featurep! +dictionary) (define-key! text-mode-map - [remap +lookup/definition] #'+lookup/word-definition - [remap +lookup/references] #'+lookup/word-synonyms)) + [remap +lookup/definition] #'+lookup/dictionary-definition + [remap +lookup/references] #'+lookup/synonyms))