From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Glenn Morris Newsgroups: gmane.emacs.bugs Subject: bug#8920: 24.0.50; Calendar raises error with #included diary file Date: Sat, 25 Jun 2011 18:25:18 -0400 Message-ID: References: <878vst8o5i.fsf@escher.fritz.box> <87pqm229w0.fsf@escher.fritz.box> <87iprtsm0v.fsf@escher.fritz.box> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: dough.gmane.org 1309040784 18485 80.91.229.12 (25 Jun 2011 22:26:24 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sat, 25 Jun 2011 22:26:24 +0000 (UTC) Cc: 8920@debbugs.gnu.org To: Stephen Berman Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Jun 26 00:26:20 2011 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1QabIx-00064y-Od for geb-bug-gnu-emacs@m.gmane.org; Sun, 26 Jun 2011 00:26:20 +0200 Original-Received: from localhost ([::1]:48288 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QabIw-0007MU-Jm for geb-bug-gnu-emacs@m.gmane.org; Sat, 25 Jun 2011 18:26:18 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:56357) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QabIi-0007MM-73 for bug-gnu-emacs@gnu.org; Sat, 25 Jun 2011 18:26:05 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QabIh-0004Uq-7q for bug-gnu-emacs@gnu.org; Sat, 25 Jun 2011 18:26:04 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:59807) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QabIh-0004Ul-2d for bug-gnu-emacs@gnu.org; Sat, 25 Jun 2011 18:26:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1QabIg-00080O-3G; Sat, 25 Jun 2011 18:26:02 -0400 X-Loop: help-debbugs@gnu.org In-Reply-To: <878vst8o5i.fsf@escher.fritz.box> Resent-From: Glenn Morris Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 25 Jun 2011 22:26:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 8920 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 8920-submit@debbugs.gnu.org id=B8920.130904072730729 (code B ref 8920); Sat, 25 Jun 2011 22:26:02 +0000 Original-Received: (at 8920) by debbugs.gnu.org; 25 Jun 2011 22:25:27 +0000 Original-Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QabI5-0007za-UY for submit@debbugs.gnu.org; Sat, 25 Jun 2011 18:25:26 -0400 Original-Received: from fencepost.gnu.org ([140.186.70.10]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QabI4-0007zN-C2 for 8920@debbugs.gnu.org; Sat, 25 Jun 2011 18:25:25 -0400 Original-Received: from localhost ([127.0.0.1]:37430) by fencepost.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QabHy-0003i4-G4; Sat, 25 Jun 2011 18:25:18 -0400 X-Spook: bce mania Kennedy JSOFC3IP monarchist Nazi Armani pink X-Ran: 8u=?IHBp^W-6Nf9!R$@fn"jZ^#02*3.s,O;5F<*Z*Utw^B?L0t2UAih3!-Ot1zOyC*x/Pd X-Hue: yellow X-Attribution: GM User-Agent: Gnus (www.gnus.org), GNU Emacs (www.gnu.org/software/emacs/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list Resent-Date: Sat, 25 Jun 2011 18:26:02 -0400 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) 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:47474 Archived-At: Stephen Berman wrote: > *** /home/steve/bzr/emacs/trunk/lisp/calendar/calendar.el 2011-06-04 12:27:38.000000000 +0200 > --- /home/steve/bzr/emacs/quickfixes/lisp/calendar/calendar.el 2011-06-25 22:10:04.000000000 +0200 > *************** > *** 1392,1398 **** > (calendar-mark-holidays) > (and in-calendar-window (sit-for 0))) > (unwind-protect > ! (if calendar-mark-diary-entries-flag (diary-mark-entries)) > (if today-visible > (run-hooks 'calendar-today-visible-hook) > (run-hooks 'calendar-today-invisible-hook))))) > --- 1392,1401 ---- > (calendar-mark-holidays) > (and in-calendar-window (sit-for 0))) > (unwind-protect > ! (if calendar-mark-diary-entries-flag > ! (save-selected-window > ! (save-excursion > ! (diary-mark-entries)))) > (if today-visible > (run-hooks 'calendar-today-visible-hook) > (run-hooks 'calendar-today-invisible-hook))))) I don't like this, because IIUC, this is only needed because of the: (find-file-noselect (diary-check-diary-file) t) in diary-mark-entries. It should be implicit that find-file-noselect does not mess with the window layout, and we should not need to wrap every call to it in save-* constructs to guard against inappropriate find-file-hooks. I've made some changes to diary-lib.el that mean there is no longer an error in the initial example; however the calendar buffer ends up being replaced with the diary buffer. I didn't read in detail all that you want to do, but I think the only way you can do it at present is by advising find-file rather than using find-file-hook.