Re: How to add additional index_format sequences?
- To: mutt-dev@xxxxxxxx
- Subject: Re: How to add additional index_format sequences?
- From: Parke Bostrom <parke.bostrom@xxxxxxxxx>
- Date: Sat, 27 Mar 2010 23:37:48 -0700
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:received:message-id:subject:to:content-type; bh=keOy1iGDmTvoGaqOmVbsutep8FDqVswJl3fHSLDtuak=; b=nxvrqDqKCJ9pf4zU+cJ4PpcCeIwQahG6Ud/GfmmxJUZLu/ohk0sGLGT7mOoGGjehWA nrHoCtRlvezRP6VQIdZAFMYOOWEatgFz34Dfh6ZcyWeQxO2J3gtoD7gxvka1bA7JHMQS JJVW28xByT/KffNeCDrCKbe2XR1/lbaKu/F7E=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; b=QXC8sLq7xDiW0jo6DvxZYpM6LqPOGZE07tfzZ8GgWtunqx/xJB0EQKchFoPoJwc299 TiqQY7lOYD6Dx7HTyh9ScXJxMcEJPydhx8QPlBQzF22t6g7Ccba8hRVtTIL281hJFThE ZX1VmEW0uTvGPaQxph1hcC5/wpzlWYrYxllKw=
- In-reply-to: <61dc8da01003271824t2a5549e5jf24f9bb609eb0eb4@xxxxxxxxxxxxxx>
- List-post: <mailto:mutt-dev@mutt.org>
- List-unsubscribe: send mail to majordomo@mutt.org, body only "unsubscribe mutt-dev"
- References: <61dc8da01003271824t2a5549e5jf24f9bb609eb0eb4@xxxxxxxxxxxxxx>
- Sender: owner-mutt-dev@xxxxxxxx
On Sat, Mar 27, 2010 at 6:24 PM, Parke Bostrom <parke.bostrom@xxxxxxxxx> wrote:
> I want to add a sequence that displays the address of the recipient.
Hi again,
Below (and attached) is a patch against 1.5.20 that does what I want
(more or less). It is a modified copy of the %a case.
-Parke
--- mutt-1.5.20/hdrline.c-orig 2010-03-27 23:22:44.000000000 -0700
+++ mutt-1.5.20/hdrline.c 2010-03-27 23:23:43.000000000 -0700
@@ -219,6 +219,7 @@
* %N = score
* %O = like %L, except using address instead of name
* %P = progress indicator for builtin pager
+ * %r = address of (first) `to:' recipient
* %s = subject
* %S = short message status (e.g., N/O/D/!/r/-)
* %t = `to:' field (recipients)
@@ -548,6 +549,15 @@
strfcpy(dest, NONULL(hfi->pager_progress), destlen);
break;
+ case 'r':
+ if(hdr->env->to && hdr->env->to->mailbox)
+ {
+ mutt_format_s (dest, destlen, prefix, mutt_addr_for_display
(hdr->env->to));
+ }
+ else
+ dest[0] = '\0';
+ break;
+
case 's':
if (flags & M_FORMAT_TREE && !hdr->collapsed)
Attachment:
hdrline_to_addr.patch
Description: Binary data