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

To reply to this bug, email your comments to 78298 AT debbugs.gnu.org.

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#78298; Package emacs. (Wed, 07 May 2025 08:49:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Manuel Giraud <manuel <at> ledu-giraud.fr>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Wed, 07 May 2025 08:49:02 GMT) Full text and rfc822 format available.

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

From: Manuel Giraud <manuel <at> ledu-giraud.fr>
To: bug-gnu-emacs <at> gnu.org
Subject: [PATCH] Scroll with mouse wheel in calendar
Date: Wed, 07 May 2025 10:48:41 +0200
[Message part 1 (text/plain, inline)]
Tags: patch

Hi,

Here is simple patch that adds mouse wheel scroll to calendar.
[wheel-up/down] scrolls by 3 months and [S-wheel-up/down] scrolls by 1
month.



In GNU Emacs 31.0.50 (build 5, x86_64-unknown-openbsd7.7) of 2025-05-07
 built on computer
Repository revision: ac52ffa0db54c52afbc455e342ea3b1ba300718f
Repository branch: mgi/calendar-wheel
Windowing system distributor 'The X.Org Foundation', version 11.0.12101016
System Description: OpenBSD computer 7.7 GENERIC.MP#644 amd64

Configured using:
 'configure CC=egcc CPPFLAGS=-I/usr/local/include
 LDFLAGS=-L/usr/local/lib MAKEINFO=gmakeinfo --prefix=/home/manuel/emacs
 --bindir=/home/manuel/bin --with-x-toolkit=no
 --with-toolkit-scroll-bars=no --without-cairo
 --without-compress-install'

[0001-Scroll-with-mouse-wheel-in-calendar.patch (text/patch, attachment)]
[Message part 3 (text/plain, inline)]
-- 
Manuel Giraud

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#78298; Package emacs. (Wed, 07 May 2025 16:20:03 GMT) Full text and rfc822 format available.

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

From: Juri Linkov <juri <at> linkov.net>
To: Manuel Giraud <manuel <at> ledu-giraud.fr>
Cc: 78298 <at> debbugs.gnu.org
Subject: Re: bug#78298: [PATCH] Scroll with mouse wheel in calendar
Date: Wed, 07 May 2025 19:13:33 +0300
> Here is simple patch that adds mouse wheel scroll to calendar.
> [wheel-up/down] scrolls by 3 months and [S-wheel-up/down] scrolls by 1
> month.

Thanks.  It would be nice also for M-wheel to scroll by year.

Do these changes need a NEWS announcement?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#78298; Package emacs. (Wed, 07 May 2025 18:52:02 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Juri Linkov <juri <at> linkov.net>
Cc: 78298 <at> debbugs.gnu.org, manuel <at> ledu-giraud.fr
Subject: Re: bug#78298: [PATCH] Scroll with mouse wheel in calendar
Date: Wed, 07 May 2025 21:51:18 +0300
> Cc: 78298 <at> debbugs.gnu.org
> From: Juri Linkov <juri <at> linkov.net>
> Date: Wed, 07 May 2025 19:13:33 +0300
> 
> > Here is simple patch that adds mouse wheel scroll to calendar.
> > [wheel-up/down] scrolls by 3 months and [S-wheel-up/down] scrolls by 1
> > month.
> 
> Thanks.  It would be nice also for M-wheel to scroll by year.
> 
> Do these changes need a NEWS announcement?

Yes, I think so.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#78298; Package emacs. (Thu, 08 May 2025 15:24:02 GMT) Full text and rfc822 format available.

Message #14 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: 78298 <at> debbugs.gnu.org, Juri Linkov <juri <at> linkov.net>
Subject: Re: bug#78298: [PATCH] Scroll with mouse wheel in calendar
Date: Thu, 08 May 2025 17:23:00 +0200
[Message part 1 (text/plain, inline)]
Eli Zaretskii <eliz <at> gnu.org> writes:

>> Cc: 78298 <at> debbugs.gnu.org
>> From: Juri Linkov <juri <at> linkov.net>
>> Date: Wed, 07 May 2025 19:13:33 +0300
>> 
>> > Here is simple patch that adds mouse wheel scroll to calendar.
>> > [wheel-up/down] scrolls by 3 months and [S-wheel-up/down] scrolls by 1
>> > month.
>> 
>> Thanks.  It would be nice also for M-wheel to scroll by year.
>> 
>> Do these changes need a NEWS announcement?
>
> Yes, I think so.

Here is an updated version.  I'm not quite sure about my formulation in
the NEWS entry.
[0001-Scroll-with-mouse-wheel-in-calendar-bug-78298.patch (text/x-patch, attachment)]
[Message part 3 (text/plain, inline)]
-- 
Manuel Giraud

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#78298; Package emacs. (Thu, 08 May 2025 17:03:02 GMT) Full text and rfc822 format available.

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

From: Juri Linkov <juri <at> linkov.net>
To: Manuel Giraud <manuel <at> ledu-giraud.fr>
Cc: Eli Zaretskii <eliz <at> gnu.org>, 78298 <at> debbugs.gnu.org
Subject: Re: bug#78298: [PATCH] Scroll with mouse wheel in calendar
Date: Thu, 08 May 2025 20:01:21 +0300
> * lisp/calendar/cal-move.el (calendar-scroll-left-year)
> (calendar-scroll-right-year): New commands to scroll the
> calendar by year.

I thought that calendar-forward-year and calendar-backward-year
already do this?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#78298; Package emacs. (Thu, 08 May 2025 20:37:02 GMT) Full text and rfc822 format available.

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

From: Manuel Giraud <manuel <at> ledu-giraud.fr>
To: Juri Linkov <juri <at> linkov.net>
Cc: Eli Zaretskii <eliz <at> gnu.org>, 78298 <at> debbugs.gnu.org
Subject: Re: bug#78298: [PATCH] Scroll with mouse wheel in calendar
Date: Thu, 08 May 2025 22:35:55 +0200
Juri Linkov <juri <at> linkov.net> writes:

>> * lisp/calendar/cal-move.el (calendar-scroll-left-year)
>> (calendar-scroll-right-year): New commands to scroll the
>> calendar by year.
>
> I thought that calendar-forward-year and calendar-backward-year
> already do this?

There is also calendar-forward-month and calendar-scroll-left.  So I try
to do the same as the scroll part... but you're right that I'll have to
look closer in this case.
-- 
Manuel Giraud




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#78298; Package emacs. (Fri, 09 May 2025 03:52:02 GMT) Full text and rfc822 format available.

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

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

> Here is an updated version.

It feels natural to use this - works nicely!


Thanks,

Michael.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#78298; Package emacs. (Fri, 09 May 2025 18:16:02 GMT) Full text and rfc822 format available.

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

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

>> * lisp/calendar/cal-move.el (calendar-scroll-left-year)
>> (calendar-scroll-right-year): New commands to scroll the
>> calendar by year.
>
> I thought that calendar-forward-year and calendar-backward-year
> already do this?

I've checked: calendar-for/backward-year place the cursor on current the
day of month while the functions I introduce place it on the first day
of the month.

For such a tiny difference, I think I should remove
calendar-scroll-right-year (and left) from this patch.  WDYT?
-- 
Manuel Giraud




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#78298; Package emacs. (Sat, 10 May 2025 05:04:01 GMT) Full text and rfc822 format available.

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

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

> I've checked: calendar-for/backward-year place the cursor on current the
> day of month while the functions I introduce place it on the first day
> of the month.
>
> For such a tiny difference, I think I should remove
> calendar-scroll-right-year (and left) from this patch.  WDYT?

I would prefer to keep the behavior consistent.

Or was it not even consistent before your patch?  I see that <next> is
bound to `calendar-scroll-left-three-months' and C-x ] to
`calendar-forward-year'.  Your patch didn't touch these.  Did these
already behave differently?

Michael.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#78298; Package emacs. (Sat, 10 May 2025 18:39:02 GMT) Full text and rfc822 format available.

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

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

> Manuel Giraud <manuel <at> ledu-giraud.fr> writes:
>
>> I've checked: calendar-for/backward-year place the cursor on current the
>> day of month while the functions I introduce place it on the first day
>> of the month.
>>
>> For such a tiny difference, I think I should remove
>> calendar-scroll-right-year (and left) from this patch.  WDYT?
>
> I would prefer to keep the behavior consistent.
>
> Or was it not even consistent before your patch?  I see that <next> is
> bound to `calendar-scroll-left-three-months' and C-x ] to
> `calendar-forward-year'.  Your patch didn't touch these.  Did these
> already behave differently?

Yes, they behave differently.  AFAIU, for scrolling: while the date
under the cursor is visible, the cursor is placed there after the
scroll.  When the date is not visible anymore, the cursor is placed on
the first day of the month.

For forward/backward movements: it always place the cursor exactly one
month/year before or after.
-- 
Manuel Giraud




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#78298; Package emacs. (Sun, 11 May 2025 06:54:02 GMT) Full text and rfc822 format available.

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

From: Juri Linkov <juri <at> linkov.net>
To: Manuel Giraud <manuel <at> ledu-giraud.fr>
Cc: Eli Zaretskii <eliz <at> gnu.org>, 78298 <at> debbugs.gnu.org
Subject: Re: bug#78298: [PATCH] Scroll with mouse wheel in calendar
Date: Sun, 11 May 2025 09:47:27 +0300
> I've checked: calendar-for/backward-year place the cursor on current the
> day of month while the functions I introduce place it on the first day
> of the month.
>
> For such a tiny difference, I think I should remove
> calendar-scroll-right-year (and left) from this patch.  WDYT?

It should be fine to use the existing functions where
the mouse wheel bindings are just another way to use them.
So [M-wheel-up/down] will be the same as 'C-x ]', etc.
This compatibility is good for user's expectations.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#78298; Package emacs. (Sun, 11 May 2025 11:42:01 GMT) Full text and rfc822 format available.

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

From: Manuel Giraud <manuel <at> ledu-giraud.fr>
To: Juri Linkov <juri <at> linkov.net>
Cc: Eli Zaretskii <eliz <at> gnu.org>, 78298 <at> debbugs.gnu.org
Subject: Re: bug#78298: [PATCH] Scroll with mouse wheel in calendar
Date: Sun, 11 May 2025 13:41:22 +0200
Juri Linkov <juri <at> linkov.net> writes:

>> I've checked: calendar-for/backward-year place the cursor on current the
>> day of month while the functions I introduce place it on the first day
>> of the month.
>>
>> For such a tiny difference, I think I should remove
>> calendar-scroll-right-year (and left) from this patch.  WDYT?
>
> It should be fine to use the existing functions where
> the mouse wheel bindings are just another way to use them.
> So [M-wheel-up/down] will be the same as 'C-x ]', etc.
> This compatibility is good for user's expectations.

Another thing to notice is that if today appears in scroll movement, the
cursor is placed on that date.

I have changed my mind.  As Michael Heerdegen said, I think we should
try to keep consistency for all mouse scroll.  And it is not like these
new commands are complex either.
-- 
Manuel Giraud




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#78298; Package emacs. (Mon, 12 May 2025 18:06:02 GMT) Full text and rfc822 format available.

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

From: Juri Linkov <juri <at> linkov.net>
To: Manuel Giraud <manuel <at> ledu-giraud.fr>
Cc: Michael Heerdegen <michael_heerdegen <at> web.de>, Eli Zaretskii <eliz <at> gnu.org>,
 78298 <at> debbugs.gnu.org
Subject: Re: bug#78298: [PATCH] Scroll with mouse wheel in calendar
Date: Mon, 12 May 2025 21:03:31 +0300
>> Or was it not even consistent before your patch?  I see that <next> is
>> bound to `calendar-scroll-left-three-months' and C-x ] to
>> `calendar-forward-year'.  Your patch didn't touch these.  Did these
>> already behave differently?
>
> Yes, they behave differently.  AFAIU, for scrolling: while the date
> under the cursor is visible, the cursor is placed there after the
> scroll.  When the date is not visible anymore, the cursor is placed on
> the first day of the month.

With placing the cursor on the first day of the month
the behavior makes sense.  But only for months, not years.

When scrolling years the need is to put the cursor
exactly on the same day/month in another year.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#78298; Package emacs. (Wed, 14 May 2025 11:51:10 GMT) Full text and rfc822 format available.

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

From: Manuel Giraud <manuel <at> ledu-giraud.fr>
To: Juri Linkov <juri <at> linkov.net>
Cc: Michael Heerdegen <michael_heerdegen <at> web.de>, Eli Zaretskii <eliz <at> gnu.org>,
 78298 <at> debbugs.gnu.org
Subject: Re: bug#78298: [PATCH] Scroll with mouse wheel in calendar
Date: Wed, 14 May 2025 13:50:54 +0200
Juri Linkov <juri <at> linkov.net> writes:

>>> Or was it not even consistent before your patch?  I see that <next> is
>>> bound to `calendar-scroll-left-three-months' and C-x ] to
>>> `calendar-forward-year'.  Your patch didn't touch these.  Did these
>>> already behave differently?
>>
>> Yes, they behave differently.  AFAIU, for scrolling: while the date
>> under the cursor is visible, the cursor is placed there after the
>> scroll.  When the date is not visible anymore, the cursor is placed on
>> the first day of the month.
>
> With placing the cursor on the first day of the month
> the behavior makes sense.  But only for months, not years.
>
> When scrolling years the need is to put the cursor
> exactly on the same day/month in another year.

Yes that also makes sense.  Any other opinion on this matter?  To
summarize the choices are:

          1) More code (new commands) but make year scrolling consistent
             with other scrolling (i.e. place the cursor on the first
             day of the month when the date is not visible anymore
             (note: this is always the case for year scroll))

          2) Less code (reuse calendar-[for|back]ward-year) but year
             scrolling is not consistent with other scrolling
-- 
Manuel Giraud




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#78298; Package emacs. (Wed, 14 May 2025 16:28:02 GMT) Full text and rfc822 format available.

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

From: Juri Linkov <juri <at> linkov.net>
To: Manuel Giraud <manuel <at> ledu-giraud.fr>
Cc: Michael Heerdegen <michael_heerdegen <at> web.de>, Eli Zaretskii <eliz <at> gnu.org>,
 78298 <at> debbugs.gnu.org
Subject: Re: bug#78298: [PATCH] Scroll with mouse wheel in calendar
Date: Wed, 14 May 2025 19:25:42 +0300
>> With placing the cursor on the first day of the month
>> the behavior makes sense.  But only for months, not years.
>>
>> When scrolling years the need is to put the cursor
>> exactly on the same day/month in another year.
>
> Yes that also makes sense.  Any other opinion on this matter?  To
> summarize the choices are:
>
>           1) More code (new commands) but make year scrolling consistent
>              with other scrolling (i.e. place the cursor on the first
>              day of the month when the date is not visible anymore
>              (note: this is always the case for year scroll))
>
>           2) Less code (reuse calendar-[for|back]ward-year) but year
>              scrolling is not consistent with other scrolling

Hopefully it would be ok for Michael as well to use less code
by reusing calendar-[for|back]ward-year that makes mouse wheel
year scrolling consistent with 'C-x [' and 'C-x ]'.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#78298; Package emacs. (Wed, 14 May 2025 17:17:01 GMT) Full text and rfc822 format available.

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

From: Michael Heerdegen <michael_heerdegen <at> web.de>
To: Juri Linkov <juri <at> linkov.net>
Cc: Eli Zaretskii <eliz <at> gnu.org>, 78298 <at> debbugs.gnu.org,
 Manuel Giraud <manuel <at> ledu-giraud.fr>
Subject: Re: bug#78298: [PATCH] Scroll with mouse wheel in calendar
Date: Wed, 14 May 2025 19:18:06 +0200
Juri Linkov <juri <at> linkov.net> writes:

> Hopefully it would be ok for Michael as well to use less code
> by reusing calendar-[for|back]ward-year that makes mouse wheel
> year scrolling consistent with 'C-x [' and 'C-x ]'.

I actually don't have such a strong opinion about this.  Do it if you
came to the conclusion that it's the right thing to do.

Michael.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#78298; Package emacs. (Wed, 14 May 2025 17:51:03 GMT) Full text and rfc822 format available.

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

From: Manuel Giraud <manuel <at> ledu-giraud.fr>
To: Michael Heerdegen <michael_heerdegen <at> web.de>
Cc: Eli Zaretskii <eliz <at> gnu.org>, 78298 <at> debbugs.gnu.org,
 Juri Linkov <juri <at> linkov.net>
Subject: Re: bug#78298: [PATCH] Scroll with mouse wheel in calendar
Date: Wed, 14 May 2025 19:50:48 +0200
[Message part 1 (text/plain, inline)]
Michael Heerdegen <michael_heerdegen <at> web.de> writes:

> Juri Linkov <juri <at> linkov.net> writes:
>
>> Hopefully it would be ok for Michael as well to use less code
>> by reusing calendar-[for|back]ward-year that makes mouse wheel
>> year scrolling consistent with 'C-x [' and 'C-x ]'.
>
> I actually don't have such a strong opinion about this.  Do it if you
> came to the conclusion that it's the right thing to do.

Ok.  I don't have a strong opinion myself so here is an updated version
of this patch.
[0001-Scroll-with-mouse-wheel-in-calendar-bug-78298.patch (text/x-patch, attachment)]
[Message part 3 (text/plain, inline)]
-- 
Manuel Giraud

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#78298; Package emacs. (Wed, 14 May 2025 18:09:02 GMT) Full text and rfc822 format available.

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

From: Juri Linkov <juri <at> linkov.net>
To: Manuel Giraud <manuel <at> ledu-giraud.fr>
Cc: Michael Heerdegen <michael_heerdegen <at> web.de>, Eli Zaretskii <eliz <at> gnu.org>,
 78298 <at> debbugs.gnu.org
Subject: Re: bug#78298: [PATCH] Scroll with mouse wheel in calendar
Date: Wed, 14 May 2025 21:07:50 +0300
close 78298 31.0.50
thanks

>>> Hopefully it would be ok for Michael as well to use less code
>>> by reusing calendar-[for|back]ward-year that makes mouse wheel
>>> year scrolling consistent with 'C-x [' and 'C-x ]'.
>>
>> I actually don't have such a strong opinion about this.  Do it if you
>> came to the conclusion that it's the right thing to do.
>
> Ok.  I don't have a strong opinion myself so here is an updated version
> of this patch.

I don't have a strong opinion too.  So let's start with the minimal patch,
then will see if anyone has more suggestions.  Now pushed your patch.
Thanks for it.




bug marked as fixed in version 31.0.50, send any further explanations to 78298 <at> debbugs.gnu.org and Manuel Giraud <manuel <at> ledu-giraud.fr> Request was from Juri Linkov <juri <at> linkov.net> to control <at> debbugs.gnu.org. (Wed, 14 May 2025 18:10:01 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#78298; Package emacs. (Thu, 15 May 2025 12:05:02 GMT) Full text and rfc822 format available.

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

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

> I don't have a strong opinion too.  So let's start with the minimal
> patch, then will see if anyone has more suggestions.  Now pushed your
> patch.

No... there is a problem with that solution, sorry:

M-x calendar RET
select the other window again (showing *scratch* if you are in -Q)
M-mouse-wheel over the calendar window

and you get

| Debugger entered--Lisp error: (void-variable displayed-month)
|   calendar-cursor-to-date()
|   calendar-cursor-to-nearest-date()
|   calendar-forward-month(12)
|   calendar-forward-year(1)
|   funcall-interactively(calendar-forward-year 1)
|   call-interactively(calendar-forward-year nil nil)
|   command-execute(calendar-forward-year)


Michael.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#78298; Package emacs. (Thu, 15 May 2025 16:18:02 GMT) Full text and rfc822 format available.

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

From: Juri Linkov <juri <at> linkov.net>
To: Michael Heerdegen <michael_heerdegen <at> web.de>
Cc: Eli Zaretskii <eliz <at> gnu.org>, 78298 <at> debbugs.gnu.org,
 Manuel Giraud <manuel <at> ledu-giraud.fr>
Subject: Re: bug#78298: [PATCH] Scroll with mouse wheel in calendar
Date: Thu, 15 May 2025 19:16:04 +0300
reopen 78298
thanks

> No... there is a problem with that solution, sorry:
>
> M-x calendar RET
> select the other window again (showing *scratch* if you are in -Q)
> M-mouse-wheel over the calendar window
>
> and you get
>
> | Debugger entered--Lisp error: (void-variable displayed-month)
> |   calendar-cursor-to-date()
> |   calendar-cursor-to-nearest-date()
> |   calendar-forward-month(12)
> |   calendar-forward-year(1)
> |   funcall-interactively(calendar-forward-year 1)
> |   call-interactively(calendar-forward-year nil nil)
> |   command-execute(calendar-forward-year)

Oops, indeed.  Reopening.

While calendar-scroll-right, calendar-scroll-right-three-months,
calendar-scroll-left, calendar-scroll-left-three-months,
all they have the 'event' argument for mouse event,
there is nothing mouse-related for year scrolling.

So Manuel was right, we need calendar-scroll-left-year
and calendar-scroll-right-year.  The only question remains:
should these commands keep point on the same date/month?




bug No longer marked as fixed in versions 31.0.50 and reopened. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Thu, 15 May 2025 16:18:03 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#78298; Package emacs. (Fri, 16 May 2025 07:21:02 GMT) Full text and rfc822 format available.

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

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

> Juri Linkov <juri <at> linkov.net> writes:
>
>> I don't have a strong opinion too.  So let's start with the minimal
>> patch, then will see if anyone has more suggestions.  Now pushed your
>> patch.
>
> No... there is a problem with that solution, sorry:
>
> M-x calendar RET
> select the other window again (showing *scratch* if you are in -Q)
> M-mouse-wheel over the calendar window
>
> and you get
>
> | Debugger entered--Lisp error: (void-variable displayed-month)

Oups I missed this.  I'll try to figure this out.
-- 
Manuel Giraud




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#78298; Package emacs. (Fri, 16 May 2025 08:53:01 GMT) Full text and rfc822 format available.

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

From: Manuel Giraud <manuel <at> ledu-giraud.fr>
To: Michael Heerdegen <michael_heerdegen <at> web.de>
Cc: Eli Zaretskii <eliz <at> gnu.org>, 78298 <at> debbugs.gnu.org,
 Juri Linkov <juri <at> linkov.net>
Subject: Re: bug#78298: [PATCH] Scroll with mouse wheel in calendar
Date: Fri, 16 May 2025 10:52:36 +0200
[Message part 1 (text/plain, inline)]
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.
[0001-Dedicated-commands-to-scroll-calendar-by-year.patch (text/x-patch, attachment)]
[Message part 3 (text/plain, inline)]
-- 
Manuel Giraud

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#78298; Package emacs. (Fri, 16 May 2025 11:25:02 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Manuel Giraud <manuel <at> ledu-giraud.fr>
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 14:23:41 +0300
> 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.)

> +(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.

> +;;;###cal-autoload
> +(defun calendar-scroll-right-year (arg &optional event)
> +  "Scroll the displayed calendar window right by 12*ARG months.
> +If ARG is negative the calendar is scrolled left.  Maintains the relative
> +position of the cursor with respect to the calendar as well as possible.
> +EVENT is an event like `last-nonmenu-event'."

Same here.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#78298; Package emacs. (Fri, 16 May 2025 14:00:03 GMT) Full text and rfc822 format available.

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




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#78298; Package emacs. (Fri, 16 May 2025 16:04:03 GMT) Full text and rfc822 format available.

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

From: Juri Linkov <juri <at> linkov.net>
To: Manuel Giraud <manuel <at> ledu-giraud.fr>
Cc: Michael Heerdegen <michael_heerdegen <at> web.de>, Eli Zaretskii <eliz <at> gnu.org>,
 78298 <at> debbugs.gnu.org
Subject: Re: bug#78298: [PATCH] Scroll with mouse wheel in calendar
Date: Fri, 16 May 2025 19:01:10 +0300
> 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.

Does it work after selecting other window
like in the test case discovered by Michael.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#78298; Package emacs. (Fri, 16 May 2025 16:06:01 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Manuel Giraud <manuel <at> ledu-giraud.fr>
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 19:05:16 +0300
> From: Manuel Giraud <manuel <at> ledu-giraud.fr>
> Cc: michael_heerdegen <at> web.de,  juri <at> linkov.net,  78298 <at> debbugs.gnu.org
> Date: Fri, 16 May 2025 15:59:10 +0200
> 
> Eli Zaretskii <eliz <at> gnu.org> writes:
> 
> >> +(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.

We are mis-communicating, I think.  My point was that the first
sentence talks about scrolling the window, the second one about the
calendar (i.e. the text).  If you intentionally used different terms
and expected the readers to understand that saying the calendar is
scrolled left is the same as saying the window is scrolled right, then
that's not the best idea.  I suggest to talk about one or the other in
both cases.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#78298; Package emacs. (Fri, 16 May 2025 19:16:02 GMT) Full text and rfc822 format available.

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

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

>> 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.
>
> Does it work after selecting other window
> like in the test case discovered by Michael.

Yes.  But when used inside the calendar buffer it does put the cursor on
the first of the month.
-- 
Manuel Giraud




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#78298; Package emacs. (Fri, 16 May 2025 19:20:02 GMT) Full text and rfc822 format available.

Message #90 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 21:19:32 +0200
Eli Zaretskii <eliz <at> gnu.org> writes:

>> From: Manuel Giraud <manuel <at> ledu-giraud.fr>
>> Cc: michael_heerdegen <at> web.de,  juri <at> linkov.net,  78298 <at> debbugs.gnu.org
>> Date: Fri, 16 May 2025 15:59:10 +0200
>> 
>> Eli Zaretskii <eliz <at> gnu.org> writes:
>> 
>> >> +(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.
>
> We are mis-communicating, I think.  My point was that the first
> sentence talks about scrolling the window, the second one about the
> calendar (i.e. the text).  

Ah ok, sorry about that.  It is the calendar (the text) that is scroll
in all these commands.  I have copy pasted the docstring from another of
the scroll command.  I think we should fix all of them.
-- 
Manuel Giraud




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#78298; Package emacs. (Sat, 17 May 2025 06:24:01 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Manuel Giraud <manuel <at> ledu-giraud.fr>
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: Sat, 17 May 2025 09:23:01 +0300
> From: Manuel Giraud <manuel <at> ledu-giraud.fr>
> Cc: michael_heerdegen <at> web.de,  juri <at> linkov.net,  78298 <at> debbugs.gnu.org
> Date: Fri, 16 May 2025 21:19:32 +0200
> 
> Eli Zaretskii <eliz <at> gnu.org> writes:
> 
> >> From: Manuel Giraud <manuel <at> ledu-giraud.fr>
> >> Cc: michael_heerdegen <at> web.de,  juri <at> linkov.net,  78298 <at> debbugs.gnu.org
> >> Date: Fri, 16 May 2025 15:59:10 +0200
> >> 
> >> Eli Zaretskii <eliz <at> gnu.org> writes:
> >> 
> >> >> +(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.
> >
> > We are mis-communicating, I think.  My point was that the first
> > sentence talks about scrolling the window, the second one about the
> > calendar (i.e. the text).  
> 
> Ah ok, sorry about that.  It is the calendar (the text) that is scroll
> in all these commands.  I have copy pasted the docstring from another of
> the scroll command.  I think we should fix all of them.

Yes, please.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#78298; Package emacs. (Sat, 17 May 2025 14:14:02 GMT) Full text and rfc822 format available.

Message #96 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: Sat, 17 May 2025 16:13:15 +0200
[Message part 1 (text/plain, inline)]
Eli Zaretskii <eliz <at> gnu.org> writes:

>> From: Manuel Giraud <manuel <at> ledu-giraud.fr>
>> Cc: michael_heerdegen <at> web.de,  juri <at> linkov.net,  78298 <at> debbugs.gnu.org
>> Date: Fri, 16 May 2025 21:19:32 +0200
>> 
>> Eli Zaretskii <eliz <at> gnu.org> writes:
>> 
>> >> From: Manuel Giraud <manuel <at> ledu-giraud.fr>
>> >> Cc: michael_heerdegen <at> web.de,  juri <at> linkov.net,  78298 <at> debbugs.gnu.org
>> >> Date: Fri, 16 May 2025 15:59:10 +0200
>> >> 
>> >> Eli Zaretskii <eliz <at> gnu.org> writes:
>> >> 
>> >> >> +(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.
>> >
>> > We are mis-communicating, I think.  My point was that the first
>> > sentence talks about scrolling the window, the second one about the
>> > calendar (i.e. the text).  
>> 
>> Ah ok, sorry about that.  It is the calendar (the text) that is scroll
>> in all these commands.  I have copy pasted the docstring from another of
>> the scroll command.  I think we should fix all of them.
>
> Yes, please.

Here is a new patch.  WDYT?
[0001-Dedicated-commands-to-scroll-calendar-by-year.patch (text/x-patch, attachment)]
[Message part 3 (text/plain, inline)]
-- 
Manuel Giraud

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#78298; Package emacs. (Sat, 17 May 2025 14:43:01 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Manuel Giraud <manuel <at> ledu-giraud.fr>
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: Sat, 17 May 2025 17:42:17 +0300
> From: Manuel Giraud <manuel <at> ledu-giraud.fr>
> Cc: michael_heerdegen <at> web.de,  juri <at> linkov.net,  78298 <at> debbugs.gnu.org
> Date: Sat, 17 May 2025 16:13:15 +0200
> 
> Eli Zaretskii <eliz <at> gnu.org> writes:
> 
> >> From: Manuel Giraud <manuel <at> ledu-giraud.fr>
> >> Cc: michael_heerdegen <at> web.de,  juri <at> linkov.net,  78298 <at> debbugs.gnu.org
> >> Date: Fri, 16 May 2025 21:19:32 +0200
> >> 
> >> Eli Zaretskii <eliz <at> gnu.org> writes:
> >> 
> >> >> From: Manuel Giraud <manuel <at> ledu-giraud.fr>
> >> >> Cc: michael_heerdegen <at> web.de,  juri <at> linkov.net,  78298 <at> debbugs.gnu.org
> >> >> Date: Fri, 16 May 2025 15:59:10 +0200
> >> >> 
> >> >> Eli Zaretskii <eliz <at> gnu.org> writes:
> >> >> 
> >> >> >> +(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.
> >> >
> >> > We are mis-communicating, I think.  My point was that the first
> >> > sentence talks about scrolling the window, the second one about the
> >> > calendar (i.e. the text).  
> >> 
> >> Ah ok, sorry about that.  It is the calendar (the text) that is scroll
> >> in all these commands.  I have copy pasted the docstring from another of
> >> the scroll command.  I think we should fix all of them.
> >
> > Yes, please.
> 
> Here is a new patch.  WDYT?

Looks good, thanks.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#78298; Package emacs. (Mon, 19 May 2025 06:50:02 GMT) Full text and rfc822 format available.

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

From: Juri Linkov <juri <at> linkov.net>
To: Manuel Giraud <manuel <at> ledu-giraud.fr>
Cc: Michael Heerdegen <michael_heerdegen <at> web.de>, Eli Zaretskii <eliz <at> gnu.org>,
 78298 <at> debbugs.gnu.org
Subject: Re: bug#78298: [PATCH] Scroll with mouse wheel in calendar
Date: Mon, 19 May 2025 09:35:09 +0300
>>> 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.
>>
>> Does it work after selecting other window
>> like in the test case discovered by Michael.
>
> Yes.  But when used inside the calendar buffer it does put the cursor on
> the first of the month.

Strange, when I scroll with M-wheel from the diary buffer window,
it moves point completely outside the calendar to the beginning
of the calendar buffer.  Maybe Michael could confirm this.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#78298; Package emacs. (Mon, 19 May 2025 12:05:02 GMT) Full text and rfc822 format available.

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

From: Manuel Giraud <manuel <at> ledu-giraud.fr>
To: Juri Linkov <juri <at> linkov.net>
Cc: Michael Heerdegen <michael_heerdegen <at> web.de>, Eli Zaretskii <eliz <at> gnu.org>,
 78298 <at> debbugs.gnu.org
Subject: Re: bug#78298: [PATCH] Scroll with mouse wheel in calendar
Date: Mon, 19 May 2025 14:04:37 +0200
Juri Linkov <juri <at> linkov.net> writes:

>>>> 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.
>>>
>>> Does it work after selecting other window
>>> like in the test case discovered by Michael.
>>
>> Yes.  But when used inside the calendar buffer it does put the cursor on
>> the first of the month.
>
> Strange, when I scroll with M-wheel from the diary buffer window,
> it moves point completely outside the calendar to the beginning
> of the calendar buffer.  Maybe Michael could confirm this.

Hi,

Thanks.  I was able to reproduce this bug when the other window is the
diary.  I don't know what condition triggered this issue and it seems
difficult to get out of this afterward (whatever is the other window).
-- 
Manuel Giraud




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#78298; Package emacs. (Tue, 20 May 2025 08:50:03 GMT) Full text and rfc822 format available.

Message #108 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: Tue, 20 May 2025 10:49:15 +0200
Eli Zaretskii <eliz <at> gnu.org> writes:

[...]

>> 
>> Here is a new patch.  WDYT?
>
> Looks good, thanks.

Could this be put on master and this report closed?  If possible, I'd
like to deal with the issue highlighted by Juri in another bug report.
-- 
Manuel Giraud




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#78298; Package emacs. (Tue, 20 May 2025 12:44:01 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Manuel Giraud <manuel <at> ledu-giraud.fr>
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: Tue, 20 May 2025 15:43:26 +0300
> From: Manuel Giraud <manuel <at> ledu-giraud.fr>
> Cc: michael_heerdegen <at> web.de,  juri <at> linkov.net,  78298 <at> debbugs.gnu.org
> Date: Tue, 20 May 2025 10:49:15 +0200
> 
> Eli Zaretskii <eliz <at> gnu.org> writes:
> 
> [...]
> 
> >> 
> >> Here is a new patch.  WDYT?
> >
> > Looks good, thanks.
> 
> Could this be put on master and this report closed?  If possible, I'd
> like to deal with the issue highlighted by Juri in another bug report.

I was waiting for Juri and others to say the patch is okay.  I didn't
see their response yet.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#78298; Package emacs. (Tue, 20 May 2025 16:34:02 GMT) Full text and rfc822 format available.

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

From: Juri Linkov <juri <at> linkov.net>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: michael_heerdegen <at> web.de, 78298 <at> debbugs.gnu.org,
 Manuel Giraud <manuel <at> ledu-giraud.fr>
Subject: Re: bug#78298: [PATCH] Scroll with mouse wheel in calendar
Date: Tue, 20 May 2025 19:25:28 +0300
>> >> Here is a new patch.  WDYT?
>> >
>> > Looks good, thanks.
>> 
>> Could this be put on master and this report closed?  If possible, I'd
>> like to deal with the issue highlighted by Juri in another bug report.
>
> I was waiting for Juri and others to say the patch is okay.  I didn't
> see their response yet.

I don't know if the patch is ready to be installed
when it doesn't fix the problem reported by Michael.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#78298; Package emacs. (Wed, 21 May 2025 14:58:02 GMT) Full text and rfc822 format available.

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

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

>>> >> Here is a new patch.  WDYT?
>>> >
>>> > Looks good, thanks.
>>> 
>>> Could this be put on master and this report closed?  If possible, I'd
>>> like to deal with the issue highlighted by Juri in another bug report.
>>
>> I was waiting for Juri and others to say the patch is okay.  I didn't
>> see their response yet.
>
> I don't know if the patch is ready to be installed
> when it doesn't fix the problem reported by Michael.

I think that my last patch fixes this problem… but you're right we need
a confirmation from Michael.
-- 
Manuel Giraud




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#78298; Package emacs. (Sat, 31 May 2025 09:25:06 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Manuel Giraud <manuel <at> ledu-giraud.fr>, michael_heerdegen <at> web.de
Cc: 78298 <at> debbugs.gnu.org, juri <at> linkov.net
Subject: Re: bug#78298: [PATCH] Scroll with mouse wheel in calendar
Date: Sat, 31 May 2025 12:23:39 +0300
> From: Manuel Giraud <manuel <at> ledu-giraud.fr>
> Cc: Eli Zaretskii <eliz <at> gnu.org>,  michael_heerdegen <at> web.de,
>   78298 <at> debbugs.gnu.org
> Date: Wed, 21 May 2025 16:57:23 +0200
> 
> Juri Linkov <juri <at> linkov.net> writes:
> 
> >>> >> Here is a new patch.  WDYT?
> >>> >
> >>> > Looks good, thanks.
> >>> 
> >>> Could this be put on master and this report closed?  If possible, I'd
> >>> like to deal with the issue highlighted by Juri in another bug report.
> >>
> >> I was waiting for Juri and others to say the patch is okay.  I didn't
> >> see their response yet.
> >
> > I don't know if the patch is ready to be installed
> > when it doesn't fix the problem reported by Michael.
> 
> I think that my last patch fixes this problem… but you're right we need
> a confirmation from Michael.

Michael?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#78298; Package emacs. (Sun, 01 Jun 2025 01:22:03 GMT) Full text and rfc822 format available.

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

From: Michael Heerdegen <michael_heerdegen <at> web.de>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 78298 <at> debbugs.gnu.org, Manuel Giraud <manuel <at> ledu-giraud.fr>,
 juri <at> linkov.net
Subject: Re: bug#78298: [PATCH] Scroll with mouse wheel in calendar
Date: Sun, 01 Jun 2025 03:22:48 +0200
Hello Eli, Manuel and Juri,

> > >>> Could this be put on master and this report closed?  If possible, I'd
> > >>> like to deal with the issue highlighted by Juri in another bug report.
> > >>
> > >> I was waiting for Juri and others to say the patch is okay.  I didn't
> > >> see their response yet.
> > >
> > > I don't know if the patch is ready to be installed
> > > when it doesn't fix the problem reported by Michael.
> > 
> > I think that my last patch fixes this problem… but you're right we need
> > a confirmation from Michael.
>
> Michael?

Thanks for the reminder.  Yes, my problem is fixed indeed, we can
install the patch.

And I can reproduce the issue found by Juri.

AFAICT, this point positioning problem happens only because we don't
(temporarily) select the window, we only make the buffer current.  When
I change `calendar-scroll-left' to use `with-selected-window' this
problem is gone.  It's the old window point vs. point in the buffer
thing I guess.

In the commit history you find that the code once worked like that, then
in 2023 had been changed to fix some other invocation case:

| b556c180f65 "Also fix calendar-scroll-left" (Po Lu <luangruo <at> yahoo.com> 2023-08-10)
| * lisp/calendar/cal-move.el (calendar-scroll-left): Use
| `calendar-event-buffer' instead of assuming that EVENT's
| posn-window is always a window.

So I guess we should restore the old version but just check whether
posn-window returns a live window, and only if not select the buffer
directly.  But I did not yet look at what exactly had been broken before
that had been changed.


Thx,

Michael.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#78298; Package emacs. (Tue, 03 Jun 2025 10:58:07 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Michael Heerdegen <michael_heerdegen <at> web.de>,
 Po Lu <luangruo <at> yahoo.com>
Cc: 78298 <at> debbugs.gnu.org, manuel <at> ledu-giraud.fr, juri <at> linkov.net
Subject: Re: bug#78298: [PATCH] Scroll with mouse wheel in calendar
Date: Tue, 03 Jun 2025 13:57:36 +0300
> From: Michael Heerdegen <michael_heerdegen <at> web.de>
> Cc: Manuel Giraud <manuel <at> ledu-giraud.fr>,  78298 <at> debbugs.gnu.org,
>   juri <at> linkov.net
> Date: Sun, 01 Jun 2025 03:22:48 +0200
> 
> Hello Eli, Manuel and Juri,
> 
> > > >>> Could this be put on master and this report closed?  If possible, I'd
> > > >>> like to deal with the issue highlighted by Juri in another bug report.
> > > >>
> > > >> I was waiting for Juri and others to say the patch is okay.  I didn't
> > > >> see their response yet.
> > > >
> > > > I don't know if the patch is ready to be installed
> > > > when it doesn't fix the problem reported by Michael.
> > > 
> > > I think that my last patch fixes this problem… but you're right we need
> > > a confirmation from Michael.
> >
> > Michael?
> 
> Thanks for the reminder.  Yes, my problem is fixed indeed, we can
> install the patch.
> 
> And I can reproduce the issue found by Juri.
> 
> AFAICT, this point positioning problem happens only because we don't
> (temporarily) select the window, we only make the buffer current.  When
> I change `calendar-scroll-left' to use `with-selected-window' this
> problem is gone.  It's the old window point vs. point in the buffer
> thing I guess.
> 
> In the commit history you find that the code once worked like that, then
> in 2023 had been changed to fix some other invocation case:
> 
> | b556c180f65 "Also fix calendar-scroll-left" (Po Lu <luangruo <at> yahoo.com> 2023-08-10)
> | * lisp/calendar/cal-move.el (calendar-scroll-left): Use
> | `calendar-event-buffer' instead of assuming that EVENT's
> | posn-window is always a window.
> 
> So I guess we should restore the old version but just check whether
> posn-window returns a live window, and only if not select the buffer
> directly.  But I did not yet look at what exactly had been broken before
> that had been changed.

Po Lu, any comments?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#78298; Package emacs. (Fri, 06 Jun 2025 09:27:01 GMT) Full text and rfc822 format available.

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

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

> Hello Eli, Manuel and Juri,
>
>> > >>> Could this be put on master and this report closed?  If possible, I'd
>> > >>> like to deal with the issue highlighted by Juri in another bug report.
>> > >>
>> > >> I was waiting for Juri and others to say the patch is okay.  I didn't
>> > >> see their response yet.
>> > >
>> > > I don't know if the patch is ready to be installed
>> > > when it doesn't fix the problem reported by Michael.
>> > 
>> > I think that my last patch fixes this problem… but you're right we need
>> > a confirmation from Michael.
>>
>> Michael?
>
> Thanks for the reminder.  Yes, my problem is fixed indeed, we can
> install the patch.
>
> And I can reproduce the issue found by Juri.

Thanks Michael.  So is it possible to apply this patch (and close) and
I'll try to address Juri's issue in another report?
-- 
Manuel Giraud




This bug report was last modified 9 days ago.

Previous Next


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