From mboxrd@z Thu Jan 1 00:00:00 1970 From: Matt Price Subject: serious calendar integration bug Date: Thu, 28 Apr 2011 08:02:33 -0400 Message-ID: References: <87y62vqzln.wl%dmaus@ictsoc.de> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=20cf3071cbb225919d04a1f95599 Return-path: Received: from eggs.gnu.org ([140.186.70.92]:39023) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QFPvY-0001WP-Q4 for emacs-orgmode@gnu.org; Thu, 28 Apr 2011 08:02:38 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QFPvX-0002HK-4y for emacs-orgmode@gnu.org; Thu, 28 Apr 2011 08:02:36 -0400 Received: from mail-vw0-f41.google.com ([209.85.212.41]:41425) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QFPvW-0002HF-VT for emacs-orgmode@gnu.org; Thu, 28 Apr 2011 08:02:35 -0400 Received: by vws4 with SMTP id 4so2564170vws.0 for ; Thu, 28 Apr 2011 05:02:34 -0700 (PDT) In-Reply-To: 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: Org Mode --20cf3071cbb225919d04a1f95599 Content-Type: text/plain; charset=ISO-8859-1 forgot to reply to the list.. ---------- Forwarded message ---------- From: Matt Price Date: Wed, Apr 27, 2011 at 6:11 PM Subject: Re: [O] serious calendar integration bug To: David Maus On Wed, Apr 27, 2011 at 3:11 PM, David Maus wrote: > At Wed, 27 Apr 2011 11:06:38 -0400, > Matt Price wrote: > > > > [1 ] > > > > [2 ] > > Hi folks, > > > > Using a recent git version of org-mode (release_7.5.209.g1a687) with a > fairly recent emacs-snapshot (20110408-1, a package from the debian > emacs-snapshot ppa, but running under ubuntu maverick), I'm having a > > really terrible calendar bug -- not sure if it comes from org or from > emacs, but reporting here in case anyone else has seen it. Attempts to > insert a timestamped schedule or deadline using C-c C-s or C-c C-d > > bring up an EMPTY buffer called Calendar, while REPLACING THE CONTENTS of > the active buffer with the text of a calendar. I had a near-catastrophic > moment where I killed what I thought was a calendar buffer, > > but then ended up erasing my main reference file for all my org notes. > Has anyone seen this behaviour? And do you think it comes form org or > calendar? > > I can't reproduce this with > > GNU Emacs 24.0.50.1 (i486-pc-linux-gnu, GTK+ Version 2.24.3) of > 2011-04-08 on cigue, modified by Debian > > Org-mode version 7.5 (release_7.5.211.gb0094) > > I also tried with release_7.5.209.g1a687 but no luck: I created a new > Org buffer, entered a new headling and scheduling/deadlining with C-c > C-s and C-c C-d worked as expected. > > hmm. There's definitely something funny going on, I presume with emacs rather than org, and (again presumably) something to do with my configs or installed packages. The function that's failing is org-eval-in-calendar: debug(error (wrong-type-argument window-live-p nil)) select-window(nil) org-eval-in-calendar(nil t) If we look at the defun: (defun org-eval-in-calendar (form &optional keepdate) "Eval FORM in the calendar window and return to current window. Also, store the cursor date in variable org-ans2." (let ((sf (selected-frame)) (sw (selected-window))) (select-window (get-buffer-window "*Calendar*" t)) (eval form) (when (and (not keepdate) (calendar-cursor-to-date)) (let* ((date (calendar-cursor-to-date)) (time (encode-time 0 0 0 (nth 1 date) (nth 0 date) (nth 2 date)))) (setq org-ans2 (format-time-string "%Y-%m-%d" time)))) (move-overlay org-date-ovl (1- (point)) (1+ (point)) (current-buffer)) (select-window sw) (org-select-frame-set-input-focus sf))) ------- I think emacs is having trouble finding the buffer '*Calendar*' -- even though it clearly exists and can be manually selected using C-x b. I could verify this by just eval-defun'ing this line: (select-window (get-buffer-window "*Calendar*" t)) from the scratch buffer -- this produces the same backtrace. However, oddly, after experiencing the same issue about 6 times in a row, the problem mysteriously disappeared just now, and the procedure is working fine. I have no idea what the issue is there -- I'll report when I find it again. Maybe someone on the list can give me suggestions for debugging if it shows up again? Thanks, Matt Best, > -- David > > -- > OpenPGP... 0x99ADB83B5A4478E6 > Jabber.... dmjena@jabber.org > Email..... dmaus@ictsoc.de > --20cf3071cbb225919d04a1f95599 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable forgot to reply=A0 to the list..

--------= -- Forwarded message ----------
From: Matt= Price <mopt= op99@gmail.com>
Date: Wed, Apr 27, 2011 at 6:11 PM
Subject: Re: [O] serious calendar int= egration bug
To: David Maus <dmaus= @ictsoc.de>




On Wed, Apr 27, 2011 at 3:11 PM, David Maus <dmaus@i= ctsoc.de> wrote:
At Wed, 27 Apr 2011 11:06:38 -0400,
Matt Price wrote:
>
> [1 =A0<text/plain; ISO-8859-1 (7bit)>]
>
> [2 =A0<text/html; ISO-8859-1 (quoted-printable)>]
> Hi folks,
>
> Using a recent git version of org-mode (release_7.5.209.g1a687) with a= fairly recent emacs-snapshot (20110408-1, a package from the debian emacs-= snapshot ppa, but running under ubuntu maverick), I'm having a
> really terrible calendar bug -- not sure if it comes from org or from = emacs, but reporting here in case anyone else has seen it.=A0 Attempts to i= nsert a timestamped schedule or deadline using C-c C-s or C-c C-d
> bring up an EMPTY buffer called Calendar, while REPLACING THE CONTENTS= of the active buffer with the text of a calendar.=A0 I had a near-catastro= phic moment where I killed what I thought was a calendar buffer,
> but then ended up erasing my main reference file for all my org notes.= =A0 Has anyone seen this behaviour?=A0 And do you think it comes form org o= r calendar?

I can't reproduce this with

GNU Emacs 24.0.50.1 (i486-pc-linux-gnu, GTK+ Version 2.24.3) of
=A02011-04-08 on cigue, modified by Debian

Org-mode version 7.5 (release_7.5.211.gb0094)

I also tried with release_7.5.209.g1a687 but no luck: I created a new
Org buffer, entered a new headling and scheduling/deadlining with C-c
C-s and C-c C-d worked as expected.


hmm.=A0 There's definitely someth= ing funny going on, I presume with emacs rather than org, and (again presum= ably) something to do with my configs or installed packages. The function t= hat's failing is org-eval-in-calendar:

=A0debug(error (wrong-type-argument window-live-p nil))
=A0 select-w= indow(nil)
=A0 org-eval-in-calendar(nil t)

If we look at the defu= n:

(defun org-eval-in-calendar (form &optional keepdate)
=A0= "Eval FORM in the calendar window and return to current window.
Also, store the cursor date in variable org-ans2."
=A0 (let ((sf (s= elected-frame))
=A0=A0=A0 (sw (selected-window)))
=A0=A0=A0 (select-w= indow (get-buffer-window "*Calendar*" t))
=A0=A0=A0 (eval form= )
=A0=A0=A0 (when (and (not keepdate) (calendar-cursor-to-date))
=A0=A0=A0=A0=A0 (let* ((date (calendar-cursor-to-date))
=A0=A0=A0 =A0=A0= =A0=A0 (time (encode-time 0 0 0 (nth 1 date) (nth 0 date) (nth 2 date))))=A0=A0=A0 (setq org-ans2 (format-time-string "%Y-%m-%d" time)))= )
=A0=A0=A0 (move-overlay org-date-ovl (1- (point)) (1+ (point)) (curren= t-buffer))
=A0=A0=A0 (select-window sw)
=A0=A0=A0 (org-select-frame-set-input-focus= sf)))

-------
I think emacs is having trouble finding the buffer= '*Calendar*' -- even though it clearly exists and can be manually = selected using C-x b.=A0 I could verify this by just eval-defun'ing thi= s line:
(select-window (get-buffer-window "*Calendar*" t))

from = the scratch buffer -- this produces the same backtrace.=A0 However, oddly, = after experiencing the same issue about 6 times in a row, the problem myste= riously disappeared just now, and the procedure is working fine.=A0 I have = no idea what the issue is there -- I'll report when I find it again.=A0= Maybe someone on the list can give me suggestions for debugging if it show= s up again?=A0 Thanks,

Matt

Best,
=A0-- David

--
OpenPGP... 0x99ADB83B5A4478E6
Jabber.... dmjena@ja= bber.org
Email..... dmaus@ictso= c.de


--20cf3071cbb225919d04a1f95599--