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: Sat, 25 Jun 2011 22:18:08 +0200 Message-ID: <87iprtsm0v.fsf@escher.fritz.box> References: <878vst8o5i.fsf@escher.fritz.box> <87pqm229w0.fsf@escher.fritz.box> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1309033168 15113 80.91.229.12 (25 Jun 2011 20:19:28 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sat, 25 Jun 2011 20:19:28 +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 Sat Jun 25 22:19:24 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 1QaZK7-0001zj-P0 for geb-bug-gnu-emacs@m.gmane.org; Sat, 25 Jun 2011 22:19:23 +0200 Original-Received: from localhost ([::1]:48160 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QaZK6-0004t8-Jd for geb-bug-gnu-emacs@m.gmane.org; Sat, 25 Jun 2011 16:19:22 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:60320) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QaZJp-0004sd-2u for bug-gnu-emacs@gnu.org; Sat, 25 Jun 2011 16:19:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QaZJm-0004Dp-S0 for bug-gnu-emacs@gnu.org; Sat, 25 Jun 2011 16:19:04 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:40316) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QaZJm-0004Dl-Il for bug-gnu-emacs@gnu.org; Sat, 25 Jun 2011 16:19:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1QaZJm-0007V7-4y; Sat, 25 Jun 2011 16:19:02 -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: Sat, 25 Jun 2011 20:19: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.130903310128775 (code B ref 8920); Sat, 25 Jun 2011 20:19:02 +0000 Original-Received: (at 8920) by debbugs.gnu.org; 25 Jun 2011 20:18:21 +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 1QaZJ5-0007U3-Ma for submit@debbugs.gnu.org; Sat, 25 Jun 2011 16:18:20 -0400 Original-Received: from mailout-de.gmx.net ([213.165.64.22]) by debbugs.gnu.org with smtp (Exim 4.69) (envelope-from ) id 1QaZJ2-0007Tn-Qq for 8920@debbugs.gnu.org; Sat, 25 Jun 2011 16:18:18 -0400 Original-Received: (qmail invoked by alias); 25 Jun 2011 20:18:10 -0000 Original-Received: from i59F56A71.versanet.de (EHLO escher.home) [89.245.106.113] by mail.gmx.net (mp004) with SMTP; 25 Jun 2011 22:18:10 +0200 X-Authenticated: #20778731 X-Provags-ID: V01U2FsdGVkX1/Cz6o3yaXC43MS8PMSZXYaqX8/+f+kjKVQZDkgzs rMQA9ZIQFGkRbf Original-Received: by escher.home (Postfix, from userid 1000) id 16CD35F91A; Sat, 25 Jun 2011 22:18:09 +0200 (CEST) In-Reply-To: <87pqm229w0.fsf@escher.fritz.box> (Stephen Berman's message of "Fri, 24 Jun 2011 23:32:31 +0200") 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 16:19: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:47470 Archived-At: On Fri, 24 Jun 2011 23:32:31 +0200 Stephen Berman wrote: > On Fri, 24 Jun 2011 14:49:43 -0400 Glenn Morris wrote: > >> Stephen Berman wrote: >> >>> (add-hook 'find-file-hook >>> (lambda () (set-window-buffer (selected-window) >>> (set-buffer (current-buffer))))) >> >> Help me out: what is this supposed to be for? [...] > my intention was to invoke todo-show when the user chooses to visit a > todo file directly (instead of interactively calling todo-show); I > didn't consider the case where the file is visited programmatically. I > don't know how to distinguish the two cases in this context; > called-interactively-p won't DTRT, precisely because the command the > user invokes to visit the file is not part of Todo mode. So I'm hoping > there's a way within calendar.el to avoid the error. The following patch to calendar-generate-window fixes the problem for me, and seems like it shouldn't cause problems elsewhere. Steve Berman *** /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)))))