From mboxrd@z Thu Jan 1 00:00:00 1970 From: Levin Du Subject: Bug: :clock-in not working in org-capture-templates [7.9.1 (release_7.9.1-274-g2f4d76)] Date: Fri, 21 Sep 2012 10:47:25 +0800 Message-ID: <87mx0kdrcy.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([208.118.235.92]:47088) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TEtHS-0006kW-Vz for emacs-orgmode@gnu.org; Thu, 20 Sep 2012 22:47:51 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TEtHR-000631-V9 for emacs-orgmode@gnu.org; Thu, 20 Sep 2012 22:47:50 -0400 Received: from mail-pa0-f41.google.com ([209.85.220.41]:42026) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TEtHR-00062u-Mw for emacs-orgmode@gnu.org; Thu, 20 Sep 2012 22:47:49 -0400 Received: by padhz10 with SMTP id hz10so318288pad.0 for ; Thu, 20 Sep 2012 19:47:48 -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-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org Hi there, I find :clock-in not work in org-capture-templates, with initial empty heading: (setq org-capture-templates '(("j" "Journal" entry (file+datetree "") "* %?\n%U\n%i\n" :clock-in t :clock-resume t))) I proposed the patch: Modified lisp/org-clock.el diff --git a/lisp/org-clock.el b/lisp/org-clock.el index b8db2d1..674a5d7 100644 --- a/lisp/org-clock.el +++ b/lisp/org-clock.el @@ -1180,7 +1180,8 @@ make this the default behavior.)" (cond ((and org-clock-heading-function (functionp org-clock-heading-function)) (funcall org-clock-heading-function)) - ((looking-at org-complex-heading-regexp) + ((and (looking-at org-complex-heading-regexp) + (match-string 4)) (replace-regexp-in-string "\\[\\[.*?\\]\\[\\(.*?\\)\\]\\]" "\\1" (match-string 4))) Thanks Emacs : GNU Emacs 24.2.50.2 (x86_64-unknown-linux-gnu, GTK+ Version 2.24.10) of 2012-08-31 on tchip-levcom Package: Org-mode version 7.9.1 (release_7.9.1-274-g2f4d76 @ /home/zslevin/sd/emacs24-starter-kit/src/org-mode/lisp/)