Skip to content

Instantly share code, notes, and snippets.

@nueh
Created May 1, 2016 04:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nueh/e346b87c125ea8d961dce0078495baaf to your computer and use it in GitHub Desktop.
Save nueh/e346b87c125ea8d961dce0078495baaf to your computer and use it in GitHub Desktop.
diff -udprP mutt-1.6.0.orig/hdrline.c mutt-1.6.0/hdrline.c
--- mutt-1.6.0.orig/hdrline.c 2016-04-02 21:12:22.000000000 +0300
+++ mutt-1.6.0/hdrline.c 2016-04-06 20:22:39.000000000 +0300
@@ -212,6 +212,7 @@ int mutt_user_is_recipient (HEADER *h)
* %f = entire from line
* %F = like %n, unless from self
* %i = message-id
+ * %I = initials of author
* %l = number of lines in the message
* %L = like %F, except `lists' are displayed first
* %m = number of messages in the mailbox
@@ -463,6 +464,31 @@ hdr_format_str (char *dest,
mutt_format_s (dest, destlen, prefix, hdr->env->message_id ? hdr->env->message_id : "<no.id>");
break;
+ case 'I':
+ {
+ int iflag = FALSE;
+ int j = 0;
+
+ for (i = 0; hdr->env->from && hdr->env->from->personal &&
+ hdr->env->from->personal[i] && j < SHORT_STRING - 1; i++)
+ {
+ if (isalpha ((int)hdr->env->from->personal[i]))
+ {
+ if (!iflag)
+ {
+ buf2[j++] = hdr->env->from->personal[i];
+ iflag = TRUE;
+ }
+ }
+ else
+ iflag = FALSE;
+ }
+
+ buf2[j] = '\0';
+ }
+ mutt_format_s (dest, destlen, prefix, buf2);
+ break;
+
case 'l':
if (!optional)
{
diff -udprP mutt-1.6.0.orig/PATCHES mutt-1.6.0/PATCHES
--- mutt-1.6.0.orig/PATCHES 2016-04-02 21:12:22.000000000 +0300
+++ mutt-1.6.0/PATCHES 2016-04-06 20:22:39.000000000 +0300
@@ -0,0 +1 @@
+vvv.initials
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment