From: Lars Ingebrigtsen <larsi@gnus.org>
To: Justus-dev@Piater.name
Cc: 45650@debbugs.gnu.org
Subject: bug#45650: 28.0.50; nnmaildir discards line count
Date: Mon, 04 Jan 2021 10:44:31 +0100 [thread overview]
Message-ID: <87sg7h594w.fsf@gnus.org> (raw)
In-Reply-To: <87ft3hhzb3.fsf@uibk.ac.at> (Justus-dev@piater.name's message of "Mon, 04 Jan 2021 09:38:24 +0100")
Justus-dev@Piater.name writes:
> This code assumes that if no Lines: header is found, mail-header-lines
> returns 0. However, mail-header-lines returns -1 in this case, causing
> the correctly-counted number of lines in nov-mid to be overwritten with
> -1.
>
> Replacing (zerop field) by (<= field 0) fixes it.
>
> While I think this is indeed a correct immediate fix,
That's a very confusing function, but this does indeed seem to be the
correct fix here, and I've now done as you suggested in Emacs 28.
> this function should be refactored:
>
> - Why count the number of lines in the message only to discard the
> result if a Lines: header is found afterwards? (Well, fixing this
> won't have much impact: Of the 161594 messages in my nnmaildir
> folders, only 2982 contain a Lines: header.)
>
> - [unrelated] Above the quoted code section, the function checks if the
> NOV data have to be (re)created by parsing the message; if not, it
> raises an exception to return early. This construct should be
> replaced by a conditional, perhaps splitting out the second half into
> its own function for readability.
Both things seem reasonable, so if somebody wants to do that (or rewrite
that function to be less confusing in general), I'm all for it. But as
your change fixes this bug, I'm closing this bug report.
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog: http://lars.ingebrigtsen.no
prev parent reply other threads:[~2021-01-04 9:44 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-01-04 8:38 bug#45650: 28.0.50; nnmaildir discards line count Justus-dev
2021-01-04 9:44 ` Lars Ingebrigtsen [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=87sg7h594w.fsf@gnus.org \
--to=larsi@gnus.org \
--cc=45650@debbugs.gnu.org \
--cc=Justus-dev@Piater.name \
/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 external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.