From mboxrd@z Thu Jan 1 00:00:00 1970 From: Antoine Levitt Subject: Re: Custom time display in mode-line Date: Tue, 1 May 2012 14:46:03 +0000 (UTC) Message-ID: References: <873a25f1iy.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Return-path: Received: from eggs.gnu.org ([208.118.235.92]:43556) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SPELJ-0005YL-5s for emacs-orgmode@gnu.org; Tue, 01 May 2012 10:46:18 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SPELH-0001BB-Bx for emacs-orgmode@gnu.org; Tue, 01 May 2012 10:46:16 -0400 Received: from plane.gmane.org ([80.91.229.3]:38950) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SPELH-0001As-4Z for emacs-orgmode@gnu.org; Tue, 01 May 2012 10:46:15 -0400 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1SPELE-0003N8-FV for emacs-orgmode@gnu.org; Tue, 01 May 2012 16:46:12 +0200 Received: from ney92-7-78-233-218-202.fbx.proxad.net ([78.233.218.202]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 01 May 2012 16:46:12 +0200 Received: from antoine.levitt by ney92-7-78-233-218-202.fbx.proxad.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 01 May 2012 16:46:12 +0200 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 Daniel Clemente gmail.com> writes: > > > Hi > > org-clock-modeline-total now accepts following values: current, today, repeat, all, auto. > It would be useful to allow it to accept either a custom function or a format string which composes a text > string like: > "0:10 (tot: 1:10/2:00)" > meaning: „clocking 10 minutes in this session, but the total clocked time (including those 10min) is > 1:10, and the effort estimate is 2:00“. > > Not all entries have a „total clocked time“ (: entries clocked for the first time) and not all entries > have an estimate. > - Either many format strings must be given (_simple, _with_total, _with_estimate, > _with_total_and_estimate), e.g. ("%current" "%current (tot: %total)" "%current/%estimate" > "%current (tot:%total/%estimate)") > - … or we must cope with results like "0:10 (tot: /)" > - … or a custom function must be used to do those conditionals. > > Accepting a function would be like redefining org-clock-get-clock-string but without touching org's core. > > I tried to change the code but I'm confused as to why org-clock-modeline- total (a mere > visualization/„view“ setting) is read in org-clock-get-sum-start (which is a „model“/core > function and therefore not tied to any particular „view“). I think org-clock- modeline-total > should be read just in org-clock-get-clock-string. > Documentation of org-clock-get-clocked-time is also wrong („The time returned includes the time > spent on this task in previous clocking intervals.“) since this depends on what > org-clock-get-sum-start did. > > -- > Daniel Hi, I just started using org-clock, and that seems like a major issue (from an emacs user perspective, who is used to be able to modify everything that gets displayed, especially such an important part). The code is a bit messy and I don't understand everything, so I'm not able to write a patch for this, but can someone look into that? Ideally, org-clock-modeline-total would be obsoleted and replaced by a org-clock-modeline-format that'd get passed to format-spec.