GNU bug report logs - #78298
[PATCH] Scroll with mouse wheel in calendar

Previous Next

Package: emacs;

Reported by: Manuel Giraud <manuel <at> ledu-giraud.fr>

Date: Wed, 7 May 2025 08:49:02 UTC

Severity: normal

Tags: patch

Full log


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

From: Manuel Giraud <manuel <at> ledu-giraud.fr>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: michael_heerdegen <at> web.de, 78298 <at> debbugs.gnu.org, juri <at> linkov.net
Subject: Re: bug#78298: [PATCH] Scroll with mouse wheel in calendar
Date: Fri, 16 May 2025 15:59:10 +0200
Eli Zaretskii <eliz <at> gnu.org> writes:

>> From: Manuel Giraud <manuel <at> ledu-giraud.fr>
>> Cc: Juri Linkov <juri <at> linkov.net>,  Eli Zaretskii <eliz <at> gnu.org>,
>>   78298 <at> debbugs.gnu.org
>> Date: Fri, 16 May 2025 10:52:36 +0200
>> 
>> Michael Heerdegen <michael_heerdegen <at> web.de> 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




This bug report was last modified 10 days ago.

Previous Next


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