From mboxrd@z Thu Jan 1 00:00:00 1970 From: Marco Wahl Subject: Re: Org Clock Error Date: Thu, 14 Jan 2016 09:45:45 +0100 Message-ID: <84fuy0mtvq.fsf@gmail.com> References: <87ziw9aqxi.fsf@pierrot.dokosmarshall.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:47644) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aJdXo-00060m-Bi for emacs-orgmode@gnu.org; Thu, 14 Jan 2016 03:46:13 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aJdXl-0003rM-4V for emacs-orgmode@gnu.org; Thu, 14 Jan 2016 03:46:12 -0500 Received: from plane.gmane.org ([80.91.229.3]:41430) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aJdXk-0003qi-TT for emacs-orgmode@gnu.org; Thu, 14 Jan 2016 03:46:09 -0500 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1aJdXd-0007j9-0D for emacs-orgmode@gnu.org; Thu, 14 Jan 2016 09:46:01 +0100 Received: from hsi-kbw-085-216-069-216.hsi.kabelbw.de ([85.216.69.216]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 14 Jan 2016 09:46:00 +0100 Received: from marcowahlsoft by hsi-kbw-085-216-069-216.hsi.kabelbw.de with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 14 Jan 2016 09:46:00 +0100 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: emacs-orgmode@gnu.org Nick Dokos writes: > Mike McLean 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