Scroll with mouse wheel in calendar (bug#78298)

* lisp/calendar/calendar.el (calendar-mode-map): Add scrolling
with mouse wheel.
* etc/NEWS: Announce the change.
This commit is contained in:
Manuel Giraud 2025-05-08 16:30:20 +02:00 committed by Juri Linkov
parent b644823443
commit 825d64aa57
2 changed files with 12 additions and 0 deletions

View file

@ -2049,6 +2049,7 @@ DISABLE-URI non-nil.
When starting these debuggers (e.g., 'M-x pdb') while visiting a file,
pressing 'M-n' in the command prompt suggests a command line including
the file name, using the minibuffer's "future history".
** Calendar
+++
@ -2056,6 +2057,11 @@ the file name, using the minibuffer's "future history".
This command recenters the month of the date at point. By default, it
is bound to 'C-l' in the calendar buffer.
---
*** Mouse wheel bindings for scrolling the calendar.
You can now use the mouse wheel to scroll the calendar by 3 months.
With the shift modifier, it scrolls by one month. With the meta
modifier, it scrolls by year.
* New Modes and Packages in Emacs 31.1

View file

@ -1587,12 +1587,18 @@ Otherwise, use the selected window of EVENT's frame."
(define-key map (vector 'remap c) 'calendar-not-implemented))
(define-key map "<" 'calendar-scroll-right)
(define-key map "\C-x<" 'calendar-scroll-right)
(define-key map [S-wheel-up] 'calendar-scroll-right)
(define-key map [prior] 'calendar-scroll-right-three-months)
(define-key map "\ev" 'calendar-scroll-right-three-months)
(define-key map [wheel-up] 'calendar-scroll-right-three-months)
(define-key map [M-wheel-up] 'calendar-backward-year)
(define-key map ">" 'calendar-scroll-left)
(define-key map "\C-x>" 'calendar-scroll-left)
(define-key map [S-wheel-down] 'calendar-scroll-left)
(define-key map [next] 'calendar-scroll-left-three-months)
(define-key map "\C-v" 'calendar-scroll-left-three-months)
(define-key map [wheel-down] 'calendar-scroll-left-three-months)
(define-key map [M-wheel-down] 'calendar-forward-year)
(define-key map "\C-l" 'calendar-recenter)
(define-key map "\C-b" 'calendar-backward-day)
(define-key map "\C-p" 'calendar-backward-week)