From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: martin rudalics Newsgroups: gmane.emacs.bugs Subject: bug#18381: 24.3.93; Diary can wrongly be displayed in Calendar's window Date: Tue, 09 Sep 2014 11:18:16 +0200 Message-ID: <540EC5D8.2000302@gmx.at> References: <87k35nqtdd.fsf@rosalinde.fritz.box> <54085AC5.5050304@gmx.at> <7lr3zrjm94.fsf@fencepost.gnu.org> <64a96fko3d.fsf@fencepost.gnu.org> <54099491.4040607@gmx.at> <540ACB49.8010405@gmx.at> <9l38c2bqbo.fsf@fencepost.gnu.org> <87bnqpj1k3.fsf@rosalinde.fritz.box> <540EA527.4050809@gmx.at> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1410254375 24167 80.91.229.3 (9 Sep 2014 09:19:35 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 9 Sep 2014 09:19:35 +0000 (UTC) Cc: Stephen Berman , 18381@debbugs.gnu.org To: Glenn Morris Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Sep 09 11:19:28 2014 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1XRHaB-0005G2-Q6 for geb-bug-gnu-emacs@m.gmane.org; Tue, 09 Sep 2014 11:19:28 +0200 Original-Received: from localhost ([::1]:48456 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XRHa5-00022b-Jn for geb-bug-gnu-emacs@m.gmane.org; Tue, 09 Sep 2014 05:19:21 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:40017) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XRHZw-00021C-0J for bug-gnu-emacs@gnu.org; Tue, 09 Sep 2014 05:19:19 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XRHZm-0001FR-RO for bug-gnu-emacs@gnu.org; Tue, 09 Sep 2014 05:19:11 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:42847) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XRHZm-0001FH-NQ for bug-gnu-emacs@gnu.org; Tue, 09 Sep 2014 05:19:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1XRHZm-0002tP-5z for bug-gnu-emacs@gnu.org; Tue, 09 Sep 2014 05:19:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: martin rudalics Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 09 Sep 2014 09:19:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 18381 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 18381-submit@debbugs.gnu.org id=B18381.141025432411094 (code B ref 18381); Tue, 09 Sep 2014 09:19:02 +0000 Original-Received: (at 18381) by debbugs.gnu.org; 9 Sep 2014 09:18:44 +0000 Original-Received: from localhost ([127.0.0.1]:34411 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XRHZM-0002sk-7a for submit@debbugs.gnu.org; Tue, 09 Sep 2014 05:18:43 -0400 Original-Received: from mout.gmx.net ([212.227.17.20]:52225) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XRHZJ-0002sW-EY for 18381@debbugs.gnu.org; Tue, 09 Sep 2014 05:18:34 -0400 Original-Received: from [88.117.56.234] ([88.117.56.234]) by mail.gmx.com (mrgmx102) with ESMTPSA (Nemesis) id 0Ls7MZ-1YN8W806Bj-013rPp; Tue, 09 Sep 2014 11:18:23 +0200 In-Reply-To: X-Provags-ID: V03:K0:taT09nvhNsaKH9tUmZ6ThD5e+dqp+pnNNwhux/INXJg68HlcXWD Tp5Yb9Wp+ehUHEp3xrU0bWvbbzSs/lUYBaoC1lVFE2ORBisx/DkqkK4HViBo3aMqyeiCmxi S2oDOZ2MURGa/KZr1xUmCrOXD80rDHTGcuu5rAvBoDoZUW093mr2BSF2ULPUAVC6IPYHdaK e8zLNMkL66WduhOb3e3rg== X-UI-Out-Filterresults: notjunk:1; X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:93175 Archived-At: >>> (let ((display-buffer-fallback-action >>> (list (delq 'display-buffer-in-previous-window >>> (copy-sequence (car display-buffer-fallback-action)))))) >>> ...) > [...] >> (let ((display-buffer-overriding-action >> (list (delq 'display-buffer-in-previous-window >> (copy-sequence (car display-buffer-fallback-action)))))) >> ...) > > I can't see that the second form is substantially cleaner than the > first, but ok. `display-buffer-overriding-action' is a variable while `display-buffer-fallback-action' is a constant. But the former is also stronger in the sense that the user cannot override it. >> You still didn't tell me who actually is responsible for displaying the >> calendar and then the diary. > > Not sure I understand. Like I said: > > M-x diary > M-x calendar > M-x diary > > If you are asking me where the display-buffer call is, then it's > diary-display-function as called from diary-list-entries. > > The two standard values are diary-fancy-display (which uses > calendar-in-read-only-buffer, which calls display-buffer), > and diary-simple-display, which calls display-buffer directly. > > Since calendar-in-read-only-buffer is a general function, I'd prefer not > to add too much that is specific to this one usage. I now understand what you earlier meant with "general function". > And even for the diary using the previous window might be right in some > cases, just not this specific one where the previous window now contains > the calendar. > >> 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. > > What would the necessary advice look like? Setting inhibit-same-window to t. But the problem is that if `calendar-in-read-only-buffer' is used to display the calendar or to display the diary even when the calendar was not displayed before or is not called with the calendar window selected, then inhibiting the same window might not be TRT. WOW if `calendar-in-read-only-buffer' is as general as you say, we really should not mess with its `display-buffer' arguments. > At the moment I think I'm going to settle for just getting 24.3 > behaviour back. Agreed. I still don't understand _where_ you plan to make the needed change if `calendar-in-read-only-buffer' is too general. For example, where precisely would you bind `display-buffer-fallback-action'? I suppose around the calls of `calendar-in-read-only-buffer' in diary.el. Is that correct? Can a function like `diary-fancy-display' within the `calendar-in-read-only-buffer' macro try to display another buffer but the diary itself? BTW, did you try using the dedicated status of the calendar window? Something like (let* ((window (get-buffer-window "calendar")) (status (and window (window-dedicated-p window)))) ;; Protect calendar window. (and window (set-window-dedicated-p window 'soft)) (calendar-in-read-only-buffer .... ) ;; Unprotect calendar window. (and window (window-live-p window) (set-window-dedicated-p window status))) martin