From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Goaziou Subject: Re: Bug: org-clock-remove-empty-clock-drawer eats LOGBOOK drawer before todo state gets logged [8.3.2 (8.3.2-52-g6d0af5-elpaplus @ /Users/Olli/.emacs.d/elpa/org-20151228/)] Date: Wed, 06 Jan 2016 15:52:30 +0100 Message-ID: <87bn8yu5e9.fsf@nicolasgoaziou.fr> References: Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:33856) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aGpQ6-0000jJ-QR for emacs-orgmode@gnu.org; Wed, 06 Jan 2016 09:50:43 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aGpQ1-0007xq-RS for emacs-orgmode@gnu.org; Wed, 06 Jan 2016 09:50:38 -0500 Received: from relay3-d.mail.gandi.net ([217.70.183.195]:59792) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aGpQ1-0007xP-L0 for emacs-orgmode@gnu.org; Wed, 06 Jan 2016 09:50:33 -0500 In-Reply-To: (Olli P.'s message of "Sun, 03 Jan 2016 23:09:04 +0700") 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: Olli P Cc: emacs-orgmode@gnu.org Hello, Olli P writes: > Steps to reproduce: > > Launching Emacs with -Q, calling `M-x package-initialize` and then `M-x > org-mode`, and evaluating the following settings: > > (setq org-clock-into-drawer t) > (setq org-log-into-drawer t) > (setq org-clock-into-drawer t) > (setq org-log-done 'time) > (setq org-clock-out-when-done t) > (setq org-clock-out-remove-zero-time-clocks t) > (setq org-todo-keywords '((sequence "TODO(t)" "WAIT(w@/!)" "|" "DONE(d!)" "CANCELED(c@)"))) > > Creating a new task, clock-in in and immediately completing the task > will result in: > ---------------------------------------------------------------------- > > * DONE I bug out > CLOSED: [2016-01-03 Sun 21:36] > - State "DONE" from "TODO" [2016-01-03 Sun 21:36] > > ---------------------------------------------------------------------- > Instead of the expected: > ---------------------------------------------------------------------- > > * DONE I bug out > CLOSED: [2016-01-03 Sun 21:38] > :LOGBOOK: > - State "DONE" from "TODO" [2016-01-03 Sun 21:38] > :END: > > ---------------------------------------------------------------------- > If I wait for the timer to run for a minute then things work as expected > as well: > ---------------------------------------------------------------------- > > * DONE I bug out > CLOSED: [2016-01-03 Sun 23:00] > :LOGBOOK: > - State "DONE" from "TODO" [2016-01-03 Sun 23:00] > CLOCK: [2016-01-03 Sun 22:59]--[2016-01-03 Sun 23:00] => 0:01 > :END: > > ---------------------------------------------------------------------- > The culprit is `org-clock-remove-empty-clock-drawer` that gets run at > the end of `org-clock-out` for being a `org-clock-out-hook`. Fixed in development version. Thank you for the report. Regards, -- Nicolas Goaziou