branch: elpa/engine-mode commit bd2ea005b393aa2635fd5356275966d824575ec6 Author: Harry Schwartz <ha...@thoughtbot.com> Commit: Harry Schwartz <ha...@thoughtbot.com>
add a docstring for the defengine macro --- engine-mode.el | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/engine-mode.el b/engine-mode.el index 8227b14263..7f9bb88f04 100644 --- a/engine-mode.el +++ b/engine-mode.el @@ -87,6 +87,23 @@ (quote ,(engine/function-name engine-name))))) (defmacro defengine (engine-name search-engine-url &optional keybinding) + "Define a custom search engine. + +`engine-name' is a symbol naming the engine. +`search-engine-url' is the url to be queried, with a \"%s\" +standing in for the search term. +The optional value `keybinding' is a string describing the key to +bind the new function. + +For example, to search Wikipedia, use: + + (defengine wikipedia + \"http://www.wikipedia.org/search-redirect.php?language=en&go=Go&search=%s\" + \"C-c / w\") + +Hitting \"C-c / w\" will be bound to the newly-defined +`engine/search-wikipedia' function." + (assert (symbolp engine-name)) `(prog1 (defun ,(engine/function-name engine-name) (search-term)