Subject: Re: bug#18381: 24.3.93; Diary can wrongly be displayed in Calendar's window

From: martin rudalics <[email-masked]>
Date: Sat, 06 Sep 2014 10:52:25 +0200

> I disagree, the above seems cleaner to me. I don't like changing a
 > general-purpose function to fix a specific problem.

Then I probably misinterpreted his patch.  What is the "general-purpose
function" you intend here?

In general, if an application uses `display-buffer' or `pop-to-buffer'
directly, the application should enclose the preferred way to display
the buffer (or where not to display it) in the ACTION argument.
`display-buffer-overriding-action' should be only used as a last resort:
For example, when the targeted `display-buffer' call is nested in some
macro, in which case, however, the binding will probably affect any
other `display-buffer' call within that macro.  Or, when the application
deliberately wants to preclude any form of users' customization.

 > Why do you say "`display-buffer-overriding-action' is too drastic"?
 > It seems fine to me. Since coming up with that form, I've noticed that
 > isearch.el and lisp.el use something similar (or identical).
 >
 > I'm inclined to commit this solution...

Saying "don't use the selected window" should never harm here (a user
would never want to override that, I presume) so you should be on the
safe side side with your solution.  Still I wonder why you can't change
`display-buffer' calls directly here.

 >> Is `calendar-in-read-only-buffer' presumably only executed in a state
 >> where the calendar window is shown and selected?
 >
 > I don't think so, no.

But wouldn't then using `display-buffer-overriding-action' preclude the
use of another window which is at that time shown and selected?

martin