Gnus development mailing list
 help / color / mirror / Atom feed
* Replies, (very) wide replies, yanking, and the prefix argument
@ 2024-01-19 22:47 Eric Abrahamsen
  2024-01-20  8:28 ` Michael Albinus
  0 siblings, 1 reply; 3+ messages in thread
From: Eric Abrahamsen @ 2024-01-19 22:47 UTC (permalink / raw)
  To: ding

Someone opened a bug against Gnus today[0], about buggy behavior when
using "S v" (gnus-summary-very-wide-reply) with a prefix argument.

That function looks like this:

(defun gnus-summary-very-wide-reply (&optional yank)
  (interactive (list (and current-prefix-arg
			  (gnus-summary-work-articles 1)))
	       gnus-summary-mode)
  (gnus-summary-reply yank t (gnus-summary-work-articles yank)))

Say point is on article number 10682 in the summary buffer, and you run
"C-u S v". The call to the first `gnus-summary-work-articles' in the
interactive form will return (10682), which is assigned to the variable
yank. The second call to `gnus-summary-work-articles' now looks like
`(gnus-summary-work-articles (10682))', which ends up trying to include
the next 10,682 articles in the Summary buffer into the very wide reply.

The whole thing is confusing. A few things seem wrong:

1. The Gnus manual says "S v" runs gnus-summary-wide-reply, but it
actually runs gnus-summary-very-wide-reply

2. The docstring of gnus-summary-very-wide-reply says that it obeys the
process/prefix convention (ie a prefix of '(4) should start a reply to
the next four articles), and *also* says that the prefix argument means
yank the contents of the articles being replied to. The manual only
mentions the process/prefix convention.

3. Then there's the actual bug that the prefix argument is used
incorrectly to generate WIDE-REPLY.

I'm surprised that no one hit this bug before, and I'm not sure what to
do with it. We have "S V" (gnus-summary-very-wide-reply-with-original)
that uses the prefix argument correctly *and* yanks message content
correctly, so I'm not sure there's a need for "S v" to handle the prefix
argument both ways. I suppose I could make it handle the prefix argument
both ways, though.

Let me know if anyone has any thoughts on this.

[0]: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=68510



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Replies, (very) wide replies, yanking, and the prefix argument
  2024-01-19 22:47 Replies, (very) wide replies, yanking, and the prefix argument Eric Abrahamsen
@ 2024-01-20  8:28 ` Michael Albinus
  2024-01-21  3:28   ` Eric Abrahamsen
  0 siblings, 1 reply; 3+ messages in thread
From: Michael Albinus @ 2024-01-20  8:28 UTC (permalink / raw)
  To: Eric Abrahamsen; +Cc: ding

Eric Abrahamsen <eric@ericabrahamsen.net> writes:

Hi Eric,

> I'm surprised that no one hit this bug before, and I'm not sure what to
> do with it. We have "S V" (gnus-summary-very-wide-reply-with-original)
> that uses the prefix argument correctly *and* yanks message content
> correctly, so I'm not sure there's a need for "S v" to handle the prefix
> argument both ways. I suppose I could make it handle the prefix argument
> both ways, though.
>
> Let me know if anyone has any thoughts on this.

I don't know anything about the implementation in Gnus. But as a data
point, we have also the 'S w' and 'S W' key bindings in the Summary
buffer. And 'C-u S w' seems to behave correctly. Perhaps you could
compare how those commands are implemented?

Best regards, Michael.


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Replies, (very) wide replies, yanking, and the prefix argument
  2024-01-20  8:28 ` Michael Albinus
@ 2024-01-21  3:28   ` Eric Abrahamsen
  0 siblings, 0 replies; 3+ messages in thread
From: Eric Abrahamsen @ 2024-01-21  3:28 UTC (permalink / raw)
  To: Michael Albinus; +Cc: ding

Michael Albinus <michael.albinus@gmx.de> writes:

> Eric Abrahamsen <eric@ericabrahamsen.net> writes:
>
> Hi Eric,
>
>> I'm surprised that no one hit this bug before, and I'm not sure what to
>> do with it. We have "S V" (gnus-summary-very-wide-reply-with-original)
>> that uses the prefix argument correctly *and* yanks message content
>> correctly, so I'm not sure there's a need for "S v" to handle the prefix
>> argument both ways. I suppose I could make it handle the prefix argument
>> both ways, though.
>>
>> Let me know if anyone has any thoughts on this.
>
> I don't know anything about the implementation in Gnus. But as a data
> point, we have also the 'S w' and 'S W' key bindings in the Summary
> buffer. And 'C-u S w' seems to behave correctly. Perhaps you could
> compare how those commands are implemented?

I'm pretty sure I know how to fix the immediate bug here -- just replace
"yank" with "current-prefix-arg" in the second call to
`gnus-summary-work-articles'. The bug isn't present in "C-u S w" because
the bug is specific to the "very wide" aspect of "S v".

I was mostly confused about the intended behavior regarding prefix
arguments provided to these commands. After looking at it a few times, I
guess the point of the prefix argument for the "S v" commands is that it
allows you to yank the text of the single article under point, while
still using the process/prefix convention to pull in addresses from
current-prefix-arg number of messages. Whereas "S V" would yank the text
of all those messages, as well.

I guess I'd be amazed if anyone was remembering how to use all these
variants, but the rest of Gnus is like that, too, so okay! The
documentation needs some fixing and clarification, though.

Eric


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2024-01-21  3:29 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-01-19 22:47 Replies, (very) wide replies, yanking, and the prefix argument Eric Abrahamsen
2024-01-20  8:28 ` Michael Albinus
2024-01-21  3:28   ` Eric Abrahamsen

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 NNTP newsgroup(s).