From mboxrd@z Thu Jan 1 00:00:00 1970 From: Yasushi SHOJI Subject: [PATCH] org-clock: Align formula column in clock tables Date: Sat, 18 Mar 2017 16:44:51 +0900 Message-ID: <877f3m24xu.wl@dns1.atmark-techno.com> Mime-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:51621) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cpCe9-0001aB-OW for emacs-orgmode@gnu.org; Sat, 18 Mar 2017 07:35:46 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cpCe4-0005LL-Rr for emacs-orgmode@gnu.org; Sat, 18 Mar 2017 07:35:45 -0400 Received: from p654789.hkidff01.ap.so-net.ne.jp ([121.101.71.137]:38442 helo=gw.atmark-techno.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cpCe4-0005Ju-II for emacs-orgmode@gnu.org; Sat, 18 Mar 2017 07:35:40 -0400 Received: from mail-pf0-f200.google.com (mail-pf0-f200.google.com [209.85.192.200]) by gw.atmark-techno.com (Postfix) with ESMTPS id ADCBF204B6 for ; Sat, 18 Mar 2017 20:35:36 +0900 (JST) Received: by mail-pf0-f200.google.com with SMTP id e129so168599174pfh.1 for ; Sat, 18 Mar 2017 04:35:36 -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" To: emacs-orgmode@gnu.org * 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)))) "") -- 2.11.0