]> rtime.felk.cvut.cz Git - notmuch.git/commit
notmuch-mutt: Use of uninitialized value.
authorStefano Zacchiroli <zack@upsilon.cc>
Thu, 14 Feb 2013 08:37:13 +0000 (09:37 +0100)
committerDavid Bremner <bremner@debian.org>
Sat, 16 Feb 2013 15:56:40 +0000 (11:56 -0400)
commit9b98e9bcbfe546a6e919408e1ada6d85316e6a94
treeecc0857198acf3cfe125b9b7c88f2c47e66903d2
parent9bd4ddc0c582d721343916139e0517342e8beaab
notmuch-mutt: Use of uninitialized value.

On Thu, Feb 14, 2013 at 12:36:58AM +0100, Profpatsch wrote:
> On 13-02-13 02:35pm, Kevin J. McCarthy wrote:
> > A more likely idea is to check whether you have $pipe_decode set.
>
> BRILLIANT!
> So much for copying a basic rc from someone else.
> Of course, that was it and I’m officially an idiot.

Neat, thanks Kevin for debugging the issue down to $pipe_decode (which
I've never used, mutt never stops to amaze me :-)).

> And apparently Mail::Internet errors out if there is no Message-ID.
> (Which mentioned in the docs at CPAN…)
>
> Mystery solved.

Right, but still a more graceful failure model would be nice.

Please find attached a patch that in such cases should 1) give a
supposedly nice error message explaining what's going on and 2) empty
the results dir to avoid showing you unrelated results. It works for me.
But extra checking never hurts, in particular for the tag action, which
I don't personally use.

I guess it would also be nice to actually disable $pipe_decode in the
relevant Mutt macros, but I'm not sure about to do that without
interfering with user desired configuration. Kevin: do you know if there
is a common Mutt trick to store the value of a variable before changing
it, and restoring it a posteriori?  More isolation for this kind of
things in Mutt would definitely be welcome...

Cheers.
--
Stefano Zacchiroli  . . . . . . .  zack@upsilon.cc . . . . o . . . o . o
Maître de conférences . . . . . http://upsilon.cc/zack . . . o . . . o o
Debian Project Leader . . . . . . @zack on identi.ca . . o o o . . . o .
« the first rule of tautology club is the first rule of tautology club »

From b67ab95855ce7d279d8c0b3ddcbc20e679afc70b Mon Sep 17 00:00:00 2001
From: Stefano Zacchiroli <zack@upsilon.cc>
Date: Thu, 14 Feb 2013 09:31:37 +0100
Subject: [PATCH] notmuch-mutt: more graceful handling of missing Message-Id
 errors

in particular:
- the "thread" action would print an error and empty results dir
- the "tag action would print an error
contrib/notmuch-mutt/notmuch-mutt