emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/engine-mode bd2ea005b3 11/71: add a docstring for the defe


From: ELPA Syncer
Subject: [nongnu] elpa/engine-mode bd2ea005b3 11/71: add a docstring for the defengine macro
Date: Wed, 21 Dec 2022 09:59:00 -0500 (EST)

branch: elpa/engine-mode
commit bd2ea005b393aa2635fd5356275966d824575ec6
Author: Harry Schwartz <harry@thoughtbot.com>
Commit: Harry Schwartz <harry@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)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]