Subject: bug#78298: [PATCH] Scroll with mouse wheel in calendar

From: Manuel Giraud <[email-masked]>
Date: Fri, 16 May 2025 15:59:10 +0200

Eli Zaretskii <[email-masked]> writes:

>> From: Manuel Giraud <[email-masked]>
>> Cc: Juri Linkov <[email-masked]>,  Eli Zaretskii <[email-masked]>,
>>   [email-masked]
>> Date: Fri, 16 May 2025 10:52:36 +0200
>> 
>> Michael Heerdegen <[email-masked]> writes:
>> 
>> [...]
>> 
>> > | Debugger entered--Lisp error: (void-variable displayed-month)
>> 
>> Ok.  So AFAIU, one (overlooked) difference between backward/forward
>> commands and scroll commands is that the latter are taking care of an
>> event parameter that is used to execute the command in the context of
>> the calendar buffer.
>> 
>> So after all, I think we should be using this "scroll framework" to
>> scroll years also.  Here is an updated patch that could be applied on
>> top of master.
>
> Thanks, but please explain in the doc strings what is meant by "left"
> and "right" in this case (AFAIU, it means "back" and "forward",
> respectively).  Using "left" and "right" might be confusing in
> bidirectional context, so we had better spelled that out explicitly.
>
> (I originally thought of changing the command names, but since we
> already have calendar-scroll-left/right, I guess replacing that with
> "forward" and "back" could adversely affect discoverability.)

Ok.  I'll try to come up with an explanation (for other scroll commands
too.)

>> +(defun calendar-scroll-left-year (arg &optional event)
>> +  "Scroll the displayed calendar window left by 12*ARG months.
>> +If ARG is negative the calendar is scrolled right.
>
> Bother: the first and the 2nd sentences contradict each other.  Are we
> scrolling the window or the text shown in the window?  Their
> directions are opposite.

No they do not contradict: a negative argument on scroll-left command
will actually scroll right and vice versa.
-- 
Manuel Giraud