unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
From: Jonas Bernoulli <jonas@bernoul.li>
To: Daniel Kahn Gillmor <dkg@fifthhorseman.net>,
	Notmuch Mail <notmuch@notmuchmail.org>
Subject: Re: failure in emacs notmuch-show: notmuch-show--register-cids: Wrong type argument: char-or-string-p, nil
Date: Sat, 02 Jan 2021 10:47:44 +0100	[thread overview]
Message-ID: <87ft3j8ybj.fsf@bernoul.li> (raw)
In-Reply-To: <87k0sxa6c3.fsf@fifthhorseman.net>

Daniel Kahn Gillmor <dkg@fifthhorseman.net> writes:

> My elisp is too weak to know how to debug this well.  suggestions
> welcome!

"M-x toggle-debug-on-error" and then trying to show the message should
give you a backtrace.  But before doing that also "M-x eval-buffer" in
"notmuch-show.el" to make it more meaningful.

>     notmuch-show--register-cids: Wrong type argument:
>     char-or-string-p, nil

With only that information my guess is that
  (plist-get part :content-type)
returns nil, which "downcase" understandably isn't happy with.

The "part" plist comes from "notmuch show ..." in
"notmuch-query-get-threads", so one problem seems to be that that
can return nil as the type (as opposed to e.g. "unknown/unknown")
while this elisp function (and maybe others) expect a string.

> 0 dkg@alice:~$ notmuch show --decrypt=false --format=raw id:$messageid  | email-print-mime-structure --use-gpg-agent
> └┬╴multipart/encrypted 27703 bytes
>  ├─╴application/pgp-encrypted 11 bytes
>  └─╴application/octet-stream inline [encrypted.asc] 23828 bytes
>   ↧ (decrypts to)
>   └┬╴multipart/mixed 26085 bytes
>    ├─╴text/plain 1028 bytes
>    └┬╴message/rfc822 attachment [attachment.eml] 24707 bytes
>     └─╴text/plain 24510 bytes

And another problem seems to be that notmuch cannot determine the type
of some part even though "email-print-mime-structure" can.  You should
be able to figure out which part by adding a debug statement such as:

  (message "> %S" part)

     Cheers,
     Jonas

  reply	other threads:[~2021-01-02  9:48 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-31 23:44 failure in emacs notmuch-show: notmuch-show--register-cids: Wrong type argument: char-or-string-p, nil Daniel Kahn Gillmor
2021-01-02  9:47 ` Jonas Bernoulli [this message]
2021-01-03  5:33   ` Daniel Kahn Gillmor
2021-01-03 18:31     ` [PATCH] emacs/notmuch-show: Work around errors where a part lacks a content-type Daniel Kahn Gillmor
2021-01-03 20:06       ` Tomi Ollila
2021-01-04 21:07         ` Jonas Bernoulli
2021-01-05 22:00           ` Daniel Kahn Gillmor
2021-01-10 18:38             ` Jonas Bernoulli

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=87ft3j8ybj.fsf@bernoul.li \
    --to=jonas@bernoul.li \
    --cc=dkg@fifthhorseman.net \
    --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).