]> git.immae.eu Git - perso/Immae/Config/Nix.git/commitdiff
Add patched neomutt overlay
authorIsmaël Bouya <ismael.bouya@normalesup.org>
Sun, 7 Jun 2020 17:12:08 +0000 (19:12 +0200)
committerIsmaël Bouya <ismael.bouya@normalesup.org>
Sun, 7 Jun 2020 17:13:10 +0000 (19:13 +0200)
overlays/default.nix
overlays/neomutt/default.nix [new file with mode: 0644]
overlays/neomutt/tx.patch [new file with mode: 0644]

index a87ace19b9acc013d677f4008726024d133f51b1..e63daa0889b87aebfe811c8104785a26580d39f7 100644 (file)
@@ -14,6 +14,7 @@
   ldapvi = import ./ldapvi;
   lesspipe = import ./lesspipe;
   mysql = import ./databases/mysql;
+  neomutt = import ./neomutt;
   nixops = import ./nixops;
   pass = import ./pass;
   pelican = import ./pelican;
diff --git a/overlays/neomutt/default.nix b/overlays/neomutt/default.nix
new file mode 100644 (file)
index 0000000..f03290a
--- /dev/null
@@ -0,0 +1,7 @@
+self: super: {
+  neomutt = super.neomutt.overrideAttrs(old: {
+    patches = old.patches or [] ++ [
+      ./tx.patch
+    ];
+  });
+}
diff --git a/overlays/neomutt/tx.patch b/overlays/neomutt/tx.patch
new file mode 100644 (file)
index 0000000..c8736df
--- /dev/null
@@ -0,0 +1,44 @@
+commit 61ae454e1579d02736c48e3468a3237429214cdf
+Author: Ismaël Bouya <ismael.bouya@normalesup.org>
+Date:   Tue Jun 2 13:03:04 2020 +0200
+
+    Add %tx to index_format
+
+diff --git a/hdrline.c b/hdrline.c
+index 9224c6641..1594ed729 100644
+--- a/hdrline.c
++++ b/hdrline.c
+@@ -575,6 +575,7 @@ static const char *index_format_str(char *buf, size_t buflen, size_t col, int co
+   const struct Address *from = TAILQ_FIRST(&e->env->from);
+   const struct Address *to = TAILQ_FIRST(&e->env->to);
+   const struct Address *cc = TAILQ_FIRST(&e->env->cc);
++  const struct Address *x_orig_to = TAILQ_FIRST(&e->env->x_original_to);
+   buf[0] = '\0';
+   switch (op)
+@@ -1192,13 +1193,18 @@ static const char *index_format_str(char *buf, size_t buflen, size_t col, int co
+     case 't':
+       tmp[0] = '\0';
+-      if (!check_for_mailing_list(&e->env->to, "To ", tmp, sizeof(tmp)) &&
+-          !check_for_mailing_list(&e->env->cc, "Cc ", tmp, sizeof(tmp)))
+-      {
+-        if (to)
+-          snprintf(tmp, sizeof(tmp), "To %s", mutt_get_name(to));
+-        else if (cc)
+-          snprintf(tmp, sizeof(tmp), "Cc %s", mutt_get_name(cc));
++      if (src[0] == 'x') {
++        snprintf(tmp, sizeof(tmp), "%s", mutt_get_name(x_orig_to));
++        src++;
++      } else {
++        if (!check_for_mailing_list(&e->env->to, "To ", tmp, sizeof(tmp)) &&
++            !check_for_mailing_list(&e->env->cc, "Cc ", tmp, sizeof(tmp)))
++        {
++          if (to)
++            snprintf(tmp, sizeof(tmp), "To %s", mutt_get_name(to));
++          else if (cc)
++            snprintf(tmp, sizeof(tmp), "Cc %s", mutt_get_name(cc));
++        }
+       }
+       mutt_format_s(buf, buflen, prec, tmp);
+       break;