branch: elpa/engine-mode commit f8540c99821a0ef43796bcd49c374e4bee202257 Author: Harry Schwartz <he...@harryrschwartz.com> Commit: Harry Schwartz <he...@harryrschwartz.com>
get search term through interactive --- engine-mode.el | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/engine-mode.el b/engine-mode.el index 065af62421..c72be1c437 100644 --- a/engine-mode.el +++ b/engine-mode.el @@ -86,12 +86,13 @@ (quote ,(engine/function-name engine-name))))) (defmacro defengine (engine-name search-engine-url &optional keybinding) - (let ((evaled-engine-name engine-name)) - `(progn (defun ,(engine/function-name evaled-engine-name) () + (let ((evaled-engine-name engine-name) + (search-term (gensym))) + `(progn (defun ,(engine/function-name evaled-engine-name) (,search-term) ,(engine/docstring evaled-engine-name) - (interactive ) - (engine/execute-search ,search-engine-url - (engine/get-query ,(symbol-name evaled-engine-name)))) + (interactive + (list (engine/get-query ,(symbol-name evaled-engine-name)))) + (engine/execute-search ,search-engine-url ,search-term)) ,(engine/bind-key evaled-engine-name keybinding)))) (provide 'engine-mode)