emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Toby Cubitt <tsc25@cantab.net>
To: Eli Zaretskii <eliz@gnu.org>
Cc: emacs-orgmode@gnu.org, 11249@debbugs.gnu.org
Subject: Re: bug#11249: 24.1.50; Overlay with face property causes	calendar buffer to scroll
Date: Sun, 15 Apr 2012 23:04:16 +0200	[thread overview]
Message-ID: <20120415210416.GA28522@c3po.home> (raw)
In-Reply-To: <83zkaczq1v.fsf@gnu.org>

On Sun, Apr 15, 2012 at 11:41:00PM +0300, Eli Zaretskii wrote:
> > Date: Sun, 15 Apr 2012 21:24:39 +0200
> > From: Toby Cubitt <tsc25@cantab.net>
> > 
> > Steps to reproduce:
> > 
> > 1. emacs -Q
> > 2. M-x calendar
> > 3. M-: (setq o (make-overlay 1 2))
> > 4. M-: (overlay-put o 'face 'font-lock-warning-face)
> > 5. Use C-n to move point to date in the last line of calendar
> > 
> > 
> > Symptoms:
> > 
> > When the point moves to the last line of the calendar in step 5., the
> > calendar buffer scrolls down, so that the top part of the calendar
> > scrolls off the top of the window and can't be seen.
> 
> This is not a bug, but a feature: Emacs does not allow the cursor to
> enter a partially visible line; it scrolls the buffer to make the line
> with the cursor fully visible.  Displaying characters in the
> font-lock-warning-face makes them slightly larger (because that face
> makes the characters bold), and that can cause the last line to exceed
> the visible portion of the window.

Aha, that makes sense.

> > The above steps are a minimal sequence needed to reproduce the bug. In
> > everyday Emacs use, the bug is triggered by date selection via
> > `org-read-date' in org-mode (which uses an overlay with non-null 'face
> > property in the calendar buffer to highlight the current date).
> 
> If that face also enlarges the characters, this is a feature of the
> Emacs display engine.

Yup, I chose `font-lock-warning-face' in the steps to reproduce because
org-mode sets `org-warning' face to this by default.

Even if this behaviour is related to a display engine feature, this is
nonetheless a bug in `org-read-date'.

It's very irritating to have the top part of the calendar scroll off the
top of the window. Apart from being ugly, it hides the month and day
names (in addition to half the dates), making it very difficult to select
the desired date.

The obvious solution is for org-mode to use a face that doesn't enlarge
the characters. I imagine that would mean defining a separate org-mode
face specifically for highlighting the date in the calendar, since
`org-warning' is used for all kinds of other things in org-mode for which
bold characters make sense (e.g. warning about todo items whose deadline
is due).

I've copied this to the org-mode mailing list, since presumably the
org-mode maintainers will have to take care of 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

       reply	other threads:[~2012-04-15 21:04 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 ` Toby Cubitt [this message]
2012-04-16  2:50   ` bug#11249: 24.1.50; Overlay with face property causes calendar buffer to scroll Eli Zaretskii
2012-04-16 13:41     ` Toby Cubitt
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=20120415210416.GA28522@c3po.home \
    --to=tsc25@cantab.net \
    --cc=11249@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    --cc=emacs-orgmode@gnu.org \
    --cc=toby-dated-1335733485.ab8f2f@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).