Mike McLean <mike.mcl...@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. -- Nick