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

From: Michael Heerdegen <[email-masked]>
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 <[email-masked]> 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.