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#8920: 24.0.50; Calendar raises error with #included diary file Date: Sun, 26 Jun 2011 02:19:14 +0200 Message-ID: <87ei2hsav1.fsf@escher.fritz.box> 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 X-Trace: dough.gmane.org 1309047633 15166 80.91.229.12 (26 Jun 2011 00:20:33 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sun, 26 Jun 2011 00:20:33 +0000 (UTC) Cc: 8920@debbugs.gnu.org To: Glenn Morris Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Jun 26 02:20:29 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 1Qad5R-0000Sv-4j for geb-bug-gnu-emacs@m.gmane.org; Sun, 26 Jun 2011 02:20:29 +0200 Original-Received: from localhost ([::1]:44368 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qad5P-0007WV-SH for geb-bug-gnu-emacs@m.gmane.org; Sat, 25 Jun 2011 20:20:28 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:57117) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qad54-0007Uv-F2 for bug-gnu-emacs@gnu.org; Sat, 25 Jun 2011 20:20:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Qad52-0002bO-V3 for bug-gnu-emacs@gnu.org; Sat, 25 Jun 2011 20:20:06 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:37965) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qad52-0002az-Fr for bug-gnu-emacs@gnu.org; Sat, 25 Jun 2011 20:20:04 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1Qad52-0008Eb-3H; Sat, 25 Jun 2011 20:20:04 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stephen Berman Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 26 Jun 2011 00:20:04 +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.130904756431602 (code B ref 8920); Sun, 26 Jun 2011 00:20:04 +0000 Original-Received: (at 8920) by debbugs.gnu.org; 26 Jun 2011 00:19:24 +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 1Qad4N-0008Df-OO for submit@debbugs.gnu.org; Sat, 25 Jun 2011 20:19:24 -0400 Original-Received: from mailout-de.gmx.net ([213.165.64.22]) by debbugs.gnu.org with smtp (Exim 4.69) (envelope-from ) id 1Qad4L-0008DS-Lg for 8920@debbugs.gnu.org; Sat, 25 Jun 2011 20:19:22 -0400 Original-Received: (qmail invoked by alias); 26 Jun 2011 00:19:15 -0000 Original-Received: from i59F56A71.versanet.de (EHLO escher.home) [89.245.106.113] by mail.gmx.net (mp058) with SMTP; 26 Jun 2011 02:19:15 +0200 X-Authenticated: #20778731 X-Provags-ID: V01U2FsdGVkX19mqPEY/lRmJJ/Yn0CLRKEaVyZiYufWu0dM9s7nPV W8SZtNSTf/GzyY Original-Received: by escher.home (Postfix, from userid 1000) id 4F1315F91A; Sun, 26 Jun 2011 02:19:14 +0200 (CEST) In-Reply-To: (Glenn Morris's message of "Sat, 25 Jun 2011 18:25:18 -0400") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) X-Y-GMX-Trusted: 0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list Resent-Date: Sat, 25 Jun 2011 20:20:04 -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:47476 Archived-At: On Sat, 25 Jun 2011 18:25:18 -0400 Glenn Morris wrote: > Stephen Berman wrote: >> (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. Yes, though I've ascertained that this only happens when the included file is not already being visited in a buffer when calendar is invoked -- that's what triggers the inappropriate function in find-file-hook. > 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. Hm, I'd rather not take that advice ;-). But I've now put the function on post-command-hook and so far it seems to DTRT and also avoids the problem with find-file-hook. Thanks for the helpful feedback. Steve Berman