From mboxrd@z Thu Jan 1 00:00:00 1970 From: Alan Schmitt Subject: cache problem, with ECM Date: Wed, 09 Jul 2014 10:11:15 +0200 Message-ID: Mime-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:56779) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X4myR-0007IK-3j for emacs-orgmode@gnu.org; Wed, 09 Jul 2014 04:11:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1X4myK-00032P-9u for emacs-orgmode@gnu.org; Wed, 09 Jul 2014 04:11:31 -0400 Received: from mail2-relais-roc.national.inria.fr ([192.134.164.83]:6696) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X4myJ-00032A-30 for emacs-orgmode@gnu.org; Wed, 09 Jul 2014 04:11:24 -0400 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 --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Hello, I noticed this morning, after updating org-mode to the latest version, that I would get an error with a trace related to a cache even if a just started emacs. It took me a while to get down to an ECM, but here it is. The init file used: =2D-8<---------------cut here---------------start------------->8--- ;; use with "open /Applications/Emacs.app --args -Q -l ~/tmp/init-org.el" (add-to-list 'load-path "/Users/schmitta/projets/org-mode/lisp") (require 'org) (toggle-debug-on-error) (setq org-log-into-drawer t) (setq org-todo-keywords '((sequence "TODO(t)" "NEXT(n)" "|" "DONE(d!/!)") (sequence "WAITING(w@/!)" "HOLD(h@/!)" "|" "CANCELLED(c@/!)"))) =2D-8<---------------cut here---------------end--------------->8--- The crucial parts seem to be the 'org-log-into-drawer' and the fact that switching out of WAITING triggers a note. Here is an org file showing the problem =2D-8<---------------cut here---------------start------------->8--- #+STARTUP: hidestars * Perso :PROPERTIES: :CATEGORY: Perso :END: ** DONE bar :LOGBOOK: - State "DONE" from "TODO" [2014-07-06 Sun 19:22] :END: [2014-07-06 Sun 10:01] ** WAITING foo :@fun: SCHEDULED: <2014-07-09 Wed> :PROPERTIES: :ID: 79A4028E-DBDA-49D4-AD39-BD2786EF9FBD :END: * Hacking :PROPERTIES: :CATEGORY: Hacking :END: =2D-8<---------------cut here---------------end--------------->8--- I tried removing many things (like headling before or after the issue, the hidestars, or the tag), but removing each one makes the problem go away. The problem occurs when I do "C-c C-t d" on the WAITING headline, which results in this big backtrace: Debugger entered--Lisp error: (wrong-type-argument number-or-marker-p nil) +(nil 6 7) (let ((limit (+ (aref request 1) (aref request 3) extra))) (if (and thres= hold (< threshold limit)) (progn (throw (quote interrupt) nil))) (let ((par= ent (org-element--parse-to limit t time-limit))) (aset request 5 parent) (a= set request 6 2) (throw (quote end-phase) nil))) (catch (quote end-phase) (if (equal (aref request 0) next) (progn (throw = (quote quit) t))) (let ((limit (+ (aref request 1) (aref request 3) extra))= ) (if (and threshold (< threshold limit)) (progn (throw (quote interrupt) n= il))) (let ((parent (org-element--parse-to limit t time-limit))) (aset requ= est 5 parent) (aset request 6 2) (throw (quote end-phase) nil)))) (progn (catch (quote end-phase) (if (equal (aref request 0) next) (progn = (throw (quote quit) t))) (let ((limit (+ (aref request 1) (aref request 3) = extra))) (if (and threshold (< threshold limit)) (progn (throw (quote inter= rupt) nil))) (let ((parent (org-element--parse-to limit t time-limit))) (as= et request 5 parent) (aset request 6 2) (throw (quote end-phase) nil))))) (if (=3D (aref request 6) 1) (progn (catch (quote end-phase) (if (equal (= aref request 0) next) (progn (throw (quote quit) t))) (let ((limit (+ (aref= request 1) (aref request 3) extra))) (if (and threshold (< threshold limit= )) (progn (throw (quote interrupt) nil))) (let ((parent (org-element--parse= -to limit t time-limit))) (aset request 5 parent) (aset request 6 2) (throw= (quote end-phase) nil)))))) (catch (quote quit) (if (=3D (aref request 6) 0) (progn (catch (quote end= -phase) (let ((beg (aref request 0)) (end (aref request 2)) (outreach (aref= request 4))) (while t (if (org-element--cache-interrupt-p time-limit) (pro= gn ...)) (let (... data data-key) (while node ...) (if data ... ...))))))) = (if (=3D (aref request 6) 1) (progn (catch (quote end-phase) (if (equal (ar= ef request 0) next) (progn (throw (quote quit) t))) (let ((limit (+ ... ...= extra))) (if (and threshold (< threshold limit)) (progn (throw ... nil))) = (let ((parent ...)) (aset request 5 parent) (aset request 6 2) (throw (quot= e end-phase) nil)))))) (let ((start (aref request 0)) (offset (aref request= 3)) (parent (aref request 5)) (node (org-element--cache-root)) (stack (lis= t nil)) (leftp t) exit-flag) (if (and (not parent) (zerop offset)) (progn (= throw (quote quit) t))) (while node (let* ((data (progn (aref node 2))) (ke= y (org-element--cache-key data))) (if (and leftp (progn (aref node 0)) (not= (org-element--cache-key-less-p key start))) (progn (setq stack (cons node = stack)) (setq node (progn ...))) (if (org-element--cache-key-less-p key sta= rt) nil (if (equal key next) (progn ...)) (if (or exit-flag ...) (progn ...= ... ...)) (if (zerop offset) nil (org-element--cache-shift-positions data = offset) (progn ...)) (let (...) (while ... ...) (cond ... ...) (if ... ...)= )) (setq node (if (setq leftp ...) (progn ...) (car ...)))))) t)) org-element--cache-process-request([339 nil 253 6 nil nil 1] nil 334 nil = 7) (while org-element--cache-sync-requests (setq request (car org-element--c= ache-sync-requests) next (nth 1 org-element--cache-sync-requests)) (org-ele= ment--cache-process-request request (and next (aref next 0)) threshold (and= (not threshold) (time-add (current-time) org-element-cache-sync-duration))= (or extra 0)) (if next (progn (let* ((v next)) (aset v 3 (+ (aref v 3) (ar= ef request 3)))) (aset next 2 (aref request 2)) (aset next 6 (aref request = 6)))) (setq org-element--cache-sync-requests (cdr org-element--cache-sync-r= equests))) (catch (quote interrupt) (while org-element--cache-sync-requests (setq re= quest (car org-element--cache-sync-requests) next (nth 1 org-element--cache= -sync-requests)) (org-element--cache-process-request request (and next (are= f next 0)) threshold (and (not threshold) (time-add (current-time) org-elem= ent-cache-sync-duration)) (or extra 0)) (if next (progn (let* ((v next)) (a= set v 3 (+ (aref v 3) (aref request 3)))) (aset next 2 (aref request 2)) (a= set next 6 (aref request 6)))) (setq org-element--cache-sync-requests (cdr = org-element--cache-sync-requests)))) (let ((inhibit-quit t) request next) (if org-element--cache-sync-timer (p= rogn (cancel-timer org-element--cache-sync-timer))) (catch (quote interrupt= ) (while org-element--cache-sync-requests (setq request (car org-element--c= ache-sync-requests) next (nth 1 org-element--cache-sync-requests)) (org-ele= ment--cache-process-request request (and next (aref next 0)) threshold (and= (not threshold) (time-add (current-time) org-element-cache-sync-duration))= (or extra 0)) (if next (progn (let* ((v next)) (aset v 3 (+ ... ...))) (as= et next 2 (aref request 2)) (aset next 6 (aref request 6)))) (setq org-elem= ent--cache-sync-requests (cdr org-element--cache-sync-requests)))) (if org-= element--cache-sync-requests (org-element--cache-set-timer buffer) (clrhash= org-element--cache-sync-keys))) (save-current-buffer (set-buffer buffer) (let ((inhibit-quit t) request n= ext) (if org-element--cache-sync-timer (progn (cancel-timer org-element--ca= che-sync-timer))) (catch (quote interrupt) (while org-element--cache-sync-r= equests (setq request (car org-element--cache-sync-requests) next (nth 1 or= g-element--cache-sync-requests)) (org-element--cache-process-request reques= t (and next (aref next 0)) threshold (and (not threshold) (time-add (curren= t-time) org-element-cache-sync-duration)) (or extra 0)) (if next (progn (le= t* (...) (aset v 3 ...)) (aset next 2 (aref request 2)) (aset next 6 (aref = request 6)))) (setq org-element--cache-sync-requests (cdr org-element--cach= e-sync-requests)))) (if org-element--cache-sync-requests (org-element--cach= e-set-timer buffer) (clrhash org-element--cache-sync-keys)))) (progn (save-current-buffer (set-buffer buffer) (let ((inhibit-quit t) re= quest next) (if org-element--cache-sync-timer (progn (cancel-timer org-elem= ent--cache-sync-timer))) (catch (quote interrupt) (while org-element--cache= -sync-requests (setq request (car org-element--cache-sync-requests) next (n= th 1 org-element--cache-sync-requests)) (org-element--cache-process-request= request (and next (aref next 0)) threshold (and (not threshold) (time-add = ... org-element-cache-sync-duration)) (or extra 0)) (if next (progn (let* .= .. ...) (aset next 2 ...) (aset next 6 ...))) (setq org-element--cache-sync= -requests (cdr org-element--cache-sync-requests)))) (if org-element--cache-= sync-requests (org-element--cache-set-timer buffer) (clrhash org-element--c= ache-sync-keys))))) (if (buffer-live-p buffer) (progn (save-current-buffer (set-buffer buffer= ) (let ((inhibit-quit t) request next) (if org-element--cache-sync-timer (p= rogn (cancel-timer org-element--cache-sync-timer))) (catch (quote interrupt= ) (while org-element--cache-sync-requests (setq request (car org-element--c= ache-sync-requests) next (nth 1 org-element--cache-sync-requests)) (org-ele= ment--cache-process-request request (and next ...) threshold (and ... ...) = (or extra 0)) (if next (progn ... ... ...)) (setq org-element--cache-sync-r= equests (cdr org-element--cache-sync-requests)))) (if org-element--cache-sy= nc-requests (org-element--cache-set-timer buffer) (clrhash org-element--cac= he-sync-keys)))))) org-element--cache-sync(# 334 7) (progn (org-element--cache-sync (current-buffer) end offset)) (if next (progn (org-element--cache-sync (current-buffer) end offset))) (if (and next (zerop (aref next 6)) (> (setq delete-to (+ (aref next 2) (= aref next 3))) end) (<=3D (setq delete-from (aref next 1)) end)) (progn (le= t* ((v next)) (aset v 3 (+ (aref v 3) offset))) (if (> beg delete-from) (le= t ((up (aref next 5))) (while up (org-element--cache-shift-positions up off= set (quote (:contents-end :end))) (setq up (org-element-property :parent up= )))) (let ((first (org-element--cache-for-removal beg delete-to offset))) (= if first (progn (aset next 0 (org-element--cache-key first)) (aset next 1 (= org-element-property :begin first)) (aset next 5 (org-element-property :par= ent first))))))) (if next (progn (org-element--cache-sync (current-buffer) = end offset))) (let ((first (org-element--cache-for-removal beg end offset))= ) (if first (setq org-element--cache-sync-requests (cons (let ((beg ...) (k= ey ...)) (cond (... ...) (...) (t ...))) org-element--cache-sync-requests))= (if org-element--cache-sync-requests (progn (let* ((v ...)) (aset v 3 (+ .= .. offset)))))))) (let ((next (car org-element--cache-sync-requests)) delete-to delete-from= ) (if (and next (zerop (aref next 6)) (> (setq delete-to (+ (aref next 2) (= aref next 3))) end) (<=3D (setq delete-from (aref next 1)) end)) (progn (le= t* ((v next)) (aset v 3 (+ (aref v 3) offset))) (if (> beg delete-from) (le= t ((up (aref next 5))) (while up (org-element--cache-shift-positions up off= set (quote ...)) (setq up (org-element-property :parent up)))) (let ((first= (org-element--cache-for-removal beg delete-to offset))) (if first (progn (= aset next 0 ...) (aset next 1 ...) (aset next 5 ...)))))) (if next (progn (= org-element--cache-sync (current-buffer) end offset))) (let ((first (org-el= ement--cache-for-removal beg end offset))) (if first (setq org-element--cac= he-sync-requests (cons (let (... ...) (cond ... ... ...)) org-element--cach= e-sync-requests)) (if org-element--cache-sync-requests (progn (let* (...) (= aset v 3 ...)))))))) org-element--cache-submit-request(223 334 7) (let ((offset (- end beg pre))) (org-element--cache-submit-request top (-= bottom offset) offset)) (let ((top (point)) (bottom (save-excursion (goto-char end) (line-end-pos= ition)))) (if (cond ((memql org-element--cache-change-warning (quote (t))) = t) ((eql org-element--cache-change-warning (quote headline)) (not (and (let= * (... ... ... ...) (org-at-heading-p)) (=3D (line-end-position) bottom))))= (t (let ((case-fold-search t)) (re-search-forward org-element--cache-sensi= tive-re bottom t)))) (progn (let* ((org-called-with-limited-levels t) (org-= outline-regexp (org-get-limited-outline-regexp)) (outline-regexp org-outlin= e-regexp) (org-outline-regexp-bol (concat "^" org-outline-regexp))) (setq t= op (progn (goto-char top) (if (outline-previous-heading) (progn ...)) (poin= t))) (setq bottom (progn (goto-char bottom) (if (outline-next-heading) (1- = ...) (point))))))) (let ((offset (- end beg pre))) (org-element--cache-subm= it-request top (- bottom offset) offset))) (progn (let ((top (point)) (bottom (save-excursion (goto-char end) (line-= end-position)))) (if (cond ((memql org-element--cache-change-warning (quote= (t))) t) ((eql org-element--cache-change-warning (quote headline)) (not (a= nd (let* ... ...) (=3D ... bottom)))) (t (let ((case-fold-search t)) (re-se= arch-forward org-element--cache-sensitive-re bottom t)))) (progn (let* ((or= g-called-with-limited-levels t) (org-outline-regexp (org-get-limited-outlin= e-regexp)) (outline-regexp org-outline-regexp) (org-outline-regexp-bol (con= cat "^" org-outline-regexp))) (setq top (progn (goto-char top) (if ... ...)= (point))) (setq bottom (progn (goto-char bottom) (if ... ... ...)))))) (le= t ((offset (- end beg pre))) (org-element--cache-submit-request top (- bott= om offset) offset)))) (unwind-protect (progn (let ((top (point)) (bottom (save-excursion (goto-= char end) (line-end-position)))) (if (cond ((memql org-element--cache-chang= e-warning (quote ...)) t) ((eql org-element--cache-change-warning (quote he= adline)) (not (and ... ...))) (t (let (...) (re-search-forward org-element-= -cache-sensitive-re bottom t)))) (progn (let* ((org-called-with-limited-lev= els t) (org-outline-regexp ...) (outline-regexp org-outline-regexp) (org-ou= tline-regexp-bol ...)) (setq top (progn ... ... ...)) (setq bottom (progn .= .. ...))))) (let ((offset (- end beg pre))) (org-element--cache-submit-requ= est top (- bottom offset) offset)))) (set-match-data save-match-data-intern= al (quote evaporate))) (let ((save-match-data-internal (match-data))) (unwind-protect (progn (le= t ((top (point)) (bottom (save-excursion (goto-char end) (line-end-position= )))) (if (cond ((memql org-element--cache-change-warning ...) t) ((eql org-= element--cache-change-warning ...) (not ...)) (t (let ... ...))) (progn (le= t* (... ... ... ...) (setq top ...) (setq bottom ...)))) (let ((offset (- e= nd beg pre))) (org-element--cache-submit-request top (- bottom offset) offs= et)))) (set-match-data save-match-data-internal (quote evaporate)))) (save-restriction (widen) (goto-char beg) (beginning-of-line) (let ((save= -match-data-internal (match-data))) (unwind-protect (progn (let ((top (poin= t)) (bottom (save-excursion ... ...))) (if (cond (... t) (... ...) (t ...))= (progn (let* ... ... ...))) (let ((offset ...)) (org-element--cache-submit= -request top (- bottom offset) offset)))) (set-match-data save-match-data-i= nternal (quote evaporate))))) (save-excursion (save-restriction (widen) (goto-char beg) (beginning-of-l= ine) (let ((save-match-data-internal (match-data))) (unwind-protect (progn = (let ((top ...) (bottom ...)) (if (cond ... ... ...) (progn ...)) (let (...= ) (org-element--cache-submit-request top ... offset)))) (set-match-data sav= e-match-data-internal (quote evaporate)))))) (progn (save-excursion (save-restriction (widen) (goto-char beg) (beginni= ng-of-line) (let ((save-match-data-internal (match-data))) (unwind-protect = (progn (let (... ...) (if ... ...) (let ... ...))) (set-match-data save-mat= ch-data-internal (quote evaporate)))))) (org-element--cache-set-timer (curr= ent-buffer))) (if (org-element--cache-active-p) (progn (save-excursion (save-restrictio= n (widen) (goto-char beg) (beginning-of-line) (let ((save-match-data-intern= al (match-data))) (unwind-protect (progn (let ... ... ...)) (set-match-data= save-match-data-internal (quote evaporate)))))) (org-element--cache-set-ti= mer (current-buffer)))) org-element--cache-after-change(261 268 0) insert("\n:" "LOGBOOK" ":\n:END:") (if (re-search-forward (concat "^[ ]*:" drawer ":[ ]*$") nil t) (progn = (goto-char (match-end 0)) (or org-log-states-order-reversed (and (re-search= -forward org-property-end-re nil t) (goto-char (1- (match-beginning 0))))))= (insert "\n:" drawer ":\n:END:") (beginning-of-line 0) (org-indent-line) (= beginning-of-line 2) (org-indent-line) (end-of-line 0)) (cond (drawer (if (re-search-forward (concat "^[ ]*:" drawer ":[ ]*$") = nil t) (progn (goto-char (match-end 0)) (or org-log-states-order-reversed (= and (re-search-forward org-property-end-re nil t) (goto-char (1- ...))))) (= insert "\n:" drawer ":\n:END:") (beginning-of-line 0) (org-indent-line) (be= ginning-of-line 2) (org-indent-line) (end-of-line 0))) ((and org-log-state-= notes-insert-after-drawers (save-excursion (forward-line) (looking-at org-d= rawer-regexp))) (forward-line) (while (looking-at org-drawer-regexp) (goto-= char (match-end 0)) (re-search-forward org-property-end-re (point-max) t) (= forward-line)) (forward-line -1))) (progn (org-back-to-heading t) (narrow-to-region (point) (save-excursion = (outline-next-heading) (point))) (looking-at (concat org-outline-regexp "\\= ( *\\)[^\n]*" "\\(\n[^\n]*?" org-keyword-time-not-clock-regexp "[^\n]*\\)?"= )) (goto-char (match-end 0)) (cond (drawer (if (re-search-forward (concat "= ^[ ]*:" drawer ":[ ]*$") nil t) (progn (goto-char (match-end 0)) (or org-= log-states-order-reversed (and (re-search-forward org-property-end-re nil t= ) (goto-char ...)))) (insert "\n:" drawer ":\n:END:") (beginning-of-line 0)= (org-indent-line) (beginning-of-line 2) (org-indent-line) (end-of-line 0))= ) ((and org-log-state-notes-insert-after-drawers (save-excursion (forward-l= ine) (looking-at org-drawer-regexp))) (forward-line) (while (looking-at org= -drawer-regexp) (goto-char (match-end 0)) (re-search-forward org-property-e= nd-re (point-max) t) (forward-line)) (forward-line -1))) (if org-log-states= -order-reversed nil (and (=3D (char-after) 10) (forward-char 1)) (org-skip-= over-state-notes) (skip-chars-backward " \n"))) (if findpos (progn (org-back-to-heading t) (narrow-to-region (point) (sav= e-excursion (outline-next-heading) (point))) (looking-at (concat org-outlin= e-regexp "\\( *\\)[^\n]*" "\\(\n[^\n]*?" org-keyword-time-not-clock-regexp = "[^\n]*\\)?")) (goto-char (match-end 0)) (cond (drawer (if (re-search-forwa= rd (concat "^[ ]*:" drawer ":[ ]*$") nil t) (progn (goto-char (match-end = 0)) (or org-log-states-order-reversed (and ... ...))) (insert "\n:" drawer = ":\n:END:") (beginning-of-line 0) (org-indent-line) (beginning-of-line 2) (= org-indent-line) (end-of-line 0))) ((and org-log-state-notes-insert-after-d= rawers (save-excursion (forward-line) (looking-at org-drawer-regexp))) (for= ward-line) (while (looking-at org-drawer-regexp) (goto-char (match-end 0)) = (re-search-forward org-property-end-re (point-max) t) (forward-line)) (forw= ard-line -1))) (if org-log-states-order-reversed nil (and (=3D (char-after)= 10) (forward-char 1)) (org-skip-over-state-notes) (skip-chars-backward " = \n")))) (save-excursion (if findpos (progn (org-back-to-heading t) (narrow-to-reg= ion (point) (save-excursion (outline-next-heading) (point))) (looking-at (c= oncat org-outline-regexp "\\( *\\)[^\n]*" "\\(\n[^\n]*?" org-keyword-time-n= ot-clock-regexp "[^\n]*\\)?")) (goto-char (match-end 0)) (cond (drawer (if = (re-search-forward (concat "^[ ]*:" drawer ":[ ]*$") nil t) (progn (goto-= char ...) (or org-log-states-order-reversed ...)) (insert "\n:" drawer ":\n= :END:") (beginning-of-line 0) (org-indent-line) (beginning-of-line 2) (org-= indent-line) (end-of-line 0))) ((and org-log-state-notes-insert-after-drawe= rs (save-excursion (forward-line) (looking-at org-drawer-regexp))) (forward= -line) (while (looking-at org-drawer-regexp) (goto-char (match-end 0)) (re-= search-forward org-property-end-re (point-max) t) (forward-line)) (forward-= line -1))) (if org-log-states-order-reversed nil (and (=3D (char-after) 10)= (forward-char 1)) (org-skip-over-state-notes) (skip-chars-backward " \n")= ))) (move-marker org-log-note-marker (point)) (setq org-log-note-purpose pu= rpose org-log-note-state state org-log-note-previous-state prev-state org-l= og-note-how how org-log-note-extra extra org-log-note-effective-time (org-c= urrent-effective-time)) (add-hook (quote post-command-hook) (quote org-add-= log-note) (quote append))) (save-restriction (save-excursion (if findpos (progn (org-back-to-heading= t) (narrow-to-region (point) (save-excursion (outline-next-heading) (point= ))) (looking-at (concat org-outline-regexp "\\( *\\)[^\n]*" "\\(\n[^\n]*?" = org-keyword-time-not-clock-regexp "[^\n]*\\)?")) (goto-char (match-end 0)) = (cond (drawer (if (re-search-forward ... nil t) (progn ... ...) (insert "\n= :" drawer ":\n:END:") (beginning-of-line 0) (org-indent-line) (beginning-of= -line 2) (org-indent-line) (end-of-line 0))) ((and org-log-state-notes-inse= rt-after-drawers (save-excursion ... ...)) (forward-line) (while (looking-a= t org-drawer-regexp) (goto-char ...) (re-search-forward org-property-end-re= ... t) (forward-line)) (forward-line -1))) (if org-log-states-order-revers= ed nil (and (=3D (char-after) 10) (forward-char 1)) (org-skip-over-state-no= tes) (skip-chars-backward " \n")))) (move-marker org-log-note-marker (poin= t)) (setq org-log-note-purpose purpose org-log-note-state state org-log-not= e-previous-state prev-state org-log-note-how how org-log-note-extra extra o= rg-log-note-effective-time (org-current-effective-time)) (add-hook (quote p= ost-command-hook) (quote org-add-log-note) (quote append)))) (let* ((org-log-into-drawer (org-log-into-drawer)) (drawer (cond ((string= p org-log-into-drawer) org-log-into-drawer) (org-log-into-drawer "LOGBOOK")= ))) (save-restriction (save-excursion (if findpos (progn (org-back-to-headi= ng t) (narrow-to-region (point) (save-excursion (outline-next-heading) (poi= nt))) (looking-at (concat org-outline-regexp "\\( *\\)[^\n]*" "\\(\n[^\n]*?= " org-keyword-time-not-clock-regexp "[^\n]*\\)?")) (goto-char (match-end 0)= ) (cond (drawer (if ... ... ... ... ... ... ... ...)) ((and org-log-state-n= otes-insert-after-drawers ...) (forward-line) (while ... ... ... ...) (forw= ard-line -1))) (if org-log-states-order-reversed nil (and (=3D ... 10) (for= ward-char 1)) (org-skip-over-state-notes) (skip-chars-backward " \n")))) (= move-marker org-log-note-marker (point)) (setq org-log-note-purpose purpose= org-log-note-state state org-log-note-previous-state prev-state org-log-no= te-how how org-log-note-extra extra org-log-note-effective-time (org-curren= t-effective-time)) (add-hook (quote post-command-hook) (quote org-add-log-n= ote) (quote append))))) org-add-log-setup(state #("DONE" 0 4 (face org-done)) #("WAITING" 0 7 (fo= ntified t face org-todo)) findpos time) (progn (org-add-log-setup (quote state) org-state this (quote findpos) do= log)) (if (and org-state dolog) (progn (org-add-log-setup (quote state) org-sta= te this (quote findpos) dolog))) (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))) (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-don= e-p org-log-done) (progn (org-add-planning-info (quote closed) (org-current= -effective-time)) (if (and (not dolog) (eq (quote note) org-log-done)) (org= -add-log-setup (quote done) org-state this (quote findpos) (quote note)))))= (if (and org-state dolog) (progn (org-add-log-setup (quote state) org-stat= e this (quote findpos) dolog)))) (if (and (or org-todo-log-states org-log-done) (not (eq org-inhibit-loggi= ng 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-tod= o-log-states)))) (if (and (eq dolog (quote note)) (eq org-inhibit-logging (= quote note))) (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-don= e-keywords) (not (member this org-not-done-keywords)))) (progn (org-add-pla= nning-info nil nil (quote closed)))) (if (and now-done-p org-log-done) (pro= gn (org-add-planning-info (quote closed) (org-current-effective-time)) (if = (and (not dolog) (eq (quote note) org-log-done)) (org-add-log-setup (quote = done) org-state this (quote findpos) (quote note))))) (if (and org-state do= log) (progn (org-add-log-setup (quote state) org-state this (quote findpos)= dolog))))) (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 ev= aporate))))) (org-log-done org-log-done) (org-log-repeat org-log-repeat) (o= rg-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 t= his)) (ass (assoc head org-todo-kwd-alist)) (interpret (nth 1 ass)) (done-w= ord (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)) (ta= il (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 or= g-todo-key-trigger))) (org-icompleting-read "State: " (mapcar (quote 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 m= ember 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) (equa= l arg (quote ...)) (setq arg nil))) (arg (cond ((equal arg "") nil) ((eq ar= g ...) 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 th= is-command last-command) (car tail) (if (> ... 0) (or done-word ...) nil)))= (t (car tail)))) (org-state (or (run-hook-with-args-until-success (quote o= rg-todo-get-default-hook) org-state org-last-state) org-state)) (next (if o= rg-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-dat= a-internal ...)) (unwind-protect (progn ...) (set-match-data save-match-dat= a-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-se= quence-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 (qu= ote (nextset previousset))) (progn (message "Keyword-Set %d/%d: %s" (- (len= gth org-todo-sets) -1 (length (memq (assoc org-state org-todo-sets) org-tod= o-sets))) (length org-todo-sets) (mapconcat (quote identity) (assoc org-sta= te org-todo-sets) " ")))) (setq org-last-todo-state-is-todo (not (member or= g-state org-done-keywords))) (setq now-done-p (and (member org-state org-do= ne-keywords) (not (member this org-done-keywords)))) (and logging (org-loca= l-logging logging)) (if (and (or org-todo-log-states org-log-done) (not (eq= org-inhibit-logging t)) (not (memq arg (quote (nextset previousset))))) (p= rogn (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))) (setq dolog (quote time))) (if (or (and (no= t 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-eff= ective-time)) (if (and (not dolog) (eq ... org-log-done)) (org-add-log-setu= p (quote done) org-state this (quote findpos) (quote note))))) (if (and org= -state dolog) (progn (org-add-log-setup (quote state) org-state this (quote= findpos) 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-to= do-statistics (progn (org-update-parent-todo-statistics))) (run-hooks (quot= e org-after-todo-state-change-hook)) (if (and arg (not (member org-state or= g-done-keywords))) (setq head (org-get-todo-sequence-head org-state))) (put= -text-property (point-at-bol) (point-at-eol) (quote org-todo-head) head) (i= f now-done-p (progn (if (boundp (quote org-agenda-headline-snapshot-before-= repeat)) (progn (let ((save-match-data-internal ...)) (unwind-protect (prog= n ...) (set-match-data save-match-data-internal ...))))) (org-auto-repeat-m= aybe org-state))) (if (and (outline-on-heading-p) (not (bolp)) (save-excurs= ion (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-ho= ok (progn (save-excursion (run-hook-with-args (quote org-trigger-hook) chan= ge-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-o= utline-regexp) (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-g= et nil "LOGGING" t t)) (set-match-data save-match-data-internal (quote evap= orate))))) (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-st= ring 1)) (hl-pos (match-beginning 0)) (head (org-get-todo-sequence-head thi= s)) (ass (assoc head org-todo-kwd-alist)) (interpret (nth 1 ass)) (done-wor= d (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 ... ...)) (o= rg-fast-todo-selection)) ((and (equal arg ...) (or ... ...)) (org-icompleti= ng-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 (qu= ote left)) (if (equal member org-todo-keywords-1) nil (if this ... ...))) (= (and (eq org-use-fast-todo-selection t) (equal arg ...) (setq arg nil))) (a= rg (cond (... nil) (... nil) (... ...) (... ...) (... ...) (...) (... ...) = (...))) ((null member) (or head (car org-todo-keywords-1))) ((equal this fi= nal-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-defaul= t-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-bl= ocker-hook (progn (setq org-last-todo-state-is-todo (not (member this org-d= one-keywords))) (if (save-excursion (let (...) (unwind-protect ... ...))) n= il (if (with-no-warnings (called-interactively-p ...)) (user-error "TODO st= ate change from %s to %s blocked (by \"%s\")" this org-state org-block-entr= y-blocking) (message "TODO state change from %s to %s blocked (by \"%s\")" = this org-state org-block-entry-blocking) (throw (quote exit) nil))))) (stor= e-match-data match-data) (replace-match next t t) (cond ((equal this org-st= ate) (message "TODO state was already %s" (org-trim next))) ((pos-visible-i= n-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 he= ad org-todo-kwd-alist) interpret (nth 1 ass) done-word (nth 3 ass) final-do= ne-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) (as= soc 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-s= tate org-done-keywords) (not (member this org-done-keywords)))) (and loggin= g (org-local-logging logging)) (if (and (or org-todo-log-states org-log-don= e) (not (eq org-inhibit-logging t)) (not (memq arg (quote (nextset previous= set))))) (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 not= e)) (eq org-inhibit-logging (quote note))) (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-planni= ng-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 (an= d ... ...) (org-add-log-setup ... org-state this ... ...)))) (if (and org-s= tate dolog) (progn (org-add-log-setup (quote state) org-state this (quote f= indpos) dolog))))) (org-todo-trigger-tag-changes org-state) (and org-auto-a= lign-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))) (setq head (org-get-todo-sequence-head org-state))) (put-t= ext-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-re= peat)) (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 (o= r (match-end 2) (match-end 1))))) (progn (goto-char (or (match-end 2) (matc= h-end 1))) (and (looking-at " ") (just-one-space)))) (if org-trigger-hook (= progn (save-excursion (run-hook-with-args (quote org-trigger-hook) change-p= list)))) (if commentp (progn (org-toggle-comment))))) (save-excursion (catch (quote exit) (org-back-to-heading t) (if (org-in-c= ommented-heading-p t) (progn (org-toggle-comment) (setq commentp t))) (if (= looking-at org-outline-regexp) (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-ali= st)) (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 (m= ember this org-todo-keywords-1)) (tail (cdr member)) (org-state (cond ((and= org-todo-key-trigger ...) (org-fast-todo-selection)) ((and ... ...) (org-i= completing-read "State: " ... nil t)) ((eq arg ...) (if this ... ...)) ((eq= arg ...) (if ... nil ...)) ((and ... ... ...)) (arg (cond ... ... ... ... = ... ... ... ...)) ((null member) (or head ...)) ((equal this final-done-wor= d) nil) ((null tail) nil) ((memq interpret ...) (if ... ... ...)) (t (car t= ail)))) (org-state (or (run-hook-with-args-until-success (quote org-todo-ge= t-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) (i= f org-blocker-hook (progn (setq org-last-todo-state-is-todo (not (member th= is 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-tr= im next))) ((pos-visible-in-window-p hl-pos) (message "TODO state changed t= o %s" (org-trim next)))) (if head nil (setq head (org-get-todo-sequence-hea= d 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 (nexts= et previousset))) (progn (message "Keyword-Set %d/%d: %s" (- (length org-to= do-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 l= ogging (org-local-logging logging)) (if (and (or org-todo-log-states org-lo= g-done) (not (eq org-inhibit-logging t)) (not (memq arg (quote ...)))) (pro= gn (setq dolog (or (nth 1 ...) (nth 2 ...))) (if (and (eq dolog ...) (eq or= g-inhibit-logging ...)) (setq dolog (quote time))) (if (or (and ... ...) (a= nd org-state ... ...)) (progn (org-add-planning-info nil nil ...))) (if (an= d now-done-p org-log-done) (progn (org-add-planning-info ... ...) (if ... .= ..))) (if (and org-state dolog) (progn (org-add-log-setup ... org-state thi= s ... dolog))))) (org-todo-trigger-tag-changes org-state) (and org-auto-ali= gn-tags (not org-setting-tags) (org-set-tags nil t)) (if org-provide-todo-s= tatistics (progn (org-update-parent-todo-statistics))) (run-hooks (quote or= g-after-todo-state-change-hook)) (if (and arg (not (member org-state org-do= ne-keywords))) (setq head (org-get-todo-sequence-head org-state))) (put-tex= t-property (point-at-bol) (point-at-eol) (quote org-todo-head) head) (if no= w-done-p (progn (if (boundp (quote org-agenda-headline-snapshot-before-repe= at)) (progn (let ... ...))) (org-auto-repeat-maybe org-state))) (if (and (o= utline-on-heading-p) (not (bolp)) (save-excursion (beginning-of-line 1) (lo= oking-at org-todo-line-regexp)) (< (point) (+ 2 (or ... ...)))) (progn (got= o-char (or (match-end 2) (match-end 1))) (and (looking-at " ") (just-one-sp= ace)))) (if org-trigger-hook (progn (save-excursion (run-hook-with-args (qu= ote org-trigger-hook) change-plist)))) (if commentp (progn (org-toggle-comm= ent)))))) (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 "NOBLOCKIN= G"))) (progn (setq org-blocker-hook nil))) (save-excursion (catch (quote ex= it) (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) (go= to-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-protec= t ... ...))) (org-log-done org-log-done) (org-log-repeat org-log-repeat) (o= rg-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 he= ad org-todo-kwd-alist)) (interpret (nth 1 ass)) (done-word (nth 3 ass)) (fi= nal-done-word (nth 4 ass)) (org-last-state (or this "")) (completion-ignore= -case t) (member (member this org-todo-keywords-1)) (tail (cdr member)) (or= g-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 tod= o-state-change) :from this :to org-state :position startpos)) dolog now-don= e-p) (if org-blocker-hook (progn (setq org-last-todo-state-is-todo (not ...= )) (if (save-excursion ...) nil (if ... ... ... ...)))) (store-match-data m= atch-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 (s= etq head (org-get-todo-sequence-head org-state) ass (assoc head org-todo-kw= d-alist) interpret (nth 1 ass) done-word (nth 3 ass) final-done-word (nth 4= ass))) (if (memq arg (quote (nextset previousset))) (progn (message "Keywo= rd-Set %d/%d: %s" (- ... -1 ...) (length org-todo-sets) (mapconcat ... ... = " ")))) (setq org-last-todo-state-is-todo (not (member org-state org-done-k= eywords))) (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-loggi= ng t)) (not (memq arg ...))) (progn (setq dolog (or ... ...)) (if (and ... = ...) (setq dolog ...)) (if (or ... ...) (progn ...)) (if (and now-done-p or= g-log-done) (progn ... ...)) (if (and org-state dolog) (progn ...)))) (org-= todo-trigger-tag-changes org-state) (and org-auto-align-tags (not org-setti= ng-tags) (org-set-tags nil t)) (if org-provide-todo-statistics (progn (org-= update-parent-todo-statistics))) (run-hooks (quote org-after-todo-state-cha= nge-hook)) (if (and arg (not (member org-state org-done-keywords))) (setq h= ead (org-get-todo-sequence-head org-state))) (put-text-property (point-at-b= ol) (point-at-eol) (quote org-todo-head) head) (if now-done-p (progn (if (b= oundp ...) (progn ...)) (org-auto-repeat-maybe org-state))) (if (and (outli= ne-on-heading-p) (not (bolp)) (save-excursion (beginning-of-line 1) (lookin= g-at org-todo-line-regexp)) (< (point) (+ 2 ...))) (progn (goto-char (or ..= . ...)) (and (looking-at " ") (just-one-space)))) (if org-trigger-hook (pro= gn (save-excursion (run-hook-with-args ... change-plist)))) (if commentp (p= rogn (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-lev= el)) (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) (org-end-of-subtree= nil t)))) (if (equal arg (quote (16))) (setq arg (quote nextset))) (if (eq= ual arg -1) (progn (org-cancel-repeater) (setq arg nil))) (let ((org-blocke= r-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-hoo= k (or org-inhibit-blocking (org-entry-get nil "NOBLOCKING"))) (progn (setq = org-blocker-hook nil))) (save-excursion (catch (quote exit) (org-back-to-he= ading t) (if (org-in-commented-heading-p t) (progn (org-toggle-comment) (se= tq commentp t))) (if (looking-at org-outline-regexp) (goto-char (1- (match-= end 0)))) (or (looking-at (concat " +" org-todo-regexp "\\( +\\|[ ]*$\\)")= ) (looking-at "\\(?: *\\|[ ]*$\\)")) (let* ((match-data (match-data)) (sta= rtpos (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) (o= rg-inhibit-logging (if ... ... org-inhibit-logging)) (this (match-string 1)= ) (hl-pos (match-beginning 0)) (head (org-get-todo-sequence-head this)) (as= s (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 "")) (comple= tion-ignore-case t) (member (member this org-todo-keywords-1)) (tail (cdr m= ember)) (org-state (cond ... ... ... ... ... ... ... ... ... ... ...)) (org= -state (or ... org-state)) (next (if org-state ... " ")) (change-plist (lis= t :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-visi= ble-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-st= ate org-done-keywords))) (setq now-done-p (and (member org-state org-done-k= eywords) (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-trigge= r-tag-changes org-state) (and org-auto-align-tags (not org-setting-tags) (o= rg-set-tags nil t)) (if org-provide-todo-statistics (progn (org-update-pare= nt-todo-statistics))) (run-hooks (quote org-after-todo-state-change-hook)) = (if (and arg (not ...)) (setq head (org-get-todo-sequence-head org-state)))= (put-text-property (point-at-bol) (point-at-eol) (quote org-todo-head) hea= d) (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 (sav= e-excursion ...))) (if commentp (progn (org-toggle-comment)))))))) org-todo(nil) call-interactively(org-todo nil nil) Hopefully this will be useful in tracking this bug. Thanks, Alan =2D-=20 OpenPGP Key ID : 040D0A3B4ED2E5C7 --=-=-= Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.0.22 (Darwin) iQEcBAEBCgAGBQJTvPkoAAoJEAQNCjtO0uXHNrMH/j8lIknifEWKfpQb9kRiTVbE JbCmfQYEpncq2euwKDYyr3rbSE0yLoqHvO77lcasb0FGeR4BRgcQfRykeHTLL9yq KG6/3ijNtkpPCQXcL1WvawwH0ykuOwpW7wJuDHZ2hlBiB2i9twPfyAh4VT0LLQcY fdHopLis/UGV+PSv6kPuAvN1Jytq4xqVj6XVX5/taIHyQYB/qVqSE3gPpEdWF3Wm F7Ei9sXPOchhm/HW3MuhsmAvZObVXpeJSVORw+S5o5u/7rdWxkpxbK2tXRMHgGVf 5N3mMcIRYpewY4bWa5fdCu6ZH9SPXt0kCX9rh2eXrt65PuVb588VTEMnZghc7lA= =TJ6G -----END PGP SIGNATURE----- --=-=-=--