GNU bug report logs -
#78205
[PATCH] Recenter for the calendar
Previous Next
To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 78205 in the body.
You can then email your comments to 78205 AT debbugs.gnu.org in the normal way.
Toggle the display of automated, internal messages from the tracker.
Report forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#78205
; Package
emacs
.
(Fri, 02 May 2025 07:51: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
.
(Fri, 02 May 2025 07:51:02 GMT)
Full text and
rfc822 format available.
Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
Tags: patch
Hi,
This patch adds a "recenter month at point" functionality to the
calendar. It also mimics what 'recenter-top-bottom' is doing for
regular buffers.
In GNU Emacs 31.0.50 (build 1, x86_64-unknown-openbsd7.7, X toolkit) of
2025-05-02 built on computer
Repository revision: b9319616ed63dfb2291f6515828ae450aedfe6fa
Repository branch: mgi/cal-recenter
Windowing system distributor 'The X.Org Foundation', version 11.0.12101016
System Description: OpenBSD computer 7.7 GENERIC.MP#626 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=lucid
--with-toolkit-scroll-bars=no --without-cairo
--without-compress-install'
[0001-Recenter-for-the-calendar.patch (text/patch, attachment)]
[Message part 3 (text/plain, inline)]
--
Manuel Giraud
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#78205
; Package
emacs
.
(Sat, 03 May 2025 09:53:01 GMT)
Full text and
rfc822 format available.
Message #8 received at 78205 <at> debbugs.gnu.org (full text, mbox):
> From: Manuel Giraud <manuel <at> ledu-giraud.fr>
> Date: Fri, 02 May 2025 09:50:07 +0200
>
> This patch adds a "recenter month at point" functionality to the
> calendar. It also mimics what 'recenter-top-bottom' is doing for
> regular buffers.
Thanks.
The documentation parts should explain more what it means to "center"
a date, and also the meaning of "first place", "last place", etc.
These are not self-evident when describing this kind of "centering".
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#78205
; Package
emacs
.
(Sat, 03 May 2025 12:00:03 GMT)
Full text and
rfc822 format available.
Message #11 received at 78205 <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
Eli Zaretskii <eliz <at> gnu.org> writes:
>> From: Manuel Giraud <manuel <at> ledu-giraud.fr>
>> Date: Fri, 02 May 2025 09:50:07 +0200
>>
>> This patch adds a "recenter month at point" functionality to the
>> calendar. It also mimics what 'recenter-top-bottom' is doing for
>> regular buffers.
>
> Thanks.
>
> The documentation parts should explain more what it means to "center"
> a date, and also the meaning of "first place", "last place", etc.
> These are not self-evident when describing this kind of "centering".
Thanks for the review. What do you think of this?
[0001-Recenter-for-the-calendar-bug-78205.patch (text/x-patch, attachment)]
[Message part 3 (text/plain, inline)]
--
Manuel Giraud
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#78205
; Package
emacs
.
(Sat, 03 May 2025 12:54:01 GMT)
Full text and
rfc822 format available.
Message #14 received at 78205 <at> debbugs.gnu.org (full text, mbox):
> From: Manuel Giraud <manuel <at> ledu-giraud.fr>
> Cc: 78205 <at> debbugs.gnu.org
> Date: Sat, 03 May 2025 13:59:49 +0200
>
> +@kindex C-l @r{(Calendar mode)}
> +@findex calendar-recenter-first-last
> + The command @kbd{C-l} (@code{calendar-recenter-first-last}) scrolls
> +the calendar so that the month of the date at point is centered (i.e.,
> +it is placed in second position of the three displayed months). With a
> +second invocation, this command puts this same month on the left hand
> +side in the calendar view and a third invocation puts it on the right
> +hand side. This is in analogy with @code{recenter-top-bottom}.
I'd suggest to simplify:
The command @kbd{C-l} (@code{calendar-recenter-first-last}) scrolls
the calendar on display so that the month of the date at point is
centered horizontally. Next invocation of this command puts that
month on the leftmost position, and another invocation puts it on
the rightmost position. Subsequent invocations reuse the same order
in a cyclical manner.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#78205
; Package
emacs
.
(Sat, 03 May 2025 14:59:01 GMT)
Full text and
rfc822 format available.
Message #17 received at 78205 <at> debbugs.gnu.org (full text, mbox):
Eli Zaretskii <eliz <at> gnu.org> writes:
>> From: Manuel Giraud <manuel <at> ledu-giraud.fr>
>> Cc: 78205 <at> debbugs.gnu.org
>> Date: Sat, 03 May 2025 13:59:49 +0200
>>
>> +@kindex C-l @r{(Calendar mode)}
>> +@findex calendar-recenter-first-last
>> + The command @kbd{C-l} (@code{calendar-recenter-first-last}) scrolls
>> +the calendar so that the month of the date at point is centered (i.e.,
>> +it is placed in second position of the three displayed months). With a
>> +second invocation, this command puts this same month on the left hand
>> +side in the calendar view and a third invocation puts it on the right
>> +hand side. This is in analogy with @code{recenter-top-bottom}.
>
> I'd suggest to simplify:
>
> The command @kbd{C-l} (@code{calendar-recenter-first-last}) scrolls
> the calendar on display so that the month of the date at point is
> centered horizontally. Next invocation of this command puts that
> month on the leftmost position, and another invocation puts it on
> the rightmost position. Subsequent invocations reuse the same order
> in a cyclical manner.
Neat. Your english is better than mine ;-) But before I do this
modification, do you think that the command name is still appropriate?
--
Manuel Giraud
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#78205
; Package
emacs
.
(Sat, 03 May 2025 15:49:02 GMT)
Full text and
rfc822 format available.
Message #20 received at 78205 <at> debbugs.gnu.org (full text, mbox):
> From: Manuel Giraud <manuel <at> ledu-giraud.fr>
> Cc: 78205 <at> debbugs.gnu.org
> Date: Sat, 03 May 2025 16:58:29 +0200
>
> Eli Zaretskii <eliz <at> gnu.org> writes:
>
> > I'd suggest to simplify:
> >
> > The command @kbd{C-l} (@code{calendar-recenter-first-last}) scrolls
> > the calendar on display so that the month of the date at point is
> > centered horizontally. Next invocation of this command puts that
> > month on the leftmost position, and another invocation puts it on
> > the rightmost position. Subsequent invocations reuse the same order
> > in a cyclical manner.
>
> Neat. Your english is better than mine ;-)
Years of practice ;-)
> But before I do this modification, do you think that the command
> name is still appropriate?
I think calendar-recenter is good enough. (The reason for the
"-top-bottom" part of recenter-top-bottom is historical, because we
already had a primitive called "recenter".)
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#78205
; Package
emacs
.
(Sun, 04 May 2025 02:46:06 GMT)
Full text and
rfc822 format available.
Message #23 received at 78205 <at> debbugs.gnu.org (full text, mbox):
Hello Manuel,
your patch works nicely.
> + (car (or (cdr (member calendar-recenter-last-op positions))
This `member' could be `memq' I think.
> + positions))
> + (car positions)))
> + ;; XXX like most functions in calendar, a span of three displayed
> + ;; months is implied here.
What does "XXX" mean?
Michael.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#78205
; Package
emacs
.
(Sun, 04 May 2025 10:01:03 GMT)
Full text and
rfc822 format available.
Message #26 received at 78205 <at> debbugs.gnu.org (full text, mbox):
Michael Heerdegen <michael_heerdegen <at> web.de> writes:
> Hello Manuel,
>
> your patch works nicely.
>
>
>> + (car (or (cdr (member calendar-recenter-last-op positions))
>
> This `member' could be `memq' I think.
Thanks. I have copy this part from 'recenter-top-bottom'. I'll try
with memq.
>> + positions))
>> + (car positions)))
>> + ;; XXX like most functions in calendar, a span of three displayed
>> + ;; months is implied here.
>
> What does "XXX" mean?
It is kind of a warning/watchout for future readers. I've seen it use
in other places in the Emacs sources.
--
Manuel Giraud
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#78205
; Package
emacs
.
(Sun, 04 May 2025 14:07:02 GMT)
Full text and
rfc822 format available.
Message #29 received at 78205 <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
Hi,
Here is a new version of the patch that includes all your improvements.
[0001-Recenter-for-the-calendar-bug-78205.patch (text/x-patch, attachment)]
[Message part 3 (text/plain, inline)]
--
Manuel Giraud
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#78205
; Package
emacs
.
(Sun, 04 May 2025 16:42:02 GMT)
Full text and
rfc822 format available.
Message #32 received at 78205 <at> debbugs.gnu.org (full text, mbox):
>>> + (car (or (cdr (member calendar-recenter-last-op positions))
>>
>> This `member' could be `memq' I think.
>
> Thanks. I have copy this part from 'recenter-top-bottom'.
Because the value of 'recenter-top-bottom' can be a float number:
(member 0.2 '(0.1 0.2))
=> (0.2)
(memq 0.2 '(0.1 0.2))
=> nil
Though now it could use 'memql' introduced in Emacs 22.1:
(memql 0.2 '(0.1 0.2))
=> (0.2)
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#78205
; Package
emacs
.
(Sun, 04 May 2025 17:20:03 GMT)
Full text and
rfc822 format available.
Message #35 received at 78205 <at> debbugs.gnu.org (full text, mbox):
Juri Linkov <juri <at> linkov.net> writes:
>>>> + (car (or (cdr (member calendar-recenter-last-op positions))
>>>
>>> This `member' could be `memq' I think.
>>
>> Thanks. I have copy this part from 'recenter-top-bottom'.
>
> Because the value of 'recenter-top-bottom' can be a float number:
>
> (member 0.2 '(0.1 0.2))
> => (0.2)
>
> (memq 0.2 '(0.1 0.2))
> => nil
Thanks Juri, I'll try to remember this next time. FWIW, I have used
memq here as suggested by Michael.
--
Manuel Giraud
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#78205
; Package
emacs
.
(Mon, 05 May 2025 00:57:02 GMT)
Full text and
rfc822 format available.
Message #38 received at 78205 <at> debbugs.gnu.org (full text, mbox):
Manuel Giraud <manuel <at> ledu-giraud.fr> writes:
> Thanks. I have copy this part from 'recenter-top-bottom'. I'll try
> with memq.
Thanks.
> > What does "XXX" mean?
>
> It is kind of a warning/watchout for future readers. I've seen it use
> in other places in the Emacs sources.
So if it only says "Look! A comment!", and given that we remove any
unimportant comments, and also that everybody can see that there is a
comment, I don't think I see a use for this kind of marker. The comment
you marked that way doesn't look like it would need this kind of eye
catching. It is good to have that comment, but the comment is not that
exceptionally important compared to other comments.
Something else: I wonder (I hope this would not be too radical, but):
have you thought about making the mouse wheel scroll the months as well?
Scrolling with the wheel is not useful in the calendar buffer window
anyway (*1), and it would fit nicely with your C-l patch.
(*1) I sometimes use the mouse wheel because I got confused by the
different line numbers the generated calendar has, depending on the
number of weeks a month covers/touches. But it doesn't seem to be the
case that scrolling every reveals something that was not visible before.
And that would be a bug anyway.
Michael.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#78205
; Package
emacs
.
(Mon, 05 May 2025 06:40:02 GMT)
Full text and
rfc822 format available.
Message #41 received at 78205 <at> debbugs.gnu.org (full text, mbox):
> Something else: I wonder (I hope this would not be too radical, but):
> have you thought about making the mouse wheel scroll the months as well?
> Scrolling with the wheel is not useful in the calendar buffer window
> anyway (*1), and it would fit nicely with your C-l patch.
Scrolling the months with the mouse wheel would be very much appreciated.
In a normal buffer <wheel-up/down> scroll vertically, and S-<wheel-up/down>
horizontally. In the calendar the vertical scrolling could move by 3 months,
and horizontal by 1 month. Or something like this. Also M-<wheel-up/down>
could support different increments.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#78205
; Package
emacs
.
(Mon, 05 May 2025 18:01:02 GMT)
Full text and
rfc822 format available.
Message #44 received at 78205 <at> debbugs.gnu.org (full text, mbox):
Michael Heerdegen <michael_heerdegen <at> web.de> writes:
> Manuel Giraud <manuel <at> ledu-giraud.fr> writes:
>
>> Thanks. I have copy this part from 'recenter-top-bottom'. I'll try
>> with memq.
>
> Thanks.
>
>> > What does "XXX" mean?
>>
>> It is kind of a warning/watchout for future readers. I've seen it use
>> in other places in the Emacs sources.
>
> So if it only says "Look! A comment!", and given that we remove any
> unimportant comments, and also that everybody can see that there is a
> comment, I don't think I see a use for this kind of marker. The comment
> you marked that way doesn't look like it would need this kind of eye
> catching. It is good to have that comment, but the comment is not that
> exceptionally important compared to other comments.
Yes, you're right I'll remove this.
> Something else: I wonder (I hope this would not be too radical, but):
> have you thought about making the mouse wheel scroll the months as well?
> Scrolling with the wheel is not useful in the calendar buffer window
> anyway (*1), and it would fit nicely with your C-l patch.
Good idea! I don't usually use the mouse wheel but the calendar
behaviour is far from ideal. This would the subject of another patch.
--
Manuel Giraud
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#78205
; Package
emacs
.
(Mon, 05 May 2025 18:08:03 GMT)
Full text and
rfc822 format available.
Message #47 received at 78205 <at> debbugs.gnu.org (full text, mbox):
Juri Linkov <juri <at> linkov.net> writes:
>> Something else: I wonder (I hope this would not be too radical, but):
>> have you thought about making the mouse wheel scroll the months as well?
>> Scrolling with the wheel is not useful in the calendar buffer window
>> anyway (*1), and it would fit nicely with your C-l patch.
>
> Scrolling the months with the mouse wheel would be very much appreciated.
>
> In a normal buffer <wheel-up/down> scroll vertically, and S-<wheel-up/down>
> horizontally. In the calendar the vertical scrolling could move by 3 months,
> and horizontal by 1 month.
As I said, I'm not a heavy mouse wheel user but I think it would be
better to scroll by one month with a simple <wheel-up/down> ans by three
month with S-<wheel-up/down>, no?
> Or something like this. Also M-<wheel-up/down> could support
> different increments.
It seems that this binding is already used for zooming.
--
Manuel Giraud
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#78205
; Package
emacs
.
(Mon, 05 May 2025 19:02:02 GMT)
Full text and
rfc822 format available.
Message #50 received at 78205 <at> debbugs.gnu.org (full text, mbox):
>>> Something else: I wonder (I hope this would not be too radical, but):
>>> have you thought about making the mouse wheel scroll the months as well?
>>> Scrolling with the wheel is not useful in the calendar buffer window
>>> anyway (*1), and it would fit nicely with your C-l patch.
>>
>> Scrolling the months with the mouse wheel would be very much appreciated.
>>
>> In a normal buffer <wheel-up/down> scroll vertically, and S-<wheel-up/down>
>> horizontally. In the calendar the vertical scrolling could move by 3 months,
>> and horizontal by 1 month.
>
> As I said, I'm not a heavy mouse wheel user but I think it would be
> better to scroll by one month with a simple <wheel-up/down> ans by three
> month with S-<wheel-up/down>, no?
Since months are grouped by quarters in a year:
January, February, March
April, May, June
July, August, September
October, November, and December
scrolling vertically could move to the previous/next group of 3 months.
But this could be made customizable later.
>> Or something like this. Also M-<wheel-up/down> could support
>> different increments.
>
> It seems that this binding is already used for zooming.
Zooming is with C-<wheel-up/down>.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#78205
; Package
emacs
.
(Tue, 06 May 2025 18:02:01 GMT)
Full text and
rfc822 format available.
Message #53 received at 78205 <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
Hi,
Here is a (maybe final) version of this patch.
[0001-Recenter-for-the-calendar-bug-78205.patch (text/x-patch, attachment)]
[Message part 3 (text/plain, inline)]
--
Manuel Giraud
Reply sent
to
Eli Zaretskii <eliz <at> gnu.org>
:
You have taken responsibility.
(Thu, 08 May 2025 09:49:02 GMT)
Full text and
rfc822 format available.
Notification sent
to
Manuel Giraud <manuel <at> ledu-giraud.fr>
:
bug acknowledged by developer.
(Thu, 08 May 2025 09:49:02 GMT)
Full text and
rfc822 format available.
Message #58 received at 78205-done <at> debbugs.gnu.org (full text, mbox):
> From: Manuel Giraud <manuel <at> ledu-giraud.fr>
> Cc: Eli Zaretskii <eliz <at> gnu.org>, 78205 <at> debbugs.gnu.org
> Date: Tue, 06 May 2025 20:01:30 +0200
>
> Here is a (maybe final) version of this patch.
Thanks, installed on the master branch, and closing the bug.
bug archived.
Request was from
Debbugs Internal Request <help-debbugs <at> gnu.org>
to
internal_control <at> debbugs.gnu.org
.
(Thu, 05 Jun 2025 11:24:07 GMT)
Full text and
rfc822 format available.
This bug report was last modified 14 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.