unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
From: Tomi Ollila <tomi.ollila@iki.fi>
To: notmuch@notmuchmail.org
Subject: Re: [PATCH 0/4] emacs: avoid type errors due to nil as content-type
Date: Mon, 11 Jan 2021 21:52:07 +0200	[thread overview]
Message-ID: <m2czybs13s.fsf@guru.guru-group.fi> (raw)
In-Reply-To: <20210110184722.29294-1-jonas@bernoul.li>

On Sun, Jan 10 2021, Jonas Bernoulli wrote:

> The fourth commit tries to address the issue raised in
> id:87k0sxa6c3.fsf@fifthhorseman.net.
>
>   The output of "notmuch show --format=sexp --format-version=4"
>   may contain `:content-type' entries with `nil' as the value,
>   when it fails to detect the correct value.  Account for that
>   in a few places where we would otherwise risk a type error.
>
> The other three commits cleanup the code I had to look at to do
> the above, because I just can't help myself.
>
> This does not apply without first applying
> id:20201214162401.19569-1-jonas@bernoul.li.

Perhaps this series still applies on top of that series from 2020-12-14,
but perhaps one should apply it on top of series (from 2021-01-10):

id:20210110140112.25930-2-jonas@bernoul.li

Meaning emails in range

id:20210110140112.25930-2-jonas@bernoul.li 
... 
id:20210110140112.25930-37-jonas@bernoul.li

(also visible in https://nmbug.notmuchmail.org/status/)

Note that messages 

20210110140112.25930-11-jonas@bernoul.li and
20210110140112.25930-12-jonas@bernoul.li

have base64 -encoded content, with CRLF line endings
so those don't apply as is, but CR's from the encoded
content must be deleted.

I used a hack to do so, appended to the end of this
email; David has done something that is more robust,
and perhaps from that we could get a tool to be added
in devel/ which could do this in the future.

Both of these series applied cleanly, and I will
start using those in my emacs mua.

I like these changes and hope these can be applied soon.

>
>      Jonas

Tomi

Usage: ./rmcr-base64.pl < input.mbox > output.mbox

--8<----8<----8<----8<----8<----8<----8<----8<--

#!/usr/bin/perl
# -*- mode: cperl; cperl-indent-level: 4 -*-

use 5.8.1;
use strict;
use warnings;
use MIME::Base64;

while (<STDIN>) {
    print $_;
    if (/^Content-Transfer-Encoding: base64/) {
	while (<STDIN>) { print $_; last if /^\s*$/ }
	my @lines;
	while (<STDIN>) { last if /^\s*$/; push @lines, $_ }
	my $decoded = decode_base64 join('', @lines);
	$decoded =~ tr/\r//d;
	print(encode_base64 $decoded);
	print "\n"
    }
}

  parent reply	other threads:[~2021-01-11 19:52 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-10 18:47 [PATCH 0/4] emacs: avoid type errors due to nil as content-type Jonas Bernoulli
2021-01-10 18:47 ` [PATCH 1/4] emacs: notmuch-mua-add-more-hidden-headers: use local binding Jonas Bernoulli
2021-01-10 18:47 ` [PATCH 2/4] emacs: notmuch-show--register-cids: fix names of bindings Jonas Bernoulli
2021-01-10 18:47 ` [PATCH 3/4] emacs: notmuch-show--get-cid-content: cosmetics Jonas Bernoulli
2021-01-10 18:47 ` [PATCH 4/4] emacs: avoid type errors due to nil as content-type Jonas Bernoulli
2021-01-10 20:11 ` [PATCH 0/4] " David Edmondson
2021-01-10 20:47   ` Jonas Bernoulli
2021-01-11 19:52 ` Tomi Ollila [this message]
2021-01-12  9:49   ` Jonas Bernoulli
2021-01-12 14:02     ` Tomi Ollila
2021-01-15 11:39 ` David Bremner

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

  List information: https://notmuchmail.org/

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

  git send-email \
    --in-reply-to=m2czybs13s.fsf@guru.guru-group.fi \
    --to=tomi.ollila@iki.fi \
    --cc=notmuch@notmuchmail.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.
Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

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 read-only IMAP folder(s) and NNTP newsgroup(s).