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) (and (eq t org-clock-out-when-done) (member org-state org-done-keywords)) (or (and (eq t org-clock-out-when-done) (member org-state org-done-keywords)) (and (listp org-clock-out-when-done) (member org-state org-clock-out-when-done))) (and (org-clocking-p) org-clock-out-when-done (marker-buffer org-clock-marker) (or (and (eq t org-clock-out-when-done) (member org-state org-done-keywords)) (and (listp org-clock-out-when-done) (member org-state org-clock-out-when-done))) (equal (or (buffer-base-buffer (org-clocking-buffer)) (org-clocking-buffer)) (or (buffer-base-buffer (current-buffer)) (current-buffer))) (< (point) org-clock-marker) (> (save-excursion (outline-next-heading) (point)) org-clock-marker)) (if (and (org-clocking-p) org-clock-out-when-done (marker-buffer org-clock-marker) (or (and (eq t org-clock-out-when-done) (member org-state org-done-keywords)) (and (listp org-clock-out-when-done) (member org-state org-clock-out-when-done))) (equal (or (buffer-base-buffer (org-clocking-buffer)) (org-clocking-buffer)) (or (buffer-base-buffer (current-buffer)) (current-buffer))) (< (point) org-clock-marker) (> (save-excursion (outline-next-heading) (point)) org-clock-marker)) (progn (let ((org-log-note-clock-out nil) (org-clock-out-switch-to-state nil)) (org-clock-out)))) org-clock-out-if-current() run-hooks(org-after-todo-state-change-hook) (let* ((match-data (match-data)) (startpos (point-at-bol)) (logging (let ((save-match-data-internal (match-data))) (unwind-protect (progn (org-entry-get nil "LOGGING" t t)) (set-match-data save-match-data-internal (quote evaporate))))) (org-log-done org-log-done) (org-log-repeat org-log-repeat) (org-todo-log-states org-todo-log-states) (org-inhibit-logging (if (equal arg 0) (progn (setq arg nil) (quote note)) org-inhibit-logging)) (this (match-string 1)) (hl-pos (match-beginning 0)) (head (org-get-todo-sequence-head this)) (ass (assoc head org-todo-kwd-alist)) (interpret (nth 1 ass)) (done-word (nth 3 ass)) (final-done-word (nth 4 ass)) (org-last-state (or this "")) (completion-ignore-case t) (member (member this org-todo-keywords-1)) (tail (cdr member)) (org-state (cond ((and org-todo-key-trigger (or (and ... ...) (and ... org-use-fast-todo-selection ...))) (org-fast-todo-selection)) ((and (equal arg (quote ...)) (or (not org-use-fast-todo-selection) (not org-todo-key-trigger))) (completing-read "State: " (mapcar (function list) org-todo-keywords-1) nil t)) ((eq arg (quote right)) (if this (if tail (car tail) nil) (car org-todo-keywords-1))) ((eq arg (quote left)) (if (equal member org-todo-keywords-1) nil (if this (nth ... org-todo-keywords-1) (org-last org-todo-keywords-1)))) ((and (eq org-use-fast-todo-selection t) (equal arg (quote ...)) (setq arg nil))) (arg (cond ((equal arg "") nil) ((eq arg ...) nil) ((eq arg ...) (or done-word ...)) ((eq arg ...) (or ... ...)) ((eq arg ...) (let ... ...)) ((car ...)) ((stringp arg) (user-error "State `%s' not valid in this file" arg)) ((nth ... org-todo-keywords-1)))) ((null member) (or head (car org-todo-keywords-1))) ((equal this final-done-word) nil) ((null tail) nil) ((memq interpret (quote (type priority))) (if (eq this-command last-command) (car tail) (if (> ... 0) (or done-word ...) nil))) (t (car tail)))) (org-state (or (run-hook-with-args-until-success (quote org-todo-get-default-hook) org-state org-last-state) org-state)) (next (if org-state (concat " " org-state " ") " ")) (change-plist (list :type (quote todo-state-change) :from this :to org-state :position startpos)) dolog now-done-p) (if org-blocker-hook (progn (setq org-last-todo-state-is-todo (not (member this org-done-keywords))) (if (save-excursion (let ((save-match-data-internal ...)) (unwind-protect (progn ...) (set-match-data save-match-data-internal ...)))) nil (if (with-no-warnings (called-interactively-p (quote interactive))) (user-error "TODO state change from %s to %s blocked (by \"%s\")" this org-state org-block-entry-blocking) (message "TODO state change from %s to %s blocked (by \"%s\")" this org-state org-block-entry-blocking) (throw (quote exit) nil))))) (store-match-data match-data) (replace-match next t t) (cond ((equal this org-state) (message "TODO state was already %s" (org-trim next))) ((pos-visible-in-window-p hl-pos) (message "TODO state changed to %s" (org-trim next)))) (if head nil (setq head (org-get-todo-sequence-head org-state) ass (assoc head org-todo-kwd-alist) interpret (nth 1 ass) done-word (nth 3 ass) final-done-word (nth 4 ass))) (if (memq arg (quote (nextset previousset))) (progn (message "Keyword-Set %d/%d: %s" (- (length org-todo-sets) -1 (length (memq (assoc org-state org-todo-sets) org-todo-sets))) (length org-todo-sets) (mapconcat (quote identity) (assoc org-state org-todo-sets) " ")))) (setq org-last-todo-state-is-todo (not (member org-state org-done-keywords))) (setq now-done-p (and (member org-state org-done-keywords) (not (member this org-done-keywords)))) (and logging (org-local-logging logging)) (if (and (or org-todo-log-states org-log-done) (not (eq org-inhibit-logging t)) (not (memq arg (quote (nextset previousset))))) (progn (setq dolog (or (nth 1 (assoc org-state org-todo-log-states)) (nth 2 (assoc this org-todo-log-states)))) (if (and (eq dolog (quote note)) (eq org-inhibit-logging (quote note))) (progn (setq dolog (quote time)))) (if (or (and (not org-state) (not org-closed-keep-when-no-todo)) (and org-state (member org-state org-not-done-keywords) (not (member this org-not-done-keywords)))) (progn (org-add-planning-info nil nil (quote closed)))) (if (and now-done-p org-log-done) (progn (org-add-planning-info (quote closed) (org-current-effective-time)) (if (and (not dolog) (eq ... org-log-done)) (progn (org-add-log-setup ... org-state this ...))))) (if (and org-state dolog) (progn (org-add-log-setup (quote state) org-state this dolog))))) (org-todo-trigger-tag-changes org-state) (and org-auto-align-tags (not org-setting-tags) (org-set-tags nil t)) (if org-provide-todo-statistics (progn (org-update-parent-todo-statistics))) (run-hooks (quote org-after-todo-state-change-hook)) (if (and arg (not (member org-state org-done-keywords))) (progn (setq head (org-get-todo-sequence-head org-state)))) (put-text-property (point-at-bol) (point-at-eol) (quote org-todo-head) head) (if now-done-p (progn (if (boundp (quote org-agenda-headline-snapshot-before-repeat)) (progn (let ((save-match-data-internal ...)) (unwind-protect (progn ...) (set-match-data save-match-data-internal ...))))) (org-auto-repeat-maybe org-state))) (if (and (outline-on-heading-p) (not (bolp)) (save-excursion (beginning-of-line 1) (looking-at org-todo-line-regexp)) (< (point) (+ 2 (or (match-end 2) (match-end 1))))) (progn (goto-char (or (match-end 2) (match-end 1))) (and (looking-at " ") (just-one-space)))) (if org-trigger-hook (progn (save-excursion (run-hook-with-args (quote org-trigger-hook) change-plist)))) (if commentp (progn (org-toggle-comment)))) (catch (quote exit) (org-back-to-heading t) (if (org-in-commented-heading-p t) (progn (org-toggle-comment) (setq commentp t))) (if (looking-at org-outline-regexp) (progn (goto-char (1- (match-end 0))))) (or (looking-at (concat " +" org-todo-regexp "\\( +\\|[ ]*$\\)")) (looking-at "\\(?: *\\|[ ]*$\\)")) (let* ((match-data (match-data)) (startpos (point-at-bol)) (logging (let ((save-match-data-internal (match-data))) (unwind-protect (progn (org-entry-get nil "LOGGING" t t)) (set-match-data save-match-data-internal (quote evaporate))))) (org-log-done org-log-done) (org-log-repeat org-log-repeat) (org-todo-log-states org-todo-log-states) (org-inhibit-logging (if (equal arg 0) (progn (setq arg nil) (quote note)) org-inhibit-logging)) (this (match-string 1)) (hl-pos (match-beginning 0)) (head (org-get-todo-sequence-head this)) (ass (assoc head org-todo-kwd-alist)) (interpret (nth 1 ass)) (done-word (nth 3 ass)) (final-done-word (nth 4 ass)) (org-last-state (or this "")) (completion-ignore-case t) (member (member this org-todo-keywords-1)) (tail (cdr member)) (org-state (cond ((and org-todo-key-trigger (or ... ...)) (org-fast-todo-selection)) ((and (equal arg ...) (or ... ...)) (completing-read "State: " (mapcar ... org-todo-keywords-1) nil t)) ((eq arg (quote right)) (if this (if tail ... nil) (car org-todo-keywords-1))) ((eq arg (quote left)) (if (equal member org-todo-keywords-1) nil (if this ... ...))) ((and (eq org-use-fast-todo-selection t) (equal arg ...) (setq arg nil))) (arg (cond (... nil) (... nil) (... ...) (... ...) (... ...) (...) (... ...) (...))) ((null member) (or head (car org-todo-keywords-1))) ((equal this final-done-word) nil) ((null tail) nil) ((memq interpret (quote ...)) (if (eq this-command last-command) (car tail) (if ... ... nil))) (t (car tail)))) (org-state (or (run-hook-with-args-until-success (quote org-todo-get-default-hook) org-state org-last-state) org-state)) (next (if org-state (concat " " org-state " ") " ")) (change-plist (list :type (quote todo-state-change) :from this :to org-state :position startpos)) dolog now-done-p) (if org-blocker-hook (progn (setq org-last-todo-state-is-todo (not (member this org-done-keywords))) (if (save-excursion (let (...) (unwind-protect ... ...))) nil (if (with-no-warnings (called-interactively-p ...)) (user-error "TODO state change from %s to %s blocked (by \"%s\")" this org-state org-block-entry-blocking) (message "TODO state change from %s to %s blocked (by \"%s\")" this org-state org-block-entry-blocking) (throw (quote exit) nil))))) (store-match-data match-data) (replace-match next t t) (cond ((equal this org-state) (message "TODO state was already %s" (org-trim next))) ((pos-visible-in-window-p hl-pos) (message "TODO state changed to %s" (org-trim next)))) (if head nil (setq head (org-get-todo-sequence-head org-state) ass (assoc head org-todo-kwd-alist) interpret (nth 1 ass) done-word (nth 3 ass) final-done-word (nth 4 ass))) (if (memq arg (quote (nextset previousset))) (progn (message "Keyword-Set %d/%d: %s" (- (length org-todo-sets) -1 (length (memq ... org-todo-sets))) (length org-todo-sets) (mapconcat (quote identity) (assoc org-state org-todo-sets) " ")))) (setq org-last-todo-state-is-todo (not (member org-state org-done-keywords))) (setq now-done-p (and (member org-state org-done-keywords) (not (member this org-done-keywords)))) (and logging (org-local-logging logging)) (if (and (or org-todo-log-states org-log-done) (not (eq org-inhibit-logging t)) (not (memq arg (quote (nextset previousset))))) (progn (setq dolog (or (nth 1 (assoc org-state org-todo-log-states)) (nth 2 (assoc this org-todo-log-states)))) (if (and (eq dolog (quote note)) (eq org-inhibit-logging (quote note))) (progn (setq dolog (quote time)))) (if (or (and (not org-state) (not org-closed-keep-when-no-todo)) (and org-state (member org-state org-not-done-keywords) (not ...))) (progn (org-add-planning-info nil nil (quote closed)))) (if (and now-done-p org-log-done) (progn (org-add-planning-info (quote closed) (org-current-effective-time)) (if (and ... ...) (progn ...)))) (if (and org-state dolog) (progn (org-add-log-setup (quote state) org-state this dolog))))) (org-todo-trigger-tag-changes org-state) (and org-auto-align-tags (not org-setting-tags) (org-set-tags nil t)) (if org-provide-todo-statistics (progn (org-update-parent-todo-statistics))) (run-hooks (quote org-after-todo-state-change-hook)) (if (and arg (not (member org-state org-done-keywords))) (progn (setq head (org-get-todo-sequence-head org-state)))) (put-text-property (point-at-bol) (point-at-eol) (quote org-todo-head) head) (if now-done-p (progn (if (boundp (quote org-agenda-headline-snapshot-before-repeat)) (progn (let (...) (unwind-protect ... ...)))) (org-auto-repeat-maybe org-state))) (if (and (outline-on-heading-p) (not (bolp)) (save-excursion (beginning-of-line 1) (looking-at org-todo-line-regexp)) (< (point) (+ 2 (or (match-end 2) (match-end 1))))) (progn (goto-char (or (match-end 2) (match-end 1))) (and (looking-at " ") (just-one-space)))) (if org-trigger-hook (progn (save-excursion (run-hook-with-args (quote org-trigger-hook) change-plist)))) (if commentp (progn (org-toggle-comment))))) (save-excursion (catch (quote exit) (org-back-to-heading t) (if (org-in-commented-heading-p t) (progn (org-toggle-comment) (setq commentp t))) (if (looking-at org-outline-regexp) (progn (goto-char (1- (match-end 0))))) (or (looking-at (concat " +" org-todo-regexp "\\( +\\|[ ]*$\\)")) (looking-at "\\(?: *\\|[ ]*$\\)")) (let* ((match-data (match-data)) (startpos (point-at-bol)) (logging (let ((save-match-data-internal ...)) (unwind-protect (progn ...) (set-match-data save-match-data-internal ...)))) (org-log-done org-log-done) (org-log-repeat org-log-repeat) (org-todo-log-states org-todo-log-states) (org-inhibit-logging (if (equal arg 0) (progn (setq arg nil) (quote note)) org-inhibit-logging)) (this (match-string 1)) (hl-pos (match-beginning 0)) (head (org-get-todo-sequence-head this)) (ass (assoc head org-todo-kwd-alist)) (interpret (nth 1 ass)) (done-word (nth 3 ass)) (final-done-word (nth 4 ass)) (org-last-state (or this "")) (completion-ignore-case t) (member (member this org-todo-keywords-1)) (tail (cdr member)) (org-state (cond ((and org-todo-key-trigger ...) (org-fast-todo-selection)) ((and ... ...) (completing-read "State: " ... nil t)) ((eq arg ...) (if this ... ...)) ((eq arg ...) (if ... nil ...)) ((and ... ... ...)) (arg (cond ... ... ... ... ... ... ... ...)) ((null member) (or head ...)) ((equal this final-done-word) nil) ((null tail) nil) ((memq interpret ...) (if ... ... ...)) (t (car tail)))) (org-state (or (run-hook-with-args-until-success (quote org-todo-get-default-hook) org-state org-last-state) org-state)) (next (if org-state (concat " " org-state " ") " ")) (change-plist (list :type (quote todo-state-change) :from this :to org-state :position startpos)) dolog now-done-p) (if org-blocker-hook (progn (setq org-last-todo-state-is-todo (not (member this org-done-keywords))) (if (save-excursion (let ... ...)) nil (if (with-no-warnings ...) (user-error "TODO state change from %s to %s blocked (by \"%s\")" this org-state org-block-entry-blocking) (message "TODO state change from %s to %s blocked (by \"%s\")" this org-state org-block-entry-blocking) (throw ... nil))))) (store-match-data match-data) (replace-match next t t) (cond ((equal this org-state) (message "TODO state was already %s" (org-trim next))) ((pos-visible-in-window-p hl-pos) (message "TODO state changed to %s" (org-trim next)))) (if head nil (setq head (org-get-todo-sequence-head org-state) ass (assoc head org-todo-kwd-alist) interpret (nth 1 ass) done-word (nth 3 ass) final-done-word (nth 4 ass))) (if (memq arg (quote (nextset previousset))) (progn (message "Keyword-Set %d/%d: %s" (- (length org-todo-sets) -1 (length ...)) (length org-todo-sets) (mapconcat (quote identity) (assoc org-state org-todo-sets) " ")))) (setq org-last-todo-state-is-todo (not (member org-state org-done-keywords))) (setq now-done-p (and (member org-state org-done-keywords) (not (member this org-done-keywords)))) (and logging (org-local-logging logging)) (if (and (or org-todo-log-states org-log-done) (not (eq org-inhibit-logging t)) (not (memq arg (quote ...)))) (progn (setq dolog (or (nth 1 ...) (nth 2 ...))) (if (and (eq dolog ...) (eq org-inhibit-logging ...)) (progn (setq dolog ...))) (if (or (and ... ...) (and org-state ... ...)) (progn (org-add-planning-info nil nil ...))) (if (and now-done-p org-log-done) (progn (org-add-planning-info ... ...) (if ... ...))) (if (and org-state dolog) (progn (org-add-log-setup ... org-state this dolog))))) (org-todo-trigger-tag-changes org-state) (and org-auto-align-tags (not org-setting-tags) (org-set-tags nil t)) (if org-provide-todo-statistics (progn (org-update-parent-todo-statistics))) (run-hooks (quote org-after-todo-state-change-hook)) (if (and arg (not (member org-state org-done-keywords))) (progn (setq head (org-get-todo-sequence-head org-state)))) (put-text-property (point-at-bol) (point-at-eol) (quote org-todo-head) head) (if now-done-p (progn (if (boundp (quote org-agenda-headline-snapshot-before-repeat)) (progn (let ... ...))) (org-auto-repeat-maybe org-state))) (if (and (outline-on-heading-p) (not (bolp)) (save-excursion (beginning-of-line 1) (looking-at org-todo-line-regexp)) (< (point) (+ 2 (or ... ...)))) (progn (goto-char (or (match-end 2) (match-end 1))) (and (looking-at " ") (just-one-space)))) (if org-trigger-hook (progn (save-excursion (run-hook-with-args (quote org-trigger-hook) change-plist)))) (if commentp (progn (org-toggle-comment)))))) (let ((org-blocker-hook org-blocker-hook) commentp case-fold-search) (if (equal arg (quote (64))) (progn (setq arg nil org-blocker-hook nil))) (if (and org-blocker-hook (or org-inhibit-blocking (org-entry-get nil "NOBLOCKING"))) (progn (setq org-blocker-hook nil))) (save-excursion (catch (quote exit) (org-back-to-heading t) (if (org-in-commented-heading-p t) (progn (org-toggle-comment) (setq commentp t))) (if (looking-at org-outline-regexp) (progn (goto-char (1- (match-end 0))))) (or (looking-at (concat " +" org-todo-regexp "\\( +\\|[ ]*$\\)")) (looking-at "\\(?: *\\|[ ]*$\\)")) (let* ((match-data (match-data)) (startpos (point-at-bol)) (logging (let (...) (unwind-protect ... ...))) (org-log-done org-log-done) (org-log-repeat org-log-repeat) (org-todo-log-states org-todo-log-states) (org-inhibit-logging (if (equal arg 0) (progn ... ...) org-inhibit-logging)) (this (match-string 1)) (hl-pos (match-beginning 0)) (head (org-get-todo-sequence-head this)) (ass (assoc head org-todo-kwd-alist)) (interpret (nth 1 ass)) (done-word (nth 3 ass)) (final-done-word (nth 4 ass)) (org-last-state (or this "")) (completion-ignore-case t) (member (member this org-todo-keywords-1)) (tail (cdr member)) (org-state (cond (... ...) (... ...) (... ...) (... ...) (...) (arg ...) (... ...) (... nil) (... nil) (... ...) (t ...))) (org-state (or (run-hook-with-args-until-success ... org-state org-last-state) org-state)) (next (if org-state (concat " " org-state " ") " ")) (change-plist (list :type (quote todo-state-change) :from this :to org-state :position startpos)) dolog now-done-p) (if org-blocker-hook (progn (setq org-last-todo-state-is-todo (not ...)) (if (save-excursion ...) nil (if ... ... ... ...)))) (store-match-data match-data) (replace-match next t t) (cond ((equal this org-state) (message "TODO state was already %s" (org-trim next))) ((pos-visible-in-window-p hl-pos) (message "TODO state changed to %s" (org-trim next)))) (if head nil (setq head (org-get-todo-sequence-head org-state) ass (assoc head org-todo-kwd-alist) interpret (nth 1 ass) done-word (nth 3 ass) final-done-word (nth 4 ass))) (if (memq arg (quote (nextset previousset))) (progn (message "Keyword-Set %d/%d: %s" (- ... -1 ...) (length org-todo-sets) (mapconcat ... ... " ")))) (setq org-last-todo-state-is-todo (not (member org-state org-done-keywords))) (setq now-done-p (and (member org-state org-done-keywords) (not (member this org-done-keywords)))) (and logging (org-local-logging logging)) (if (and (or org-todo-log-states org-log-done) (not (eq org-inhibit-logging t)) (not (memq arg ...))) (progn (setq dolog (or ... ...)) (if (and ... ...) (progn ...)) (if (or ... ...) (progn ...)) (if (and now-done-p org-log-done) (progn ... ...)) (if (and org-state dolog) (progn ...)))) (org-todo-trigger-tag-changes org-state) (and org-auto-align-tags (not org-setting-tags) (org-set-tags nil t)) (if org-provide-todo-statistics (progn (org-update-parent-todo-statistics))) (run-hooks (quote org-after-todo-state-change-hook)) (if (and arg (not (member org-state org-done-keywords))) (progn (setq head (org-get-todo-sequence-head org-state)))) (put-text-property (point-at-bol) (point-at-eol) (quote org-todo-head) head) (if now-done-p (progn (if (boundp ...) (progn ...)) (org-auto-repeat-maybe org-state))) (if (and (outline-on-heading-p) (not (bolp)) (save-excursion (beginning-of-line 1) (looking-at org-todo-line-regexp)) (< (point) (+ 2 ...))) (progn (goto-char (or ... ...)) (and (looking-at " ") (just-one-space)))) (if org-trigger-hook (progn (save-excursion (run-hook-with-args ... change-plist)))) (if commentp (progn (org-toggle-comment))))))) (if (and (org-region-active-p) org-loop-over-headlines-in-active-region) (let ((cl (if (eq org-loop-over-headlines-in-active-region (quote start-level)) (quote region-start-level) (quote region))) org-loop-over-headlines-in-active-region) (org-map-entries (list (quote org-todo) arg) org-loop-over-headlines-in-active-region cl (if (outline-invisible-p) (progn (org-end-of-subtree nil t))))) (if (equal arg (quote (16))) (progn (setq arg (quote nextset)))) (if (equal arg -1) (progn (org-cancel-repeater) (setq arg nil))) (let ((org-blocker-hook org-blocker-hook) commentp case-fold-search) (if (equal arg (quote (64))) (progn (setq arg nil org-blocker-hook nil))) (if (and org-blocker-hook (or org-inhibit-blocking (org-entry-get nil "NOBLOCKING"))) (progn (setq org-blocker-hook nil))) (save-excursion (catch (quote exit) (org-back-to-heading t) (if (org-in-commented-heading-p t) (progn (org-toggle-comment) (setq commentp t))) (if (looking-at org-outline-regexp) (progn (goto-char (1- ...)))) (or (looking-at (concat " +" org-todo-regexp "\\( +\\|[ ]*$\\)")) (looking-at "\\(?: *\\|[ ]*$\\)")) (let* ((match-data (match-data)) (startpos (point-at-bol)) (logging (let ... ...)) (org-log-done org-log-done) (org-log-repeat org-log-repeat) (org-todo-log-states org-todo-log-states) (org-inhibit-logging (if ... ... org-inhibit-logging)) (this (match-string 1)) (hl-pos (match-beginning 0)) (head (org-get-todo-sequence-head this)) (ass (assoc head org-todo-kwd-alist)) (interpret (nth 1 ass)) (done-word (nth 3 ass)) (final-done-word (nth 4 ass)) (org-last-state (or this "")) (completion-ignore-case t) (member (member this org-todo-keywords-1)) (tail (cdr member)) (org-state (cond ... ... ... ... ... ... ... ... ... ... ...)) (org-state (or ... org-state)) (next (if org-state ... " ")) (change-plist (list :type ... :from this :to org-state :position startpos)) dolog now-done-p) (if org-blocker-hook (progn (setq org-last-todo-state-is-todo ...) (if ... nil ...))) (store-match-data match-data) (replace-match next t t) (cond ((equal this org-state) (message "TODO state was already %s" ...)) ((pos-visible-in-window-p hl-pos) (message "TODO state changed to %s" ...))) (if head nil (setq head (org-get-todo-sequence-head org-state) ass (assoc head org-todo-kwd-alist) interpret (nth 1 ass) done-word (nth 3 ass) final-done-word (nth 4 ass))) (if (memq arg (quote ...)) (progn (message "Keyword-Set %d/%d: %s" ... ... ...))) (setq org-last-todo-state-is-todo (not (member org-state org-done-keywords))) (setq now-done-p (and (member org-state org-done-keywords) (not ...))) (and logging (org-local-logging logging)) (if (and (or org-todo-log-states org-log-done) (not ...) (not ...)) (progn (setq dolog ...) (if ... ...) (if ... ...) (if ... ...) (if ... ...))) (org-todo-trigger-tag-changes org-state) (and org-auto-align-tags (not org-setting-tags) (org-set-tags nil t)) (if org-provide-todo-statistics (progn (org-update-parent-todo-statistics))) (run-hooks (quote org-after-todo-state-change-hook)) (if (and arg (not ...)) (progn (setq head ...))) (put-text-property (point-at-bol) (point-at-eol) (quote org-todo-head) head) (if now-done-p (progn (if ... ...) (org-auto-repeat-maybe org-state))) (if (and (outline-on-heading-p) (not ...) (save-excursion ... ...) (< ... ...)) (progn (goto-char ...) (and ... ...))) (if org-trigger-hook (progn (save-excursion ...))) (if commentp (progn (org-toggle-comment)))))))) org-todo(nil) call-interactively(org-todo) org-self-insert-command(1) call-interactively(org-self-insert-command nil nil) command-execute(org-self-insert-command)