Add environment variable to adjust anmhi and document them in README. - anmhi - nmh(7) interface that (ab)uses less, lesskey, tmux and entr
(HTM) hg clone https://bitbucket.org/iamleot/anmhi
(DIR) Log
(DIR) Files
(DIR) Refs
(DIR) README
---
(DIR) changeset 9c0587cf201e5399ddd3a0397dc465065ee6f6db
(DIR) parent cc4b1db46579f60fc365740645442eefe215a873
(HTM) Author: Leonardo Taccari <iamleot@gmail.com>
Date: Tue, 3 Jul 2018 14:12:38
Add environment variable to adjust anmhi and document them in README.
Diffstat:
README | 17 +++++++++++++++++
TODO | 4 ----
anmhi | 21 ++++++++++++++-------
3 files changed, 31 insertions(+), 11 deletions(-)
---
diff -r cc4b1db46579 -r 9c0587cf201e README
--- a/README Tue Jul 03 13:48:03 2018 +0200
+++ b/README Tue Jul 03 14:12:38 2018 +0200
@@ -16,5 +16,22 @@
by (ab)using less and lesskey. For a list of them please directly
read the source code.
+The following environment variables can be used to adjust anmhi
+configuration:
+
+ - ANMHI_LESSKEY: location of lesskey used by anmhi (by default
+ `$(mhpath +)/.lesskey')
+ - ANMHI_MARK_SEQUENCE: sequence used when marking a message via `M'
+ action (by default `marked')
+ - ANMHI_MENU_TOOL: tool used for menus, should support an `-l' option to
+ specify the number of lines (by default `fzy')
+ - ANMHI_SCAN_MESSAGES: number of messages used for the `L' action to
+ show last `2n + 1' messages (by default `100')
+ - ANMHI_SEQUENCES: file name used to temporary store current user defined
+ sequences for the `T' action, stored in ${MHTMPDIR}
+ (by default `.mhcurseqs')
+ - ANMHI_UNSEEN_SEQUENCE: name of the sequence unseed for unseen message (by
+ default `$(mhparam unseen-sequence)')
+
anmhi was inspired by ml written by paul fox. It is intended to be
simpler and avoid to define any custom sequence
diff -r cc4b1db46579 -r 9c0587cf201e TODO
--- a/TODO Tue Jul 03 13:48:03 2018 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,4 +0,0 @@
-anmhi
------
-- Honors possible all-uppercase environment variables to set the
- lower-case ones locally used by anmhi
diff -r cc4b1db46579 -r 9c0587cf201e anmhi
--- a/anmhi Tue Jul 03 13:48:03 2018 +0200
+++ b/anmhi Tue Jul 03 14:12:38 2018 +0200
@@ -29,14 +29,21 @@
: ${MHTMPDIR:=/tmp}
-anmhi_lesskey="$(mhpath +)/.lesskey"
-anmhi_lines=$(stty size | cut -d ' ' -f 1)
-anmhi_mark_sequence="marked"
-anmhi_menu_tool="fzy"
+: ${ANMHI_LESSKEY:="$(mhpath +)/.lesskey"}
+: ${ANMHI_MARK_SEQUENCE:="marked"}
+: ${ANMHI_MENU_TOOL:="fzy"}
+: ${ANMHI_SCAN_MESSAGES:=100}
+: ${ANMHI_SEQUENCES:=".mhcurseqs"}
+: ${ANMHI_UNSEEN_SEQUENCE:="$(mhparam unseen-sequence)"}
+
+anmhi_lesskey="${ANMHI_LESSKEY}"
+anmhi_lines="$(stty size | cut -d ' ' -f 1)"
+anmhi_mark_sequence="${ANMHI_MARK_SEQUENCE}"
+anmhi_menu_tool="${ANMHI_MENU_TOOL}"
anmhi_scan_format='%<(cur)>%| %>%6(msg) %<(mymbox{from})%<{to}To: %13(unquote(decode(friendly{to})))%>%>%<(zero)%17(unquote(decode(friendly{from})))%> %3(day{date}) %3(month{date}) %02(mday{date}) %02(hour{date}):%02(min{date}) %(decode{subject})'
-anmhi_scan_messages="100"
-anmhi_sequences=".mhcurseqs"
-anmhi_unseen_sequence="$(mhparam unseen-sequence)"
+anmhi_scan_messages="${ANMHI_SCAN_MESSAGES}"
+anmhi_sequences="${ANMHI_SEQUENCES}"
+anmhi_unseen_sequence="${ANMHI_UNSEEN_SEQUENCE}"
#