emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Nick Dokos <nicholas.dokos@hp.com>
To: Matt Price <moptop99@gmail.com>
Cc: nicholas.dokos@hp.com, Org Mode <emacs-orgmode@gnu.org>
Subject: Re: serious calendar integration bug
Date: Thu, 28 Apr 2011 08:43:27 -0400	[thread overview]
Message-ID: <10947.1303994607@alphaville.dokosmarshall.org> (raw)
In-Reply-To: Message from Matt Price <moptop99@gmail.com> of "Thu\, 28 Apr 2011 08\:02\:33 EDT." <BANLkTinUoKng9rjh2k6+CHN860S_JxW7jw@mail.gmail.com>

Matt Price <moptop99@gmail.com> wrote:

> 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,
> 

One thing is to make sure that it is the first select-window which is failing:
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) would
take care of that.

If there were any concurrency, I'd suspect a race: you try to select a window
that somebody else killed in the meantime. But I don't think there is anything
like that going in emacs - but I don't know for sure.

Nick

  reply	other threads:[~2011-04-28 13:43 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-04-27 15:06 serious calendar integration bug Matt Price
2011-04-27 19:11 ` David Maus
     [not found]   ` <BANLkTikyRLuEFU1C=-2KOaAZ5k_is_=gUw@mail.gmail.com>
2011-04-28 12:02     ` Matt Price
2011-04-28 12:43       ` Nick Dokos [this message]
2011-04-28 17:05         ` Matt Price
2011-04-28 21:34       ` Daniel Clemente

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=10947.1303994607@alphaville.dokosmarshall.org \
    --to=nicholas.dokos@hp.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=moptop99@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).