From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Goaziou Subject: Re: [PATCH] org-clock: Align formula column in clock tables Date: Sun, 19 Mar 2017 11:00:33 +0100 Message-ID: <8760j537su.fsf@nicolasgoaziou.fr> References: <877f3m24xu.wl@dns1.atmark-techno.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:55548) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cpXdi-00039O-7i for emacs-orgmode@gnu.org; Sun, 19 Mar 2017 06:00:43 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cpXdd-00014t-Iu for emacs-orgmode@gnu.org; Sun, 19 Mar 2017 06:00:42 -0400 Received: from relay4-d.mail.gandi.net ([217.70.183.196]:59691) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1cpXdd-00012n-Bu for emacs-orgmode@gnu.org; Sun, 19 Mar 2017 06:00:37 -0400 In-Reply-To: <877f3m24xu.wl@dns1.atmark-techno.com> (Yasushi SHOJI's message of "Sat, 18 Mar 2017 16:44:51 +0900") 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" To: Yasushi SHOJI Cc: emacs-orgmode@gnu.org Hello, Yasushi SHOJI writes: > * lisp/org-clock.el (org-clocktable-write-default): Align formula > column in clock tables. > > Here is an ECM: > > * foo > ** sub > :LOGBOOK: > CLOCK: [2017-03-18 Sat 15:00]--[2017-03-18 Sat 15:15] => 0:15 > :END: > ** sub2 > :LOGBOOK: > CLOCK: [2017-03-18 Sat 15:15]--[2017-03-18 Sat 15:30] => 0:15 > :END: > ** sub3 > *** subsub1 > :LOGBOOK: > CLOCK: [2017-03-18 Sat 13:00]--[2017-03-18 Sat 13:15] => 0:15 > :END: > *** subsub1 > :LOGBOOK: > CLOCK: [2017-03-18 Sat 14:00]--[2017-03-18 Sat 14:15] => 0:15 > :END: > * bar > :LOGBOOK: > CLOCK: [2017-03-18 Sat 13:15]--[2017-03-18 Sat 13:30] => 0:15 > :END: > * table > > #+BEGIN: clocktable :maxlevel 3 :scope file :formula % > #+CAPTION: Clock summary at [2017-03-18 Sat 16:50] > > | Headline | Time | | | % | > |---------------+--------+------+------+-------| > | *Total time* | *1:15* | | | 100.0 | > |---------------+--------+------+------+-------| > | foo | 1:00 | | | 80.0 | > | \_ sub | | 0:15 | | 20.0 | > | \_ sub2 | | 0:15 | | 20.0 | > | \_ sub3 | | 0:30 | | 40.0 | > | \_ subsub1 | | | 0:15 | 20.0 | > | \_ subsub1 | | | 0:15 | 20.0 | > | bar | 0:15 | | | 20.0 | > #+END: > --- > lisp/org-clock.el | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/lisp/org-clock.el b/lisp/org-clock.el > index ffa1b3003..73afd87e6 100644 > --- a/lisp/org-clock.el > +++ b/lisp/org-clock.el > @@ -2622,6 +2622,7 @@ from the dynamic block definition." > ;; Empty fields for higher levels. > (make-string (max 0 (1- (min time-columns level))) ?|) > hlc (org-minutes-to-clocksum-string time) hlc "|" ; time > + (make-string (max 0 (- time-columns level)) ?|) > (if (eq formula '%) > (format "%.1f |" (* 100 (/ time (float total-time)))) > "") Applied, with a proper commit message. Thank you. Regards, -- Nicolas Goaziou