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: martin rudalics <rudalics <at> gmx.at>
To: Glenn Morris <rgm <at> gnu.org>, Stephen Berman <stephen.berman <at> gmx.net>
Cc: 18381 <at> debbugs.gnu.org
Subject: bug#18381: 24.3.93; Diary can wrongly be displayed in Calendar's window
Date: Tue, 09 Sep 2014 08:58:47 +0200
> emacs -Q
> M-x diary
> M-x calendar
> M-x diary    -> clobbered calendar window; not so in 24.3
>
> I see now that the cause is that the pixelwise change that I bisected to
> earlier added display-buffer-in-previous-window to
> display-buffer-fallback-action - it wasn't there before.
>
> So I can restore the 24.3 behaviour by using this horrible thing:
>
> (let ((display-buffer-fallback-action
>         (list (delq 'display-buffer-in-previous-window
>                  (copy-sequence (car display-buffer-fallback-action))))))
>    ...)
>
> This is Not The Right Thing, but ought to restore 24.3-like behaviour.

That's what I meant earlier when I said that

> > The window you're using to display `diary' here ...
> > ... 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'.

but obviously we should do something like

(let ((display-buffer-overriding-action
       (list (delq 'display-buffer-in-previous-window
                (copy-sequence (car display-buffer-fallback-action))))))
  ...)

because (as you remarked earlier) `display-buffer-fallback-action' is a
constant and should not be changed by the user or an application.

> I think what I really want is a way to say to display-buffer:
> never use a window showing buffer X.
>
> Is that doable?

You can mark the calendar window as softly dedicated to its buffer,
ideally only as long as `diary' wants to use it.  Otherwise, we could
invent new alist entries à la `inhibit-same-window':

`inhibit-windows' (whose value would be a list of windows that should
not be used), and/or

`inhibit-windows-on' (whose value would be a list of buffers that should
remain displayed),

not for Emacs 24.4, in any case.

You still didn't tell me who actually is responsible for displaying the
calendar and then the diary.  Is it `calendar-in-read-only-buffer'?  If
we are sure that it's there, we can pass the necessary advice in that
mancro's `display-buffer' call's ACTION argument.

martin





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.