commit 98b1b24ced932919af366821813405c485fc3596 (patch)
parent 3df562d552a880471e8951fda030ba051d641b14
Author: Alex Karle <alex@alexkarle.com>
Date: Sat, 19 Feb 2022 00:01:44 -0500
mblaze: Add initial mblaze setup
Wow. mless(1) just blew my mind. On so many levels. I should
write a blog post about it...
1. Call less with just the _numbers_ of the files and use
LESSOPEN to convert number -> file (or just the scan)
2. less(1) allows non-default key bindings? lesskey(1) is
new to me (and so cool!)
3. Using a combo of lesskey's and exit status, the user can
modify state (i.e. mark read) and respawn mless(1)
It's recursing on itself to preprocess, to iterate, and just
generally a brilliant use of small utils together!
Diffstat:
4 files changed, 30 insertions(+), 0 deletions(-)
diff --git a/.gitignore b/.gitignore
@@ -0,0 +1 @@
+.mblaze/mless
diff --git a/.mblaze/filter b/.mblaze/filter
@@ -0,0 +1,3 @@
+# .mblaze/filter -- used by mshow(1) to display certain MIME types
+# (hint: run mless(1) and toggle HTML-view with `H` (lesskey must be installed)
+text/html: w3m -T text/html
diff --git a/.mblaze/mless.in b/.mblaze/mless.in
@@ -0,0 +1,23 @@
+# mless(1) keybindings, compiled with mlesskey(1). See ./Makefile
+#
+# mless(1) takes its commands via the exit codes below:
+#
+# 36) # $ goto end
+# 78) # N go to next unseen message
+# 107) # k next thread
+# 100) # d mark read
+# 82) # R toggle raw mode
+# 72) # H toggle HTML mode
+# 94) # ^ goto parent
+Q quit \1
+$ quit $
+S noaction E//scan\n
+` noaction E\#\n
+H quit H
+N quit N
+R quit R
+T quit k
+r quit d
+\^ quit \^
+J next-file
+K prev-file
diff --git a/Makefile b/Makefile
@@ -0,0 +1,3 @@
+# Makefile -- to compile binary config files
+.mblaze/mless: .mblaze/mless.in
+ lesskey -o $@ .mblaze/mless.in