sm-commit AT lists.ibiblio.org
Subject: Source Mage code commit list
List archive
[SM-Commit] GIT changes to master grimoire by Vlad Glagolev (059ba4e9a6f7c63f39fe38089c140b3f7b37cfa6)
- From: Vlad Glagolev <scm AT sourcemage.org>
- To: sm-commit AT lists.ibiblio.org
- Subject: [SM-Commit] GIT changes to master grimoire by Vlad Glagolev (059ba4e9a6f7c63f39fe38089c140b3f7b37cfa6)
- Date: Thu, 26 Nov 2020 07:21:37 +0000
GIT changes to master grimoire by Vlad Glagolev <stealth AT sourcemage.org>:
utils/dmenu/DETAILS | 10 ++++++++++
utils/dmenu/HISTORY | 4 ++++
utils/dmenu/PREPARE | 7 ++++++-
utils/dmenu/PRE_BUILD | 18 ++++++++++++++++++
utils/dmenu/fuzzyhighlight.patch | 20 ++++++++++++++++++++
utils/dmenu/fuzzymatch.patch | 22 ++++++++++++++++++++++
6 files changed, 80 insertions(+), 1 deletion(-)
New commits:
commit 059ba4e9a6f7c63f39fe38089c140b3f7b37cfa6
Author: Vlad Glagolev <stealth AT sourcemage.org>
Commit: Vlad Glagolev <stealth AT sourcemage.org>
dmenu: add fuzzymatch and fuzzyhighlight patches options
diff --git a/utils/dmenu/DETAILS b/utils/dmenu/DETAILS
index a9140c9..9be207c 100755
--- a/utils/dmenu/DETAILS
+++ b/utils/dmenu/DETAILS
@@ -29,6 +29,16 @@ if [[ $DMENU_XYW == y ]]; then
SOURCE6_URL=https://tools.suckless.org/${SPELL}/patches/xyw/${SOURCE6}
SOURCE6_HASH=sha512:af093f2e2be3c5c379add2340fcb9c4e63376a055849fe91685d033a486dae0b7d806b987b89498162ff00c3f47eaa0bda9601b08e5fdf4226af8bb18aa5057f
fi
+if [[ $DMENU_FUZZYMATCH == y ]]; then
+ SOURCE7=${SPELL}-fuzzymatch-${PATCH_VERSION}.diff
+
SOURCE7_URL=https://tools.suckless.org/${SPELL}/patches/fuzzymatch/${SOURCE7}
+
SOURCE7_HASH=sha512:6ce4ce0ddb9c1058f253ce46cdae8949c468d97ce7d787831d8a4f4ebd4db672761e2552703f58d36d01b2933dea624a30627629027b9a5960b404542a40a732
+fi
+if [[ $DMENU_FUZZYHIGHLIGHT == y ]]; then
+ SOURCE8=${SPELL}-fuzzyhighlight-${PATCH_VERSION}.diff
+
SOURCE8_URL=https://tools.suckless.org/${SPELL}/patches/fuzzyhighlight/${SOURCE8}
+
SOURCE8_HASH=sha512:ce806c6481b20d5b2352fc387816878c75285162f6404b3a969a95f9dbd6c7476fd4c6571f260886fa30ccc40e4a388ea8f6902e40ff90447e04bec3faf0669d
+fi
SOURCE_DIRECTORY="$BUILD_DIRECTORY/$SPELL-$VERSION"
WEB_SITE=https://tools.suckless.org/dmenu
ENTERED=20061230
diff --git a/utils/dmenu/HISTORY b/utils/dmenu/HISTORY
index 1ba1f5f..2cf0957 100644
--- a/utils/dmenu/HISTORY
+++ b/utils/dmenu/HISTORY
@@ -1,3 +1,7 @@
+2020-11-25 Vlad Glagolev <stealth AT sourcemage.org>
+ * DETAILS, PRE_BUILD, PREPARE, fuzzy*.patch: add fuzzymatch and
+ fuzzyhighlight patches options
+
2020-11-24 Vlad Glagolev <stealth AT sourcemage.org>
* DETAILS, PRE_BUILD, PREPARE: add xyw patch option
diff --git a/utils/dmenu/PREPARE b/utils/dmenu/PREPARE
index 5678e10..524e6e6 100755
--- a/utils/dmenu/PREPARE
+++ b/utils/dmenu/PREPARE
@@ -2,4 +2,9 @@ config_query DMENU_PASSWORD "Apply dmenu password patch?" n &&
config_query DMENU_LINEHEIGHT "Apply dmenu line height patch?" n &&
config_query DMENU_NUMBERS "Apply dmenu numbers patch?" n &&
config_query DMENU_MOUSE_SUPPORT "Apply dmenu mouse support patch?" n &&
-config_query DMENU_XYW "Apply xyw patch?" n
+config_query DMENU_XYW "Apply xyw patch?" n &&
+config_query DMENU_FUZZYMATCH "Apply fuzzymatch patch?" n &&
+
+if [[ $DMENU_FUZZYMATCH == y ]]; then
+ config_query DMENU_FUZZYHIGHLIGHT "Apply fuzzyhighlight patch?" n
+fi
diff --git a/utils/dmenu/PRE_BUILD b/utils/dmenu/PRE_BUILD
index 0d1d694..0bfab55 100755
--- a/utils/dmenu/PRE_BUILD
+++ b/utils/dmenu/PRE_BUILD
@@ -39,6 +39,24 @@ if [[ $DMENU_XYW == y ]]; then
fi
fi &&
+if [[ $DMENU_FUZZYMATCH == y ]]; then
+ verify_file 7 &&
+
+ cat ${SOURCE_CACHE}/${SOURCE7} > "${SOURCE_DIRECTORY}/${SOURCE7}" &&
+ patch -p0 < "${SPELL_DIRECTORY}/fuzzymatch.patch" &&
+ patch -p1 < "${SOURCE_DIRECTORY}/${SOURCE7}" &&
+
+ sedit "s:-bfi:-bfiF:" "${SOURCE_DIRECTORY}/dmenu.c"
+fi &&
+
+if [[ $DMENU_FUZZYHIGHLIGHT == y ]]; then
+ verify_file 8 &&
+
+ cat ${SOURCE_CACHE}/${SOURCE8} > "${SOURCE_DIRECTORY}/${SOURCE8}" &&
+ patch -p0 < "${SPELL_DIRECTORY}/fuzzyhighlight.patch" &&
+ patch -p1 -F3 < "${SOURCE_DIRECTORY}/${SOURCE8}"
+fi &&
+
if is_version_less $(installed_version fontconfig) 2.11.91; then
echo '#define FC_COLOR "color"' >> drw.h
fi &&
diff --git a/utils/dmenu/fuzzyhighlight.patch
b/utils/dmenu/fuzzyhighlight.patch
new file mode 100644
index 0000000..d4e4c56
--- /dev/null
+++ b/utils/dmenu/fuzzyhighlight.patch
@@ -0,0 +1,20 @@
+--- dmenu-fuzzyhighlight-4.9.diff.orig 2020-04-12 04:50:28.000000000 -0700
++++ dmenu-fuzzyhighlight-4.9.diff 2020-11-25 23:06:28.669246836 -0800
+@@ -82,7 +82,7 @@
+ + ? SchemeSelHighlight
+ + : SchemeNormHighlight]);
+ + for (i = 0, highlight = item->text; *highlight && text[i];) {
+-+ if (*highlight == text[i]) {
+++ if (!fstrncmp(&(*highlight), &text[i], 1)) {
+ + /* get indentation */
+ + c = *highlight;
+ + *highlight = '\0';
+@@ -120,7 +120,7 @@
+
+ - return drw_text(drw, x, y, w, bh, lrpad / 2, item->text, 0);
+ + r = drw_text(drw, x, y, w, bh, lrpad / 2, item->text, 0);
+-+ drawhighlights(item, x, y, w);
+++ if (fuzzy) drawhighlights(item, x, y, w);
+ + return r;
+ }
+
diff --git a/utils/dmenu/fuzzymatch.patch b/utils/dmenu/fuzzymatch.patch
new file mode 100644
index 0000000..c2fd6e5
--- /dev/null
+++ b/utils/dmenu/fuzzymatch.patch
@@ -0,0 +1,22 @@
+--- dmenu-fuzzymatch-4.9.diff.orig 2019-06-30 02:25:52.000000000 -0700
++++ dmenu-fuzzymatch-4.9.diff 2020-11-25 22:22:35.804660320 -0800
+@@ -17,7 +17,7 @@
+ /* Default settings; can be overriden by command line. */
+
+ static int topbar = 1; /* -b option; if 0, dmenu
appears at bottom */
+-+static int fuzzy = 1; /* -F option; if 0, dmenu
doesn't use fuzzy matching */
+++static int fuzzy = 0; /* -F option; if 0, dmenu
doesn't use fuzzy matching */
+ /* -fn option overrides fonts[0]; default X11 font or font set */
+ static const char *fonts[] = {
+ "monospace:size=10"
+@@ -153,8 +153,8 @@
+ topbar = 0;
+ else if (!strcmp(argv[i], "-f")) /* grabs keyboard before
reading stdin */
+ fast = 1;
+-+ else if (!strcmp(argv[i], "-F")) /* grabs keyboard before
reading stdin */
+-+ fuzzy = 0;
+++ else if (!strcmp(argv[i], "-F")) /* fuzzy matching */
+++ fuzzy = 1;
+ else if (!strcmp(argv[i], "-i")) { /* case-insensitive item
matching */
+ fstrncmp = strncasecmp;
+ fstrstr = cistrstr;
- [SM-Commit] GIT changes to master grimoire by Vlad Glagolev (059ba4e9a6f7c63f39fe38089c140b3f7b37cfa6), Vlad Glagolev, 11/26/2020
Archive powered by MHonArc 2.6.24.