From 68191e741957004479a217c191ce053a3a038a72 Mon Sep 17 00:00:00 2001 From: "Itai Y. Efrat" Date: Wed, 4 May 2022 09:40:24 +0300 Subject: [PATCH] fix(lookup): check ivy|helm-mode before using their backends --- modules/tools/lookup/autoload/online.el | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/tools/lookup/autoload/online.el b/modules/tools/lookup/autoload/online.el index 69696721e..15a5f7483 100644 --- a/modules/tools/lookup/autoload/online.el +++ b/modules/tools/lookup/autoload/online.el @@ -74,12 +74,12 @@ QUERY must be a string, and PROVIDER must be a key of ;;;###autoload (defun +lookup--online-backend-google (query) "Search Google, starting with QUERY, with live autocompletion." - (cond ((fboundp 'counsel-search) + (cond ((and (bound-and-true-p ivy-mode) (fboundp 'counsel-search)) (let ((ivy-initial-inputs-alist `((t . ,query))) (counsel-search-engine 'google)) (call-interactively #'counsel-search) t)) - ((require 'helm-net nil t) + ((and (bound-and-true-p helm-mode) (require 'helm-net nil t)) (helm :sources 'helm-source-google-suggest :buffer "*helm google*" :input query) @@ -88,7 +88,7 @@ QUERY must be a string, and PROVIDER must be a key of ;;;###autoload (defun +lookup--online-backend-duckduckgo (query) "Search DuckDuckGo, starting with QUERY, with live autocompletion." - (cond ((fboundp 'counsel-search) + (cond ((and (bound-and-true-p ivy-mode) (fboundp 'counsel-search)) (let ((ivy-initial-inputs-alist `((t . ,query))) (counsel-search-engine 'ddg)) (call-interactively #'counsel-search)