GNU bug report logs - #18381
24.3.93; Diary can wrongly be displayed in Calendar's window

Previous Next

Package: emacs;

Reported by: Stephen Berman <stephen.berman <at> gmx.net>

Date: Mon, 1 Sep 2014 15:01:01 UTC

Severity: normal

Found in version 24.3.93

Fixed in version 24.3.94

Done: Glenn Morris <rgm <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Glenn Morris <rgm <at> gnu.org>
To: martin rudalics <rudalics <at> gmx.at>
Cc: Stephen Berman <stephen.berman <at> gmx.net>, 18381 <at> debbugs.gnu.org
Subject: bug#18381: 24.3.93; Diary can wrongly be displayed in Calendar's window
Date: Thu, 04 Sep 2014 14:04:07 -0400
martin rudalics wrote:

> ... is the same window where you first show the calendar here.  As a
> consequence, `display-buffer-in-previous-window' will find a window
> where you have shown `diary' already and reuse that window.  I'm not
> sure what's the best thing to do here - maybe we should remove
> `display-buffer-in-previous-window' from
> `display-buffer-fallback-action' in `calendar-in-read-only-buffer'.

The most conservative fix would seem to be to only change
calendar-basic-setup, where it calls diary-view-entries.

I guess what we really want to say is "don't display the diary in the
window that you just displayed the calendar in" (is that possible?), but
failing that, simply removing display-buffer-in-previous-window seems to
work. What's the cleanest way to do that? Binding
display-buffer-overriding-action or display-buffer-fallback-action
to an explicit list? display-buffer-fallback-action does not have the
friendliest format to make "remove element X" straightforward,
and is marked as a constant.

*** lisp/calendar/calendar.el	2014-03-17 16:04:32 +0000
--- lisp/calendar/calendar.el	2014-09-04 17:57:25 +0000
***************
*** 1432,1438 ****
        (calendar-generate-window month year)
        (if (and calendar-view-diary-initially-flag
                 (calendar-date-is-visible-p date))
!           (diary-view-entries))))
    (if calendar-view-holidays-initially-flag
        (let* ((diary-buffer (get-file-buffer diary-file))
               (diary-window (if diary-buffer (get-buffer-window diary-buffer)))
--- 1432,1444 ----
        (calendar-generate-window month year)
        (if (and calendar-view-diary-initially-flag
                 (calendar-date-is-visible-p date))
!           (let ((display-buffer-fallback-action
!                  '((display-buffer--maybe-same-window
!                     display-buffer-reuse-window
!                     display-buffer--maybe-pop-up-frame-or-window
!                     display-buffer-use-some-window
!                     display-buffer-pop-up-frame))))
!             (diary-view-entries)))))
    (if calendar-view-holidays-initially-flag
        (let* ((diary-buffer (get-file-buffer diary-file))
               (diary-window (if diary-buffer (get-buffer-window diary-buffer)))





This bug report was last modified 10 years and 340 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.