From mboxrd@z Thu Jan 1 00:00:00 1970 From: Bernt Hansen Subject: [PATCH] Fix clock-in with effort and percent complete cookie Date: Sat, 20 Feb 2010 11:47:23 -0500 Message-ID: <1266684443-27473-1-git-send-email-bernt@norang.ca> Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NisUb-0002AZ-Jm for emacs-orgmode@gnu.org; Sat, 20 Feb 2010 11:47:45 -0500 Received: from [140.186.70.92] (port=56103 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NisUZ-00029J-VG for emacs-orgmode@gnu.org; Sat, 20 Feb 2010 11:47:45 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1NisUY-0000wz-Ue for emacs-orgmode@gnu.org; Sat, 20 Feb 2010 11:47:43 -0500 Received: from mho-02-ewr.mailhop.org ([204.13.248.72]:60457) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NisUY-0000wR-Rx for emacs-orgmode@gnu.org; Sat, 20 Feb 2010 11:47:42 -0500 Received: from cpe000102d0fe75-cm0012256ecbde.cpe.net.cable.rogers.com ([99.239.148.180] helo=mail.norang.ca) by mho-02-ewr.mailhop.org with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.68) (envelope-from ) id 1NisUR-000Ey0-9H for emacs-orgmode@gnu.org; Sat, 20 Feb 2010 16:47:35 +0000 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@gnu.org Cc: Bernt Hansen Fixes Lisp error: (error "Not enough arguments for format string") when the task to be clocked in has both a % in the heading due to the [%] cookie and an effort. --- I had a task "Update environment [90%]" that triggered this error when it contained an effort estimate. This commit is available at git://git.norang.ca/org-mode for-carsten lisp/org-clock.el | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lisp/org-clock.el b/lisp/org-clock.el index 6e895bf..e3866be 100644 --- a/lisp/org-clock.el +++ b/lisp/org-clock.el @@ -405,8 +405,8 @@ pointing to it." "Number of seconds between mode line clock string updates.") (defun org-clock-get-clock-string () - "Form a clock-string, that will be show in the mode line. -If an effort estimate was defined for current item, use + "Form a clock-string, that will be shown in the mode line. +If an effort estimate was defined for the current item, use 01:30/01:50 format (clocked/estimated). If not, show simply the clocked time like 01:50." (let* ((clocked-time (org-clock-get-clocked-time)) @@ -425,7 +425,7 @@ If not, show simply the clocked time like 01:50." (effort-str (format org-time-clocksum-format effort-h effort-m)) (clockstr (org-propertize (concat "[%s/" effort-str - "] (" org-clock-heading ")") + "] (" (replace-regexp-in-string "%" "%%" org-clock-heading) ")") 'face 'org-mode-line-clock))) (format clockstr work-done-str)) (org-propertize (format -- 1.7.0.14.g7e948