emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Custom time display in mode-line
@ 2010-01-17 10:50 Daniel Clemente
  2012-05-01 14:46 ` Antoine Levitt
  0 siblings, 1 reply; 4+ messages in thread
From: Daniel Clemente @ 2010-01-17 10:50 UTC (permalink / raw)
  To: org-mode Mailinglist


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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Custom time display in mode-line
  2010-01-17 10:50 Custom time display in mode-line Daniel Clemente
@ 2012-05-01 14:46 ` Antoine Levitt
  2012-05-01 17:41   ` Bastien
  0 siblings, 1 reply; 4+ messages in thread
From: Antoine Levitt @ 2012-05-01 14:46 UTC (permalink / raw)
  To: emacs-orgmode

Daniel Clemente <n142857 <at> 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.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Custom time display in mode-line
  2012-05-01 14:46 ` Antoine Levitt
@ 2012-05-01 17:41   ` Bastien
  2012-05-01 18:05     ` Antoine Levitt
  0 siblings, 1 reply; 4+ messages in thread
From: Bastien @ 2012-05-01 17:41 UTC (permalink / raw)
  To: Antoine Levitt; +Cc: emacs-orgmode

Antoine Levitt <antoine.levitt@gmail.com> writes:

> Ideally, org-clock-modeline-total would be obsoleted and replaced by a
> org-clock-modeline-format that'd get passed to format-spec.

Please suggest the docstring for `org-clock-modeline-format'.  This 
will give us a stable basis to work on.  

At this stage, I don't understand clearly enough what is buggy about
`org-clock-modeline-total'.

Thanks,

-- 
 Bastien

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Custom time display in mode-line
  2012-05-01 17:41   ` Bastien
@ 2012-05-01 18:05     ` Antoine Levitt
  0 siblings, 0 replies; 4+ messages in thread
From: Antoine Levitt @ 2012-05-01 18:05 UTC (permalink / raw)
  To: Bastien; +Cc: emacs-orgmode

Hi,
Thanks for answering,

01/05/12 19:41, Bastien
> Antoine Levitt <antoine.levitt@gmail.com> writes:
>
>> Ideally, org-clock-modeline-total would be obsoleted and replaced by a
>> org-clock-modeline-format that'd get passed to format-spec.
>
> Please suggest the docstring for `org-clock-modeline-format'.  This 
> will give us a stable basis to work on.  
>
> At this stage, I don't understand clearly enough what is buggy about
> `org-clock-modeline-total'.

It's not buggy, it's just not customizable enough. I'm very sensitive
about what goes into my modeline. (and apparently I'm not alone)

I have in mind something like mode-line-format. So for instance, the
docstring would be something like:

"String containing a template for displaying mode line when clock is
active. The following %-constructs will be replaced:
%n -- the name of the task
%t -- time clocked into this task today
%c -- time clocked in the current instance of the clock
%a -- all time clocked for this task"

Plus there should probably be stuff about repeats and effort that I
don't understand because I don't use them.

Other emacs packages (for instance, gnus via gnus-group-line-format and
such variables) allow pretty much unlimited customization of these
format strings, so it makes sense that org does too.

But I'm realizing that even that is not sufficient for what I want. What
I really want is complete lisp control, with access to the time
clocked. For instance, I'd like to be able to display stuff like "Task1
: 00:24 today, 04:13 this week". Maybe a refactoring with more options
to org-clock-get-clocked-time (for instance, accepting the same :block
options as the clocktable) would be a good idea?

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2012-05-01 18:06 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-01-17 10:50 Custom time display in mode-line Daniel Clemente
2012-05-01 14:46 ` Antoine Levitt
2012-05-01 17:41   ` Bastien
2012-05-01 18:05     ` Antoine Levitt

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).