On Mon, Apr 16, 2012 at 05:50:50AM +0300, Eli Zaretskii wrote:
> > Date: Sun, 15 Apr 2012 23:04:16 +0200
> > Cc: 11...@debbugs.gnu.org, emacs-orgmode@gnu.org
> > From: Toby Cubitt <toby-dated-1335733484.f89...@dr-qubit.org>
> > 
> > The obvious solution is for org-mode to use a face that doesn't enlarge
> > the characters.
> 
> Another solution would be to enlarge the calendar window by one line.

I've attached a patch that does exactly this. As expected, it fixes the
bug for me.

As discussed previously, the alternative solution would be to change the
default face used to highlight the current date to something that doesn't
set the :bold attribute (which would probably mean introducing a separate
face for this, instead of reusing org-warning). But expanding the
calendar window is a more general solution, as it fixes the problem for
(almost) any face.


Arguably, it might be worth defining a separate face for highlighting the
date in the calendar during org-read-date, even if this patch is applied,
so that it can be customized separately from the face for impending todo
deadlines etc. If there's interest in adding a new
calendar-date-highlight face, I can post a separate patch for that.

For the record, one can already change the face used to highlight the
date in the calendar from within .emacs, via

  (overlay-put org-date-ovl 'face 'new-face)

But that's much less discoverable than defining a separate face for this.

Toby
-- 
Dr T. S. Cubitt
Mathematics and Quantum Information group
Department of Mathematics
Complutense University
Madrid, Spain

email: ts...@cantab.net
web:   www.dr-qubit.org
>From 107b18f3ee306c0cd28566c8e7e5ba94c4b9268c Mon Sep 17 00:00:00 2001
From: "Toby S. Cubitt" <ts...@cantab.net>
Date: Mon, 16 Apr 2012 14:22:35 +0200
Subject: [PATCH] Enlarge calendar by 1 line to fix scrolling bug when
 selecting date.

* lisp/org.el (org-read-date): Enlarge calendar window by 1 line, and
make cursor invisible.
---
 lisp/org.el |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/lisp/org.el b/lisp/org.el
index 170ddc9..18ae685 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -15106,6 +15106,8 @@ user."
       (save-excursion
 	(save-window-excursion
 	  (calendar)
+	  (org-eval-in-calendar
+	   '(progn (enlarge-window 1) (setq cursor-type nil)))
           (unwind-protect
               (progn
 		(calendar-forward-day (- (time-to-days org-def)
-- 
1.7.8.5

Reply via email to