From mboxrd@z Thu Jan 1 00:00:00 1970 From: Sebastian Rose Subject: empty todo item at EOF and clock Date: Tue, 18 Mar 2008 03:45:34 +0100 Message-ID: <47DF2CCE.4050801@gmx.de> Reply-To: sebastian_rose@gmx.de Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------020600050206010208040205" Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JbRot-0003y2-KC for emacs-orgmode@gnu.org; Mon, 17 Mar 2008 22:44:57 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JbRor-0003xJ-Jo for emacs-orgmode@gnu.org; Mon, 17 Mar 2008 22:44:54 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JbRor-0003xG-Bx for emacs-orgmode@gnu.org; Mon, 17 Mar 2008 22:44:53 -0400 Received: from mail.gmx.net ([213.165.64.20]) by monty-python.gnu.org with smtp (Exim 4.60) (envelope-from ) id 1JbRoq-0005Qt-Gi for emacs-orgmode@gnu.org; Mon, 17 Mar 2008 22:44:53 -0400 List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: "[emacs-orgmode]" This is a multi-part message in MIME format. --------------020600050206010208040205 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Small bug, when clocking in and out (git head from 03.11.2008 11:15) Adding empty TODO item at end of an org file (no heading, no text) and clocking in by changing TODO-state to 'STARTING' and then clock out by changing the items state to 'DONE' triggers an error. My org setup is (setq debug-on-error t) and: ;; Think I have this from the manual: (defun sr-org-todo-toggle-to-started() "Start the clock, if the state of a todo item changes to 'STARTED'." (if(string= "STARTED" state) (org-clock-in))) (setq org-after-todo-state-change-hook (quote (org-clock-out-if-current sr-org-todo-toggle-to-started)) To reproduce this bug, move to the end of file, hit M-S-RET To insert an TODO item Don't add any text, not even a heading Toggle it to 'STARTED' using S-RIGHT Repeat, to toggle to 'DONE' Debugger entered--Lisp error: (error "Clock start time is gone") signal(error ("Clock start time is gone")) error("Clock start time is gone") byte-code("....") org-clock-out() org-clock-out-if-current() run-hooks(org-after-todo-state-change-hook) byte-code("......") org-todo(right) call-interactively(org-todo) org-shiftright() call-interactively(org-shiftright nil nil) The item gets malformed after toggling to 'DONE' like this: * DONE CLOCK: [2008-03-18 Di 03:10] CLOSED: [2008-03-18 Di 03:11] Should be * DONE CLOSED: [2008-03-18 Di 03:11] CLOCK: [2008-03-18 Di 03:10]--[2008-03-18 Di 03:11] => 0:01 Only in case the item is empty and at end of file, the :CLOCK is considered the heading. It's really a edge case :-) Regards, Sebastian --------------020600050206010208040205 Content-Type: text/x-vcard; charset=utf-8; name="sebastian_rose.vcf" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="sebastian_rose.vcf" YmVnaW46dmNhcmQNCmZuOlNlYmFzdGlhbiBSb3NlDQpuOlJvc2U7U2ViYXN0aWFuDQplbWFp bDtpbnRlcm5ldDpzZWJhc3RpYW5fcm9zZUBnbXguZGUNCnRpdGxlOkZhY2hpbmZvcm1hdGlr ZXIvQW53ZW5kZW5kdW5nc2VudHdpY2tsdW5nDQp0ZWw7Y2VsbDorNDkgMTczIC8gODMgOTMg NDE3DQpub3RlO3F1b3RlZC1wcmludGFibGU6RW50d2lja2x1bmcgIHZvbiBJbnRlcm5ldGFu d2VuZHVuZ2VuIHVuZCBQcm9ncmFtbWVuICBtaXQgIGZyZWllbiAgV2Vya3pldT0NCglnZW4g IHVuZCBCaWJsaW90aGVrZW4uPTBEPTBBPQ0KCT0wRD0wQT0NCglQSFAsIEphdmEsIEMvQysr LCAgQmFzaCwgIFBlcmwsICBBcGFjaGUsIE15U1FMLCAgUG9zdGdyZVNRTCwgeHQ6OmNvbW1l cmNlPQ0KCSwgVHlwbzMsIFNlcnZlciwgIE5ldHp3ZXJrLCAgRGVza3RvcCwgRGF0ZW5iYW5r LCBndGttbT0wRD0wQT0NCgkNCngtbW96aWxsYS1odG1sOkZBTFNFDQp2ZXJzaW9uOjIuMQ0K ZW5kOnZjYXJkDQoNCg== --------------020600050206010208040205 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Emacs-orgmode mailing list Remember: use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode --------------020600050206010208040205--