From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stephen Berman Newsgroups: gmane.emacs.bugs Subject: bug#18381: 24.3.93; Diary can wrongly be displayed in Calendar's window Date: Mon, 01 Sep 2014 16:59:26 +0200 Message-ID: <87k35nqtdd.fsf@rosalinde.fritz.box> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1409583691 31087 80.91.229.3 (1 Sep 2014 15:01:31 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 1 Sep 2014 15:01:31 +0000 (UTC) To: 18381@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Sep 01 17:01:24 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 1XOT6h-0000HO-QX for geb-bug-gnu-emacs@m.gmane.org; Mon, 01 Sep 2014 17:01:24 +0200 Original-Received: from localhost ([::1]:60670 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XOT6g-0002Iv-Sk for geb-bug-gnu-emacs@m.gmane.org; Mon, 01 Sep 2014 11:01:22 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:52817) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XOT6U-0002Hu-N5 for bug-gnu-emacs@gnu.org; Mon, 01 Sep 2014 11:01:20 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XOT6M-0006Ah-Fy for bug-gnu-emacs@gnu.org; Mon, 01 Sep 2014 11:01:10 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:36011) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XOT6M-0006Ad-DW for bug-gnu-emacs@gnu.org; Mon, 01 Sep 2014 11:01:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1XOT6M-0002n8-4D for bug-gnu-emacs@gnu.org; Mon, 01 Sep 2014 11:01:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stephen Berman Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 01 Sep 2014 15:01:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 18381 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.140958361010653 (code B ref -1); Mon, 01 Sep 2014 15:01:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 1 Sep 2014 15:00:10 +0000 Original-Received: from localhost ([127.0.0.1]:55808 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XOT5R-0002kz-58 for submit@debbugs.gnu.org; Mon, 01 Sep 2014 11:00:09 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:50928) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XOT5K-0002jt-4D for submit@debbugs.gnu.org; Mon, 01 Sep 2014 11:00:02 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XOT56-0005GK-KE for submit@debbugs.gnu.org; Mon, 01 Sep 2014 10:59:52 -0400 Original-Received: from lists.gnu.org ([2001:4830:134:3::11]:39016) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XOT56-0005GE-IF for submit@debbugs.gnu.org; Mon, 01 Sep 2014 10:59:44 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:52622) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XOT4z-00029e-D4 for bug-gnu-emacs@gnu.org; Mon, 01 Sep 2014 10:59:44 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XOT4s-0005Bo-Ak for bug-gnu-emacs@gnu.org; Mon, 01 Sep 2014 10:59:37 -0400 Original-Received: from mout.gmx.net ([212.227.17.22]:59864) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XOT4s-0005B4-0S for bug-gnu-emacs@gnu.org; Mon, 01 Sep 2014 10:59:30 -0400 Original-Received: from rosalinde.fritz.box ([89.245.117.99]) by mail.gmx.com (mrgmx101) with ESMTPSA (Nemesis) id 0Lo2EO-1Y48UJ0e88-00g1P7 for ; Mon, 01 Sep 2014 16:59:27 +0200 User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.93 (gnu/linux) X-Provags-ID: V03:K0:Rhzk9CTsvcfj23tqwZY/0TeUGsfaRZPAi+dlg77isEbh2SQnbwX DgXdWCtjzzA1mhtLlyghZ0QHVc3vyoERQ00MQD0cFQtmoQyvdURknK677B6fFP14jflTbUW G6UodXGYTMOFJF/ihEkF57Mh/+e19lJzcp9ESJeS+ajcxeM4BpeH0O00+aBz/U/Vr/0A4k2 MdMAJmp2UB5UxkuEDlDMw== X-UI-Out-Filterresults: notjunk:1; X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). 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:92922 Archived-At: 0. emacs -Q 1. Type `M-x calendar' and then `i d' to create a diary file with an entry for today. 2. M-x customize-option RET calendar-view-diary-initially-flag RET, toggle the value to `On' and save for current session. 3. M-x diary => The diary entry made in step 1 is displayed (in the Fancy Diary) in the lower window (which is not the selected window). 4. M-x calendar => The lower window resizes to fit the Calendar, which is fleetingly displayed in it but then replaced by the Fancy Diary display (in the same resized window). The same problem happens if the simple diary display is used (e.g. by customizing diary-display-function). A real (i.e. my) use case which exposes this problem is to add `(appt-activate 1)' to your init-file (cf. the commentary in appt.el) so you see e.g. today's diary entries as in step 3 on starting Emacs, and then you open the Calendar as in step 4. The patch below fixes the problem for me, for both types of diary display, though I haven't yet checked whether the change to calendar-in-read-only-buffer adversely affects the other users of this macro, since those are functions I don't use. This problem does not happen in 24.3 (at least not in the one packaged with openSUSE 13.1, for which I don't have the Lisp sources at hand), so the fix should be committed to emacs-24. In GNU Emacs 24.3.93.7 (x86_64-suse-linux-gnu, GTK+ Version 3.10.4) of 2014-08-31 on rosalinde Repository revision: 117464 rgm@gnu.org-20140828191824-o5hn2x503w527yhn Windowing system distributor `The X.Org Foundation', version 11.0.11403901 System Description: openSUSE 13.1 (Bottle) (x86_64) Configured using: `configure --without-toolkit-scroll-bars 'CFLAGS=-g3 -O0'' === modified file 'lisp/calendar/calendar.el' *** lisp/calendar/calendar.el 2014-03-17 16:04:32 +0000 --- lisp/calendar/calendar.el 2014-09-01 13:02:00 +0000 *************** *** 1208,1214 **** (goto-char (point-min)) (set-buffer-modified-p nil) (setq buffer-read-only t) ! (display-buffer ,buffer))) ;; The following are in-line for speed; they can be called thousands of times ;; when looking up holidays or processing the diary. Here, for example, are --- 1208,1214 ---- (goto-char (point-min)) (set-buffer-modified-p nil) (setq buffer-read-only t) ! (display-buffer ,buffer t))) ;; The following are in-line for speed; they can be called thousands of times ;; when looking up holidays or processing the diary. Here, for example, are === modified file 'lisp/calendar/diary-lib.el' *** lisp/calendar/diary-lib.el 2014-01-01 07:43:34 +0000 --- lisp/calendar/diary-lib.el 2014-09-01 12:28:23 +0000 *************** *** 1023,1029 **** (calendar-set-mode-line (format "Diary for %s" (cdr empty)))) (unless (car empty) ; no entries (with-current-buffer dbuff ! (let ((window (display-buffer (current-buffer)))) ;; d-s-p is passed from diary-list-entries. (set-window-point window diary-saved-point) (set-window-start window (point-min))))))) --- 1023,1029 ---- (calendar-set-mode-line (format "Diary for %s" (cdr empty)))) (unless (car empty) ; no entries (with-current-buffer dbuff ! (let ((window (display-buffer (current-buffer) t))) ;; d-s-p is passed from diary-list-entries. (set-window-point window diary-saved-point) (set-window-start window (point-min)))))))