Subject: bug#78861: [PATCH] Avoid calendar flicker

From: Manuel Giraud <[email-masked]>
Date: Sun, 22 Jun 2025 09:00:02 +0200

Tags: patch

Hi,

When you have diary marks activated in the calendar (with 'm',
diary-mark-entries) and when moving around (for example with '<' and
'>') you will see some flicker on dates where you have marks.  This
patch fixes this.

In GNU Emacs 31.0.50 (build 7, x86_64-unknown-openbsd7.7) of 2025-06-21
 built on computer
Repository revision: c916f816e0f12f876868f9ffa1be4b070933bb6f
Repository branch: master
Windowing system distributor 'The X.Org Foundation', version 11.0.12101016
System Description: OpenBSD computer 7.7 GENERIC.MP#23 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-dbus
 --without-gconf --without-gsettings --without-compress-install'

>From c08730525810adc5f7cbe196e86c707ca4fc98cc Mon Sep 17 00:00:00 2001
From: Manuel Giraud <[email-masked]>
Date: Sun, 22 Jun 2025 08:53:12 +0200
Subject: [PATCH] Avoid calendar flicker

* lisp/calendar/calendar.el (calendar-generate-window): Inhibit
redisplay when building the calendar window.
---
 lisp/calendar/calendar.el | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/lisp/calendar/calendar.el b/lisp/calendar/calendar.el
index 1c98de98b9b..47b6b512370 100644
--- a/lisp/calendar/calendar.el
+++ b/lisp/calendar/calendar.el
@@ -1410,7 +1410,8 @@ calendar-basic-setup
 (defun calendar-generate-window (&optional mon yr)
   "Generate the calendar window for the current date.
 Optional integers MON and YR are used instead of today's date."
-  (let* ((inhibit-read-only t)
+  (let* ((inhibit-redisplay t)
+         (inhibit-read-only t)
          (today (calendar-current-date))
          (month (calendar-extract-month today))
          ;; (day (calendar-extract-day today))
-- 
2.49.0

-- 
Manuel Giraud