[wiki] [sites] Fixed overzealous deletions (oops), added explanatory comment || Wolfgang Corcoran-Mathe

From: <git_AT_suckless.org>
Date: Tue, 19 Aug 2014 20:45:49 +0200

commit d8f2127c8ff78bf1ce79ec4408f6438a88158001
Author: Wolfgang Corcoran-Mathe <first.lord.of.teal_AT_gmail.com>
Date: Tue Aug 19 14:45:45 2014 -0400

    Fixed overzealous deletions (oops), added explanatory comment

diff --git a/surf.suckless.org/files/quick_search.md b/surf.suckless.org/files/quick_search.md
index fe270d3..0cbd24c 100644
--- a/surf.suckless.org/files/quick_search.md
+++ b/surf.suckless.org/files/quick_search.md
_AT_@ -34,6 +34,20 @@ Code
         #
         # surf_qsearch:
         # Search script for surf. Takes the surf window id as argument.
+ # POSIX compliant and GNU-free, I think.
+ #
+ # Add something like the following to your surf/config.(def.)h, replacing
+ # surf_qsearch with the name of the file you've copied this code into:
+ #
+ # /* Quick searching. */
+ # #define QSEARCH { \
+ # .v = (char *[]){"/bin/sh", "-c", "surf_qsearch $0 $1", winid, NULL } \
+ # }
+ #
+ # Add a keybinding in keys[]:
+ #
+ # { MODKEY, GDK_q, spawn, QSEARCH },
+ #
 
         # Get the full query. The 'echo | dmenu' idiom may be a bit of
         # a hack, but it seems to work.
_AT_@ -43,7 +57,10 @@ Code
         # Extract the engine code.
         e="${q%% *}"
 
- # Encode the search string (i.e. the rest of q)
+ # Encode the search string (i.e. the rest of q). xxd was formerly used
+ # here, but xxd is part of vim packages on some systems, whereas od is
+ # ubiquitous. A search script that breaks if someone accidentally removes
+ # vim is stupid.
         s=$(printf %s "${q#* }" | od -t x1 -An | tr -d '
' | tr ' ' '%')
 
         # These are examples. Change as desired.
Received on Tue Aug 19 2014 - 20:45:49 CEST

This archive was generated by hypermail 2.3.0 : Thu Jun 18 2015 - 17:39:34 CEST