GNU bug report logs -
#66106
28.2; Undo on yanked message fills message body with headers
Previous Next
Reported by: Bruno Victal <mirai <at> makinata.eu>
Date: Tue, 19 Sep 2023 15:13:02 UTC
Severity: normal
Found in version 28.2
Done: Eric Abrahamsen <eric <at> ericabrahamsen.net>
Bug is archived. No further changes may be made.
Full log
Message #13 received at 66106-done <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
Eric Abrahamsen <eric <at> ericabrahamsen.net> writes:
> Bruno Victal <mirai <at> makinata.eu> writes:
>
>> 1. Using debbugs (elpa), go to issue #66057.
>> 2. Open the 3rd reply. (from Jean Abou Samra)
>> 3. In the Article buffer (the buffer with the message) do `S v' to
>> start a wide reply.
>> 4. Within the message body, do `C-c C-y' to copy the original
>> message/yank.
>>
>> Issue #1: I get a “Jean Abou Samra writes:” line followed by nothing, it
>> didn't paste the contents of the message I'm replying to.
>>
>> 5. Press `Undo'.
>>
>> Issue #2: Instead of reverting to an empty message body, I get the
>> headers of the message I'm replying to in its place.
>>
>> Notes that might be of interest:
>> * I have set `message-generate-hashcash' to `t'.
>>
>> There's also another issue I've encountered when I reattempted to reply
>> but using `S V' (wide reply with yank): The message doesn't seem to be
>> properly quoted. I only see a single level of '>' whereas I'd expect to
>> see part of the body with '>>' corresponding to the quoted parts of the
>> original message that started the discussion.
>
> I don't see exactly what you're seeing -- I tried this out and always
> got the message headers (no message body) with one level of quoting.
> Hitting undo just removed the level of quoting. But the basic problem is there.
>
> It looks like the issue is in `gnus-summary-reply'. The function that
> prepares the original copy of the article for yanking is
> `gnus-copy-article-buffer', which is called once per article being
> replied to (note that "S V" is only wide; "S v" is very wide).
>
> Starting at line 1105 in `gnus-summary-reply', we go to the buffer
> containing the article text to yank, and run:
>
> (save-restriction
> (message-narrow-to-head)
> (when very-wide
> (erase-buffer)
> (insert headers))
> (goto-char (point-max)))
>
> Perhaps the intention was that the narrowing would affect the behavior
> of `erase-buffer', so that in effect this is supposed to replace
> whatever headers were there with the contents of the "headers" variable.
> But of course `erase-buffer' doesn't respect buffer narrowing, so
> everything (including the actual text you wanted to reply to) gets
> deleted. If I replace (erase-buffer) with (delete-region (point-min)
> (point-max)), it appears to work correctly.
>
> Did `erase-buffer' used to respect narrowing, when this code was written
> 20 years ago? Anyway, the more I look at it, the more I think that's
> what's supposed to be happening here.
I've experimented with this a bit more, and am pushing the attached
patch. I believe it fixes this problem, but please re-open the bug if
you're still seeing undesirable behavior.
Thanks for the report,
Eric
[0001-Use-delete-region-in-Gnus-message-yanking.patch (text/x-patch, attachment)]
This bug report was last modified 1 year and 300 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.