From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?UTF-8?B?0KDQvtC80LAg0KDRg9C00LDQutC+0LI=?= Subject: Log change TODO state after clock-out Date: Wed, 26 Jul 2017 15:42:23 +0300 Message-ID: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="f403045c14669b9603055537c753" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:57712) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1daLe3-0007kv-Fu for emacs-orgmode@gnu.org; Wed, 26 Jul 2017 08:42:32 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1daLdz-0006l1-BC for emacs-orgmode@gnu.org; Wed, 26 Jul 2017 08:42:31 -0400 Received: from mail-wm0-x22b.google.com ([2a00:1450:400c:c09::22b]:38742) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1daLdz-0006iQ-18 for emacs-orgmode@gnu.org; Wed, 26 Jul 2017 08:42:27 -0400 Received: by mail-wm0-x22b.google.com with SMTP id m85so66446324wma.1 for ; Wed, 26 Jul 2017 05:42:25 -0700 (PDT) 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" To: emacs-orgmode@gnu.org --f403045c14669b9603055537c753 Content-Type: text/plain; charset="UTF-8" Hello, my minimal configuration: (setq org-todo-keywords '((sequence "TODO(t)" "PROGRESS(p!)" "WAITING(w!)" "|" "DONE(d!)"))) (setq org-clock-persist 'history) (org-clock-persistence-insinuate) (setq org-log-into-drawer t) (setq org-log-done 'time) (defun rr/set-progress (last) "Set PROGRESS state if LAST is different." (when (not (string-equal last "PROGRESS")) "PROGRESS")) (setq org-clock-in-switch-to-state 'rr/set-progress) (defun rr/after-clock-stop (last) "Change TASK state after clock stop depends on LAST state." (when (not (or (string-equal last "WAITING") (string-equal last "DONE") (string-equal last "TODO"))) (if (y-or-n-p "Current task DONE? ") "DONE" "WAITING"))) (setq org-clock-out-switch-to-state 'rr/after-clock-stop) I have a simple org file: * TODO task 1 * TODO task 2 * TODO task 3 * TODO task 4 Steps to reproduce my issue: 1. Go to task 1 and clock-in. Result is: * PROGRESS task 1 :LOGBOOK: - State "PROGRESS" from "TODO" [2017-07-26 Wed 15:37] CLOCK: [2017-07-26 Wed 15:37] :END: * TODO task 2 * TODO task 3 * TODO task 4 2. Clock-out the task, answer y or n. Expected result: * DONE task 1 CLOSED: [2017-07-26 Wed 15:39] :LOGBOOK: - State "DONE" from "PROGRESS" [2017-07-26 Wed 15:39] - State "PROGRESS" from "TODO" [2017-07-26 Wed 15:37] CLOCK: [2017-07-26 Wed 15:37]--[2017-07-26 Wed 15:38] => 0:01 :END: * TODO task 2 * TODO task 3 * TODO task 4 Actual result: * DONE task 1 :LOGBOOK: - State "PROGRESS" from "TODO" [2017-07-26 Wed 15:37] CLOCK: [2017-07-26 Wed 15:37]--[2017-07-26 Wed 15:38] => 0:01 :END: * TODO task 2 * TODO task 3 * TODO task 4 There is no CLOSED log entry and change state from PROGRESS to DONE entry. Please help me to find proper configuration. Thank you in advance. --f403045c14669b9603055537c753 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hello,
my minimal configuration:
(setq org-todo-keywords
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 '((sequence = "TODO(t)" "PROGRESS(p!)" "WAITING(w!)" "= |" "DONE(d!)")))

(setq org-clock-persist 'history= )
(org-clock-persistence-insinuate)
(setq org-log-into-drawer t)
(= setq org-log-done 'time)

(defun rr/set-progress (last)
=C2=A0= "Set PROGRESS state if LAST is different."
=C2=A0 (when (not = (string-equal last "PROGRESS"))
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= "PROGRESS"))

(setq org-clock-in-switch-to-state 'rr/s= et-progress)

(defun rr/after-clock-stop (last)
=C2=A0 "Chang= e TASK state after clock stop depends on LAST state."
=C2=A0 (when = (not (or (string-equal last "WAITING")
=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= (string-equal last "DONE")
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (string-equ= al last "TODO")))
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (if (y-or-n-p= "Current task DONE? ")
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 "DONE"
=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 "WAITING")))
=

(setq org-clock-out-switch-to-state 'rr/after-clock-stop)
<= br>
I have a simple org file:

* TODO task 1
* TODO task= 2
* TODO task 3
* TODO task 4

Steps to reproduce m= y issue:
1. Go to task 1 and clock-in. Result is:

* PR= OGRESS task 1
=C2=A0 :LOGBOOK:
=C2=A0 - State "PROGRESS"=C2= =A0=C2=A0 from "TODO"=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 [2017-0= 7-26 Wed 15:37]
=C2=A0 CLOCK: [2017-07-26 Wed 15:37]
=C2=A0 :END:
= * TODO task 2
* TODO task 3
* TODO task 4

2. Clock-= out the task, answer y or n.

Expected result:

* DONE task 1<= br>=C2=A0 CLOSED: [2017-07-26 Wed 15:39]
=C2=A0 :LOGBOOK:
=C2=A0 - St= ate "DONE"=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 from "PROGRES= S"=C2=A0=C2=A0 [2017-07-26 Wed 15:39]
=C2=A0 - State "PROGRESS= "=C2=A0=C2=A0 from "TODO"=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0 [2017-07-26 Wed 15:37]
=C2=A0 CLOCK: [2017-07-26 Wed 15:37]--[2017-0= 7-26 Wed 15:38] =3D>=C2=A0 0:01
=C2=A0 :END:
* TODO task 2
* TO= DO task 3
* TODO task 4


Actual result:

* DO= NE task 1
=C2=A0 :LOGBOOK:
=C2=A0 - State "PROGRESS"=C2=A0= =C2=A0 from "TODO"=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 [2017-07-2= 6 Wed 15:37]
=C2=A0 CLOCK: [2017-07-26 Wed 15:37]--[2017-07-26 Wed 15:38= ] =3D>=C2=A0 0:01
=C2=A0 :END:
* TODO task 2
* TODO task 3
*= TODO task 4

There is no CLOSED log entry and change stat= e from PROGRESS to DONE entry.

Please help me to find proper config= uration.
Thank you in advance.
--f403045c14669b9603055537c753--