From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nick Dokos Subject: Re: serious calendar integration bug Date: Thu, 28 Apr 2011 08:43:27 -0400 Message-ID: <10947.1303994607@alphaville.dokosmarshall.org> References: <87y62vqzln.wl%dmaus@ictsoc.de> Reply-To: nicholas.dokos@hp.com Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([140.186.70.92]:46292) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QFRVa-00011D-Vx for emacs-orgmode@gnu.org; Thu, 28 Apr 2011 09:43:55 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QFRVa-0000dn-0Y for emacs-orgmode@gnu.org; Thu, 28 Apr 2011 09:43:54 -0400 Received: from vms173017pub.verizon.net ([206.46.173.17]:54407) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QFRVZ-0000dE-TZ for emacs-orgmode@gnu.org; Thu, 28 Apr 2011 09:43:53 -0400 Received: from alphaville.dokosmarshall.org ([unknown] [173.76.32.106]) by vms173017.mailsrvcs.net (Sun Java(tm) System Messaging Server 7u2-7.02 32bit (built Apr 16 2009)) with ESMTPA id <0LKD00DOS4OFZM50@vms173017.mailsrvcs.net> for emacs-orgmode@gnu.org; Thu, 28 Apr 2011 07:43:34 -0500 (CDT) In-reply-to: Message from Matt Price of "Thu\, 28 Apr 2011 08\:02\:33 EDT." List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Matt Price Cc: nicholas.dokos@hp.com, Org Mode Matt Price wrote: > hmm.=C2=A0 There's definitely something funny going on, I presume with em= acs rather than org, and (again > presumably) something to do with my configs or installed packages. The fu= nction that's failing is > org-eval-in-calendar: >=20 > =C2=A0debug(error (wrong-type-argument window-live-p nil)) > =C2=A0 select-window(nil) > =C2=A0 org-eval-in-calendar(nil t) >=20 > If we look at the defun: >=20 > (defun org-eval-in-calendar (form &optional keepdate) > =C2=A0 "Eval FORM in the calendar window and return to current window. > Also, store the cursor date in variable org-ans2." > =C2=A0 (let ((sf (selected-frame)) > =C2=A0=C2=A0=C2=A0 (sw (selected-window))) > =C2=A0=C2=A0=C2=A0 (select-window (get-buffer-window "*Calendar*" t)) > =C2=A0=C2=A0=C2=A0 (eval form) > =C2=A0=C2=A0=C2=A0 (when (and (not keepdate) (calendar-cursor-to-date)) > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (let* ((date (calendar-cursor-to-date)) > =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0=C2=A0 (time (encode-time 0 0 0 (nth= 1 date) (nth 0 date) (nth 2 date)))) > =C2=A0=C2=A0=C2=A0 (setq org-ans2 (format-time-string "%Y-%m-%d" time)))) > =C2=A0=C2=A0=C2=A0 (move-overlay org-date-ovl (1- (point)) (1+ (point)) (= current-buffer)) > =C2=A0=C2=A0=C2=A0 (select-window sw) > =C2=A0=C2=A0=C2=A0 (org-select-frame-set-input-focus sf))) >=20 > ------- > I think emacs is having trouble finding the buffer '*Calendar*' -- even t= hough it clearly exists and > can be manually selected using C-x b.=C2=A0 I could verify this by just e= val-defun'ing this line: > (select-window (get-buffer-window "*Calendar*" t)) >=20 > from the scratch buffer -- this produces the same backtrace.=C2=A0 Howeve= r, oddly, after experiencing the > same issue about 6 times in a row, the problem mysteriously disappeared j= ust now, and the procedure > is working fine.=C2=A0 I have no idea what the issue is there -- I'll rep= ort when I find it again.=C2=A0 Maybe > someone on the list can give me suggestions for debugging if it shows up = again?=C2=A0 Thanks, >=20 One thing is to make sure that it is the first select-window which is faili= ng: there is a second one in there as well. Toggling debug-on-error and getting a full backtrace (assuming you are loading .el files and not .elc files) wo= uld take care of that. If there were any concurrency, I'd suspect a race: you try to select a wind= ow that somebody else killed in the meantime. But I don't think there is anyth= ing like that going in emacs - but I don't know for sure. Nick