diff options
author | Robin Jarry <robin@jarry.cc> | 2022-02-19 22:11:06 +0100 |
---|---|---|
committer | Robin Jarry <robin@jarry.cc> | 2022-02-19 22:12:16 +0100 |
commit | 7c3ce816c8a6671116334dd580336ae58335e2ba (patch) | |
tree | 2834fe922856fa50d9e71f3e32a4e4160dc7d620 | |
parent | 5abc3cab96b7ab4f7ea533cd40ffd93c20f37a62 (diff) | |
download | aerc-7c3ce816c8a6671116334dd580336ae58335e2ba.tar.gz aerc-7c3ce816c8a6671116334dd580336ae58335e2ba.zip |
config: set a default filter for text/plain
Avoid the following issue when running aerc with the default
configuration:
No filter configured for this mimetype ('text/plain')
Use a very basic sed command to replace the default plaintext filter.
Fixes: bb0f1801402e ("config: do not hardcode sharedir")
Signed-off-by: Robin Jarry <robin@jarry.cc>
-rw-r--r-- | config/aerc.conf | 1 | ||||
-rwxr-xr-x | filters/plaintext | 16 |
2 files changed, 1 insertions, 16 deletions
diff --git a/config/aerc.conf b/config/aerc.conf index 2c928f69..66b08ad9 100644 --- a/config/aerc.conf +++ b/config/aerc.conf @@ -222,6 +222,7 @@ reply-to-self=true # against (non-case-sensitive) and a comma, e.g. subject,text will match a # subject which contains "text". Use header,~regex to match against a regex. #subject,~^\[PATCH=colordiff +text/plain=sed 's/^>\+.*/\x1b[2;36m&\x1b[0m/' #text/html=pandoc -f html -t plain #image/*=catimg -w $(tput cols) - diff --git a/filters/plaintext b/filters/plaintext deleted file mode 100755 index cfaa170e..00000000 --- a/filters/plaintext +++ /dev/null @@ -1,16 +0,0 @@ -# vim: set ft=awk : -BEGIN { - dim = "\x1B[2m" - cyan = "\x1B[36m" - reset = "\x1B[0m" -} -{ - # Strip carriage returns from line - gsub(/\r/, "", $0) - - if ($0 ~ /^On .*, .* wrote:/ || $0 ~ /^>+/) { - print dim cyan $0 reset - } else { - print $0 - } -} |