forgot to reply to the list..
---------- Forwarded message ----------
From:
Matt Price <moptop99@gmail.com>
Date: Wed, Apr 27, 2011 at 6:11 PM
Subject: Re: [O] serious calendar integration bug
To: David Maus <
dmaus@ictsoc.de>
On Wed, Apr 27, 2011 at 3:11 PM, David Maus
<dmaus@ictsoc.de> wrote:
At Wed, 27 Apr 2011 11:06:38 -0400,
Matt Price wrote:
>
> [1 <text/plain; ISO-8859-1 (7bit)>]
>
> [2 <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. 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