emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Toby Cubitt <tsc25@cantab.net>
To: emacs-orgmode@gnu.org
Subject: Re: bug#11249: 24.1.50; Overlay with face property causes	calendar buffer to scroll
Date: Mon, 16 Apr 2012 15:41:31 +0200	[thread overview]
Message-ID: <20120416134131.GA28445@c3po.home> (raw)
In-Reply-To: <83wr5gz8xh.fsf@gnu.org>

[-- Attachment #1: Type: text/plain, Size: 1623 bytes --]

On Mon, Apr 16, 2012 at 05:50:50AM +0300, Eli Zaretskii wrote:
> > Date: Sun, 15 Apr 2012 23:04:16 +0200
> > Cc: 11249@debbugs.gnu.org, emacs-orgmode@gnu.org
> > From: Toby Cubitt <toby-dated-1335733484.f898fc@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: tsc25@cantab.net
web:   www.dr-qubit.org

[-- Attachment #2: 0001-Enlarge-calendar-by-1-line-to-fix-scrolling-bug-when.patch --]
[-- Type: text/x-patch, Size: 805 bytes --]

From 107b18f3ee306c0cd28566c8e7e5ba94c4b9268c Mon Sep 17 00:00:00 2001
From: "Toby S. Cubitt" <tsc25@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	other threads:[~2012-04-16 13:42 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <83zkaczq1v.fsf@gnu.org>
2012-04-15 21:04 ` bug#11249: 24.1.50; Overlay with face property causes calendar buffer to scroll Toby Cubitt
2012-04-16  2:50   ` Eli Zaretskii
2012-04-16 13:41     ` Toby Cubitt [this message]
2012-04-20 11:57       ` Bastien
2012-04-21 19:34         ` Toby Cubitt
2012-04-22  6:46           ` Bastien
2012-04-22 10:05             ` Toby Cubitt
2012-04-25 21:30             ` Matt Lundin
2012-04-25 23:10               ` Matt Lundin
2012-04-26  8:59                 ` Bastien
2012-04-26 13:19                   ` Toby Cubitt
2012-04-26 13:43                     ` Bastien

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20120416134131.GA28445@c3po.home \
    --to=tsc25@cantab.net \
    --cc=emacs-orgmode@gnu.org \
    --cc=toby-dated-1335793319.4545b8@dr-qubit.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).