From unknown Wed Aug 20 05:43:25 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#8920 <8920@debbugs.gnu.org> To: bug#8920 <8920@debbugs.gnu.org> Subject: Status: 24.0.50; Calendar raises error with #included diary file Reply-To: bug#8920 <8920@debbugs.gnu.org> Date: Wed, 20 Aug 2025 12:43:25 +0000 retitle 8920 24.0.50; Calendar raises error with #included diary file reassign 8920 emacs submitter 8920 Stephen Berman severity 8920 normal thanks From debbugs-submit-bounces@debbugs.gnu.org Wed Jun 22 19:03:42 2011 Received: (at submit) by debbugs.gnu.org; 22 Jun 2011 23:03:42 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QZWSS-0002ZI-Ob for submit@debbugs.gnu.org; Wed, 22 Jun 2011 19:03:41 -0400 Received: from eggs.gnu.org ([140.186.70.92]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QZWSQ-0002Z5-F8 for submit@debbugs.gnu.org; Wed, 22 Jun 2011 19:03:39 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QZWSJ-00088B-O4 for submit@debbugs.gnu.org; Wed, 22 Jun 2011 19:03:33 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,T_RP_MATCHES_RCVD,T_TO_NO_BRKTS_FREEMAIL autolearn=unavailable version=3.3.1 Received: from lists.gnu.org ([140.186.70.17]:53972) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QZWSJ-000887-Gp for submit@debbugs.gnu.org; Wed, 22 Jun 2011 19:03:31 -0400 Received: from eggs.gnu.org ([140.186.70.92]:33518) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QZWSH-0004Pu-O1 for bug-gnu-emacs@gnu.org; Wed, 22 Jun 2011 19:03:31 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QZWSF-000878-HP for bug-gnu-emacs@gnu.org; Wed, 22 Jun 2011 19:03:29 -0400 Received: from mailout-de.gmx.net ([213.165.64.22]:49593) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1QZWSE-00085h-NE for bug-gnu-emacs@gnu.org; Wed, 22 Jun 2011 19:03:27 -0400 Received: (qmail invoked by alias); 22 Jun 2011 23:03:23 -0000 Received: from i59F57D06.versanet.de (EHLO escher.home) [89.245.125.6] by mail.gmx.net (mp056) with SMTP; 23 Jun 2011 01:03:23 +0200 X-Authenticated: #20778731 X-Provags-ID: V01U2FsdGVkX1/Js+UjFgTJG+MKuKYiJtQfTXYl9Fz8Ya0KaOFod/ q5coEwPB4bbzPa Received: by escher.home (Postfix, from userid 1000) id 2A4C15F8D8; Thu, 23 Jun 2011 01:03:22 +0200 (CEST) From: Stephen Berman To: bug-gnu-emacs@gnu.org Subject: 24.0.50; Calendar raises error with #included diary file Date: Thu, 23 Jun 2011 01:03:21 +0200 Message-ID: <878vst8o5i.fsf@escher.fritz.box> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Y-GMX-Trusted: 0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 140.186.70.17 X-Spam-Score: -4.6 (----) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -4.6 (----) --=-=-= Content-Type: text/plain 1. Let the file ~/diary consist of the line between start and end: -----start #include "~/test" end------ 2. Let ~/test be readable; it's content is irrelevant (can be empty). 3. Let ~/.emacs consist of the lines between start and end: -----start (add-hook 'find-file-hook (lambda () (set-window-buffer (selected-window) (set-buffer (current-buffer))))) (custom-set-variables '(calendar-mark-diary-entries-flag t) '(calendar-today-visible-hook (quote (calendar-mark-today))) '(diary-list-entries-hook (quote (diary-include-other-diary-files))) '(diary-mark-entries-hook (quote (diary-mark-included-diary-files)))) end------ 4. Invoke emacs (without -Q) 5. Type `M-x calendar RET' => Wrong type argument: number-or-marker-p, nil The Calendar is displayed in the lower window, but today's date is not marked, and the cursor is at the beginning of the buffer. Here is the backtrace from entering the debugger on error: --=-=-= Content-Type: application/octet-stream Content-Disposition: attachment; filename=backtrace Content-Transfer-Encoding: base64 Content-Description: backtrace RGVidWdnZXIgZW50ZXJlZC0tTGlzcCBlcnJvcjogKHdyb25nLXR5cGUtYXJndW1lbnQgbnVtYmVy LW9yLW1hcmtlci1wIG5pbCkKICBjYWxlbmRhci1kYXRlLWlzLXZhbGlkLXAobmlsKQogIGNhbGVu ZGFyLW1hcmstdmlzaWJsZS1kYXRlKG5pbCBjYWxlbmRhci10b2RheSkKICBjYWxlbmRhci1tYXJr LXRvZGF5KCkKICBydW4taG9va3MoY2FsZW5kYXItdG9kYXktdmlzaWJsZS1ob29rKQogIGJ5dGUt Y29kZSgiCFwyMDMLAFwzMDFcMzAyIVwyMTBcMjAyDwBcMzAxXDMwMyFcMjEwXDMwMVwyMDciIFt0 b2RheS12aXNpYmxlIHJ1bi1ob29rcyBjYWxlbmRhci10b2RheS12aXNpYmxlLWhvb2sgY2FsZW5k YXItdG9kYXktaW52aXNpYmxlLWhvb2tdIDIpCiAgY2FsZW5kYXItZ2VuZXJhdGUtd2luZG93KDYg MjAxMSkKICBjYWxlbmRhci1iYXNpYy1zZXR1cChuaWwpCiAgY2FsZW5kYXIobmlsKQogIGNhbGwt aW50ZXJhY3RpdmVseShjYWxlbmRhciB0IG5pbCkKICBleGVjdXRlLWV4dGVuZGVkLWNvbW1hbmQo bmlsKQogIGNhbGwtaW50ZXJhY3RpdmVseShleGVjdXRlLWV4dGVuZGVkLWNvbW1hbmQgbmlsIG5p bCkK --=-=-= Content-Type: text/plain When I repeat the above recipe through step 4, then instrument the lambda expression in .emacs for edebugging, then invoke the Calendar and step through the lambda sexp, the Calendar first appears, then its window is occupied by the diary buffer, then by the buffer of ~/test, and finally by the diary again. No error is raised, and when I switch to the *Calendar* buffer, today's date is shown marked. In GNU Emacs 24.0.50.1 (i686-suse-linux-gnu, GTK+ Version 2.20.1) of 2011-06-04 on escher Windowing system distributor `The X.Org Foundation', version 11.0.10800000 configured using `configure '--without-toolkit-scroll-bars' 'CFLAGS=-g -O2 -fno-optimize-sibling-calls'' Important settings: value of $LC_ALL: nil value of $LC_COLLATE: nil value of $LC_CTYPE: nil value of $LC_MESSAGES: nil value of $LC_MONETARY: nil value of $LC_NUMERIC: nil value of $LC_TIME: nil value of $LANG: en_US.UTF-8 value of $XMODIFIERS: @im=local locale-coding-system: utf-8-unix default enable-multibyte-characters: t --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Fri Jun 24 14:49:51 2011 Received: (at 8920) by debbugs.gnu.org; 24 Jun 2011 18:49:52 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QaBRu-0003F0-Th for submit@debbugs.gnu.org; Fri, 24 Jun 2011 14:49:51 -0400 Received: from fencepost.gnu.org ([140.186.70.10]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QaBRt-0003Eo-K7 for 8920@debbugs.gnu.org; Fri, 24 Jun 2011 14:49:50 -0400 Received: from localhost ([127.0.0.1]:47107) by fencepost.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QaBRn-00023o-H2; Fri, 24 Jun 2011 14:49:43 -0400 From: Glenn Morris To: Stephen Berman Subject: Re: bug#8920: 24.0.50; Calendar raises error with #included diary file References: <878vst8o5i.fsf@escher.fritz.box> X-Spook: Treasury doctrine Echelon Taiwan FTS2000 Merlin Mena X-Ran: $AAS)[\&5&+ay6EGpb+Xtfk,eB]ql7,[F.Tcz{8g;m/Oh0Ep*=f)LI-b<@2HVoCg`+&*77 X-Hue: cyan X-Debbugs-No-Ack: yes X-Attribution: GM Date: Fri, 24 Jun 2011 14:49:43 -0400 Message-ID: User-Agent: Gnus (www.gnus.org), GNU Emacs (www.gnu.org/software/emacs/) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Spam-Score: -6.3 (------) X-Debbugs-Envelope-To: 8920 Cc: 8920@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.3 (------) 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? Since find-file-noselect runs find-file-hook, at first sight it looks to me like all you are doing is deliberately breaking find-file-noselect. So my initial reaction is: "if it hurts when you do that, don't do that". From debbugs-submit-bounces@debbugs.gnu.org Fri Jun 24 17:32:45 2011 Received: (at 8920) by debbugs.gnu.org; 24 Jun 2011 21:32:46 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QaDzZ-0006uT-Gm for submit@debbugs.gnu.org; Fri, 24 Jun 2011 17:32:45 -0400 Received: from mailout-de.gmx.net ([213.165.64.22]) by debbugs.gnu.org with smtp (Exim 4.69) (envelope-from ) id 1QaDzS-0006uC-KP for 8920@debbugs.gnu.org; Fri, 24 Jun 2011 17:32:44 -0400 Received: (qmail invoked by alias); 24 Jun 2011 21:32:32 -0000 Received: from i59F547A0.versanet.de (EHLO escher.home) [89.245.71.160] by mail.gmx.net (mp062) with SMTP; 24 Jun 2011 23:32:32 +0200 X-Authenticated: #20778731 X-Provags-ID: V01U2FsdGVkX18JBwkYDyEJr4NQth0pW9sD3EgfaxgJkMGUy0Iywc BWzb8WtCj+l1aQ Received: by escher.home (Postfix, from userid 1000) id 452615F926; Fri, 24 Jun 2011 23:32:31 +0200 (CEST) From: Stephen Berman To: Glenn Morris Subject: Re: bug#8920: 24.0.50; Calendar raises error with #included diary file References: <878vst8o5i.fsf@escher.fritz.box> Date: Fri, 24 Jun 2011 23:32:31 +0200 In-Reply-To: (Glenn Morris's message of "Fri, 24 Jun 2011 14:49:43 -0400") Message-ID: <87pqm229w0.fsf@escher.fritz.box> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Y-GMX-Trusted: 0 X-Spam-Score: -3.0 (---) X-Debbugs-Envelope-To: 8920 Cc: 8920@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -3.0 (---) 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? I'm working on a new version of Todo mode (which I hope to submit for possible inclusion in Emacs 24, depending on when the feature freeze begins) which is defined so that visiting a file assigned (by auto-mode-alist) to that mode executes code to display the file appropriately by calling the new version of todo-show, which contains the set-window-buffer sexp. And such a file is suitable for diary inclusion, because it may contain Todo items that are recognized as diary entries. > Since find-file-noselect runs find-file-hook, at first sight it looks to > me like all you are doing is deliberately breaking find-file-noselect. The above is just the minimal self-contained code that induces the error; in the actual code the set-window-buffer sexp is contained in a conditional call to the new version of todo-show. It isn't necessary to do this in find-file-hook; in fact, I had previously included the conditional call directly in the new version of the mode function todo-mode, then thought it would be cleaner to delegate it to a hook. But maybe you're right that find-file-hook isn't appropriate. In any case, the Calendar problem is caused by calling that sexp, whether or not it is in find-file-hook. > So my initial reaction is: "if it hurts when you do that, don't do that". I anticipated this reaction, and even had it myself, after encountering the problem; the thing is, I didn't know I was doing that :-(. That is, 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. Steve Berman From debbugs-submit-bounces@debbugs.gnu.org Sat Jun 25 16:18:20 2011 Received: (at 8920) by debbugs.gnu.org; 25 Jun 2011 20:18:21 +0000 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 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 Received: (qmail invoked by alias); 25 Jun 2011 20:18:10 -0000 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 Received: by escher.home (Postfix, from userid 1000) id 16CD35F91A; Sat, 25 Jun 2011 22:18:09 +0200 (CEST) From: Stephen Berman To: Glenn Morris Subject: Re: bug#8920: 24.0.50; Calendar raises error with #included diary file References: <878vst8o5i.fsf@escher.fritz.box> <87pqm229w0.fsf@escher.fritz.box> Date: Sat, 25 Jun 2011 22:18:08 +0200 In-Reply-To: <87pqm229w0.fsf@escher.fritz.box> (Stephen Berman's message of "Fri, 24 Jun 2011 23:32:31 +0200") Message-ID: <87iprtsm0v.fsf@escher.fritz.box> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Y-GMX-Trusted: 0 X-Spam-Score: -3.0 (---) X-Debbugs-Envelope-To: 8920 Cc: 8920@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -3.0 (---) 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))))) From debbugs-submit-bounces@debbugs.gnu.org Sat Jun 25 18:25:26 2011 Received: (at 8920) by debbugs.gnu.org; 25 Jun 2011 22:25:27 +0000 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 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 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 From: Glenn Morris To: Stephen Berman Subject: Re: bug#8920: 24.0.50; Calendar raises error with #included diary file References: <878vst8o5i.fsf@escher.fritz.box> <87pqm229w0.fsf@escher.fritz.box> <87iprtsm0v.fsf@escher.fritz.box> 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-Debbugs-No-Ack: yes X-Attribution: GM Date: Sat, 25 Jun 2011 18:25:18 -0400 Message-ID: User-Agent: Gnus (www.gnus.org), GNU Emacs (www.gnu.org/software/emacs/) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Spam-Score: -6.3 (------) X-Debbugs-Envelope-To: 8920 Cc: 8920@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.3 (------) 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. From debbugs-submit-bounces@debbugs.gnu.org Sat Jun 25 20:19:24 2011 Received: (at 8920) by debbugs.gnu.org; 26 Jun 2011 00:19:24 +0000 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 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 Received: (qmail invoked by alias); 26 Jun 2011 00:19:15 -0000 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 Received: by escher.home (Postfix, from userid 1000) id 4F1315F91A; Sun, 26 Jun 2011 02:19:14 +0200 (CEST) From: Stephen Berman To: Glenn Morris Subject: Re: bug#8920: 24.0.50; Calendar raises error with #included diary file References: <878vst8o5i.fsf@escher.fritz.box> <87pqm229w0.fsf@escher.fritz.box> <87iprtsm0v.fsf@escher.fritz.box> Date: Sun, 26 Jun 2011 02:19:14 +0200 In-Reply-To: (Glenn Morris's message of "Sat, 25 Jun 2011 18:25:18 -0400") Message-ID: <87ei2hsav1.fsf@escher.fritz.box> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Y-GMX-Trusted: 0 X-Spam-Score: -3.0 (---) X-Debbugs-Envelope-To: 8920 Cc: 8920@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -3.0 (---) 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 From debbugs-submit-bounces@debbugs.gnu.org Sat Jun 25 21:25:30 2011 Received: (at 8920) by debbugs.gnu.org; 26 Jun 2011 01:25:30 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Qae6L-0004Js-TR for submit@debbugs.gnu.org; Sat, 25 Jun 2011 21:25:30 -0400 Received: from fencepost.gnu.org ([140.186.70.10]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Qae6K-0004Jf-DN for 8920@debbugs.gnu.org; Sat, 25 Jun 2011 21:25:28 -0400 Received: from localhost ([127.0.0.1]:34212) by fencepost.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qae6E-0001hh-OF; Sat, 25 Jun 2011 21:25:22 -0400 From: Glenn Morris To: Stephen Berman Subject: Re: bug#8920: 24.0.50; Calendar raises error with #included diary file References: <878vst8o5i.fsf@escher.fritz.box> <87pqm229w0.fsf@escher.fritz.box> <87iprtsm0v.fsf@escher.fritz.box> <87ei2hsav1.fsf@escher.fritz.box> X-Spook: INS hackers PGP AGT. AMME passwd Etacs Fortezza insurgency X-Ran: MUY9{8PL_Lz]bY$IfpMUNbT]@+!D+I1^r7ZiY([Co75SYNoa\$d@:L.q (Stephen Berman's message of "Sun, 26 Jun 2011 02:19:14 +0200") Message-ID: <3gaad54c59.fsf@fencepost.gnu.org> User-Agent: Gnus (www.gnus.org), GNU Emacs (www.gnu.org/software/emacs/) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Spam-Score: -6.3 (------) X-Debbugs-Envelope-To: 8920 Cc: 8920@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.3 (------) OK. Can this be closed? From debbugs-submit-bounces@debbugs.gnu.org Sun Jun 26 07:10:03 2011 Received: (at 8920-done) by debbugs.gnu.org; 26 Jun 2011 11:10:03 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QanE2-00058G-2Y for submit@debbugs.gnu.org; Sun, 26 Jun 2011 07:10:02 -0400 Received: from mailout-de.gmx.net ([213.165.64.22]) by debbugs.gnu.org with smtp (Exim 4.69) (envelope-from ) id 1QanDz-00057y-Oo for 8920-done@debbugs.gnu.org; Sun, 26 Jun 2011 07:10:01 -0400 Received: (qmail invoked by alias); 26 Jun 2011 11:09:53 -0000 Received: from i59F5435F.versanet.de (EHLO escher.home) [89.245.67.95] by mail.gmx.net (mp038) with SMTP; 26 Jun 2011 13:09:53 +0200 X-Authenticated: #20778731 X-Provags-ID: V01U2FsdGVkX19UgqB7FK5UClUcOWjENnwKWD7GqWtsfiNXi7qdlG Ns+vlpC8236hX5 Received: by escher.home (Postfix, from userid 1000) id 80EFD5F926; Sun, 26 Jun 2011 13:09:51 +0200 (CEST) From: Stephen Berman To: Glenn Morris Subject: Re: bug#8920: 24.0.50; Calendar raises error with #included diary file References: <878vst8o5i.fsf@escher.fritz.box> <87pqm229w0.fsf@escher.fritz.box> <87iprtsm0v.fsf@escher.fritz.box> <87ei2hsav1.fsf@escher.fritz.box> <3gaad54c59.fsf@fencepost.gnu.org> Date: Sun, 26 Jun 2011 13:09:51 +0200 In-Reply-To: <3gaad54c59.fsf@fencepost.gnu.org> (Glenn Morris's message of "Sat, 25 Jun 2011 21:25:22 -0400") Message-ID: <87pqm0etmo.fsf@escher.fritz.box> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Y-GMX-Trusted: 0 X-Spam-Score: -3.0 (---) X-Debbugs-Envelope-To: 8920-done Cc: 8920-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -3.0 (---) On Sat, 25 Jun 2011 21:25:22 -0400 Glenn Morris wrote: > OK. Can this be closed? Done. (Should've closed it with the previous post, sorry.) From unknown Wed Aug 20 05:43:25 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Sun, 24 Jul 2011 11:24:03 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator