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

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

[nongnu] elpa/engine-mode 870704f436 1/2: Add an example of a conditiona


From: ELPA Syncer
Subject: [nongnu] elpa/engine-mode 870704f436 1/2: Add an example of a conditional transformation
Date: Sat, 1 Jul 2023 18:59:08 -0400 (EDT)

branch: elpa/engine-mode
commit 870704f436eeee332011608a024ba74efee62e31
Author: Nacho Barrientos <nacho.barrientos@cern.ch>
Commit: Nacho Barrientos <nacho.barrientos@cern.ch>

    Add an example of a conditional transformation
---
 README.org | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/README.org b/README.org
index a77a811a46..c3ba88cad5 100644
--- a/README.org
+++ b/README.org
@@ -148,6 +148,20 @@ Or, to ensure that all your queries are encoded as latin-1:
     :keybinding "c")
 #+end_src
 
+Some search engines support querying for exact phrases by enclosing
+the search string into double quotes. Transformations could be useful
+in this case to perform a literal search instead if the universal
+argument is present:
+
+#+begin_src emacs-lisp
+  (defengine duckduckgo
+    "https://duckduckgo.com/?q=%s";
+    :term-transformation-hook (lambda (term) (if current-prefix-arg (concat 
"\"" term "\"") term)))
+#+end_src
+
+The above is especially beneficial when searching for the contents of
+the region.
+
 ** Importing keyword searches from other browsers
 
 Since many browsers save keyword searches using the same format as engine-mode



reply via email to

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