GNU bug report logs - #53991
Fix header mangling by message-hide-headers

Previous Next

Package: emacs;

Reported by: Philip Kaludercic <philipk <at> posteo.net>

Date: Mon, 14 Feb 2022 09:06:01 UTC

Severity: normal

Tags: patch

Fixed in version 29.1

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 53991 in the body.
You can then email your comments to 53991 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#53991; Package emacs. (Mon, 14 Feb 2022 09:06:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Philip Kaludercic <philipk <at> posteo.net>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Mon, 14 Feb 2022 09:06:01 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Philip Kaludercic <philipk <at> posteo.net>
To: bug-gnu-emacs <at> gnu.org
Subject: Fix header mangling by message-hide-headers
Date: Mon, 14 Feb 2022 09:05:06 +0000
[Message part 1 (text/plain, inline)]
Tags: patch


I have been having issues with mangled headers for a while not,
especially when resuming a message using C-u C-x m.  This could result
in headers being inserted right in the middle of other headers resulting
in stuff like this:

   To: bug-gnuReferences: <...>
   -emacs <at> gnu.org

that in the best case raises an issue when being sent, in the worse case
silently breaks without you knowing that it was broken.

It appears this was caused by setting mail-user-agent to
'gnus-user-agent.  In gnus-msg-mail, gnus-setup-message calls
message-hide-headers that would try to reorder the headers so that the
headers indicated by message-hidden-headers are placed at the beginning
of the buffer, then narrowed away.  The simplest fix for this issue in
case anyone were to stumble upon it in the future is to set the
message-hidden-headers to nil.

The more complex solution is attached below, and involves replacing the
manual end-of-headers tracking with a marker, that resolves the issue
that the previous implementation had, where end-of-headers could point
right into the middle of a header as described above.

In GNU Emacs 29.0.50 (build 6, x86_64-pc-linux-gnu, X toolkit, cairo version 1.16.0, Xaw scroll bars)
 of 2022-02-06 built on icterid
Repository revision: b0fd3ec2c0131e79b1c62e1f1beb6f29cf076120
Repository branch: master
Windowing system distributor 'The X.Org Foundation', version 11.0.12011000
System Description: Debian GNU/Linux 11 (bullseye)

Configured using:
 'configure --with-x-toolkit=athena --with-native-compilation
 'CFLAGS=-Os -march=native -mtune=native -pipe' LDFLAGS=-flto'

[0001-Improve-stability-of-message-hide-headers.patch (text/patch, attachment)]
[Message part 3 (text/plain, inline)]
-- 
	Philip Kaludercic

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#53991; Package emacs. (Mon, 14 Feb 2022 10:52:02 GMT) Full text and rfc822 format available.

Message #8 received at 53991 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Philip Kaludercic <philipk <at> posteo.net>
Cc: 53991 <at> debbugs.gnu.org
Subject: Re: bug#53991: Fix header mangling by message-hide-headers
Date: Mon, 14 Feb 2022 11:51:26 +0100
Philip Kaludercic <philipk <at> posteo.net> writes:

> The more complex solution is attached below, and involves replacing the
> manual end-of-headers tracking with a marker, that resolves the issue
> that the previous implementation had, where end-of-headers could point
> right into the middle of a header as described above.

Looks good to me; pushed to Emacs 29.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




bug marked as fixed in version 29.1, send any further explanations to 53991 <at> debbugs.gnu.org and Philip Kaludercic <philipk <at> posteo.net> Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Mon, 14 Feb 2022 10:52:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#53991; Package emacs. (Mon, 14 Feb 2022 13:39:02 GMT) Full text and rfc822 format available.

Message #13 received at 53991 <at> debbugs.gnu.org (full text, mbox):

From: Philip Kaludercic <philipk <at> posteo.net>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: 53991 <at> debbugs.gnu.org
Subject: Re: bug#53991: Fix header mangling by message-hide-headers
Date: Mon, 14 Feb 2022 13:38:30 +0000
Lars Ingebrigtsen <larsi <at> gnus.org> writes:

> Philip Kaludercic <philipk <at> posteo.net> writes:
>
>> The more complex solution is attached below, and involves replacing the
>> manual end-of-headers tracking with a marker, that resolves the issue
>> that the previous implementation had, where end-of-headers could point
>> right into the middle of a header as described above.
>
> Looks good to me; pushed to Emacs 29.

As this issue presumably also affects older versions (the code hasn't
changed for years), should it also be applied to emacs-28?

-- 
	Philip Kaludercic




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#53991; Package emacs. (Mon, 14 Feb 2022 13:47:01 GMT) Full text and rfc822 format available.

Message #16 received at 53991 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Philip Kaludercic <philipk <at> posteo.net>
Cc: 53991 <at> debbugs.gnu.org
Subject: Re: bug#53991: Fix header mangling by message-hide-headers
Date: Mon, 14 Feb 2022 14:46:08 +0100
Philip Kaludercic <philipk <at> posteo.net> writes:

> As this issue presumably also affects older versions (the code hasn't
> changed for years), should it also be applied to emacs-28?

No, we're only fixing regressions in the emacs-28 branch now.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Tue, 15 Mar 2022 11:24:10 GMT) Full text and rfc822 format available.

This bug report was last modified 3 years and 158 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.