all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Marco Wahl <marcowahlsoft@gmail.com>
To: emacs-orgmode@gnu.org
Subject: Re: Org Clock Error
Date: Thu, 14 Jan 2016 09:45:45 +0100	[thread overview]
Message-ID: <84fuy0mtvq.fsf@gmail.com> (raw)
In-Reply-To: 87ziw9aqxi.fsf@pierrot.dokosmarshall.org

Nick Dokos <ndokos@gmail.com> writes:

> Mike McLean <mike.mclean@pobox.com> writes:
>
>> Hello
>>
>> In the last few days I started getting an error when moving tasks to the DONE state.
>>
>> I have ~(setq org-clock-out-when-done t)~ in my Emacs configuration. 
>>
>> I get the following back trace when I mark a task as done:
>>
>> Debugger entered--Lisp error: (void-variable org-state)
>>   (member org-state org-done-keywords)
>>   ...
>>   org-clock-out-if-current()
>>   run-hooks(org-after-todo-state-change-hook)
>>   ...
>>   org-todo(nil)
>
> This is probably a lexical binding problem: org-state is supposed to be
> dynamically bound by org-todo and then used by org-clock-out-if-current,
> but it seems that the communication is lost.
>
> I'm not sure what the solution is (I haven't really followed the
> upstream discussion), but I wonder if adding
>
> (defvar org-state)
>
> in org.el, just before the
>
> (defun org-todo ...
>
> line is enough to resolve the problem (basically letting org-todo know
> that org-state is dynamically bound).
>
> Untested and possibly wrong.

Manually tested your suggestion and it fixes the issue of '(void-variable
org-state)'.

Technically I'm not sure what a reliable fix looks like.  There is
e.g. already the line

(defvar org-state) ;; dynamically scoped into this function

in org-clock.el.


Best regards,
-- 
Marco Wahl
GPG: 0x49010A040A3AE6F2

  reply	other threads:[~2016-01-14  8:46 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-13 22:38 Org Clock Error Mike McLean
2016-01-14  1:30 ` Nick Dokos
2016-01-14  8:45   ` Marco Wahl [this message]
2016-01-14 15:59     ` Nick Dokos
2016-01-14 17:30       ` Nick Dokos
2016-01-15 11:03         ` Marco Wahl
2016-01-15 20:27           ` Nick Dokos

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

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

  git send-email \
    --in-reply-to=84fuy0mtvq.fsf@gmail.com \
    --to=marcowahlsoft@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    /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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.