From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Goaziou Subject: Re: (org-entry-get (point) "CLOCK") fails now Date: Sun, 30 Aug 2015 17:21:51 +0200 Message-ID: <87mvx83ipc.fsf@nicolasgoaziou.fr> References: <87io7xc8au.fsf@kaffanke.at> <87r3ml2ca9.fsf@nicolasgoaziou.fr> <87si71lycn.fsf@mbork.pl> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:46621) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZW4P0-0004Ow-3W for emacs-orgmode@gnu.org; Sun, 30 Aug 2015 11:20:14 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZW4Oz-0002HG-4M for emacs-orgmode@gnu.org; Sun, 30 Aug 2015 11:20:14 -0400 Received: from relay4-d.mail.gandi.net ([2001:4b98:c:538::196]:51596) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZW4Oy-0002H3-Sn for emacs-orgmode@gnu.org; Sun, 30 Aug 2015 11:20:13 -0400 In-Reply-To: <87si71lycn.fsf@mbork.pl> (Marcin Borkowski's message of "Sun, 30 Aug 2015 15:06:32 +0200") 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: Marcin Borkowski Cc: emacs-orgmode@gnu.org, Martin Kaffanke Hello, Marcin Borkowski writes: > Let me hijack this thread a bit;-), since my issue seems similar. > I need to get the number of minutes just clocked (so only the last clock > entry) in org-clock-out-hook. Currently, what I'm doing is very > hackish: I check current-message for regex "LINE REMOVED$", and if it > doesn't match, I do looking-back with a regex catching things like 0:12. > All this seems extremely fragile. Is there a better way? (Probably > yes, but what is it?) Point should be on clocked out clock when `org-clock-out-hook' is run. You can probably use (org-element-property :duration (org-element-at-point)) to extract last duration. Note that this issue is not similar to OP's issue, because CLOCK property, for whatever value it was supposed to contain, wouldn't have helped here. Regards, -- Nicolas Goaziou