9front - general discussion about 9front
 help / color / mirror / Atom feed
From: unobe@cpan.org
To: 9front@9front.org
Subject: Re: [9front] [PATCH] nedmail: only display most useful headers
Date: Tue, 06 Feb 2024 10:07:20 -0800	[thread overview]
Message-ID: <4FCA058E6DD3140BBC1AA25E7E15A4C9@smtp.pobox.com> (raw)
In-Reply-To: <ZcJFMZkRHkvv46oJ@gmail.com>

I like it, thanks phil!  One other that I would add (like CC, only if
set) is inreplyto.  But maybe that's not most useful to you and
others.

Quoth phil9 <telephil9@gmail.com>:
> Hi,
> 
> Below patch limits the headers displayed by nedmail to the most "useful"
> ones:Date, From, To, CC (is set) and Subject.
> This helps with some mailing lists or mail providers adding loads of noisy headers.
> This only applies to the 'p' command and all headers are still visible
> when using the 'P' (display raw) command so nothing is lost.
> 
> cheers
> --phil
> 
> 
> diff 081b58a69e5efc2bbf49ee31099372527edb3fa7 uncommitted
> --- a/sys/src/cmd/upas/ned/nedmail.c
> +++ b/sys/src/cmd/upas/ned/nedmail.c
> @@ -1664,6 +1664,18 @@
>  	return c;
>  }
>  
> +void
> +printheaders(Message *m)
> +{
> +	Bprint(&out, "Date: %s\n", m->date);
> +	Bprint(&out, "From: %s\n", m->from);
> +	Bprint(&out, "To: %s\n", m->to);
> +	if(strlen(m->cc)>0)
> +		Bprint(&out, "CC: %s\n", m->cc);
> +	Bprint(&out, "Subject: %s\n", m->subject);
> +	Bprint(&out, "\n");
> +}
> +
>  Message*
>  pcmd0(Cmd *c, Message *m, int mayplumb, char *tfmt)
>  {
> @@ -1684,10 +1696,9 @@
>  	}
>  	if(m->parent == &top){
>  		seen(m);
> -		printpart(m, "unixheader", nil);
> +		/* only print headers for top part */
> +		printheaders(m);
>  	}
> -	if(printpart(m, "header", nil) > 0)
> -		Bprint(&out, "\n");
>  	cp = findctype(m);
>  	if(cp->flag & Display){
>  		if(strcmp(m->type, "text/html") == 0)
> 


      parent reply	other threads:[~2024-02-06 18:09 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-06 14:41 phil9
2024-02-06 17:14 ` umbraticus
2024-02-06 17:17   ` ori
2024-02-06 17:38   ` phil9
2024-02-07  4:23     ` umbraticus
2024-02-07  6:06       ` phil9
2024-02-07  6:54         ` chris
2024-02-07  9:03           ` umbraticus
2024-02-07 12:25             ` chris
2024-02-07 17:37               ` umbraticus
2024-02-06 18:07 ` unobe [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4FCA058E6DD3140BBC1AA25E7E15A4C9@smtp.pobox.com \
    --to=unobe@cpan.org \
    --cc=9front@9front.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).