emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Filtering org-clock-display
@ 2014-04-20  9:25 Noah Slater
  2014-04-20 10:26 ` Bastien
  0 siblings, 1 reply; 15+ messages in thread
From: Noah Slater @ 2014-04-20  9:25 UTC (permalink / raw)
  To: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 614 bytes --]

At the start of a clocktable, I can specify a few parameters that allow me
to filter/restrict the time ranges used for display.

For instance, this only shows me clocks from the past 30 days:

:tstart "<-30d>"

What I'd like to do is do this for org-clock-display too.

Perhaps I could specify it at the file level, like:

#+CLOCKPROPS:

Or perhaps this is something I could specify at the node level?

Either way, this would allow me to specify things like :tstart and I could
therefor have my clock display only show me times clocked in the previous
30 days (or whatever).

What do others think about this idea?

[-- Attachment #2: Type: text/html, Size: 854 bytes --]

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

* Re: Filtering org-clock-display
  2014-04-20  9:25 Filtering org-clock-display Noah Slater
@ 2014-04-20 10:26 ` Bastien
  2014-04-20 10:52   ` Noah Slater
  0 siblings, 1 reply; 15+ messages in thread
From: Bastien @ 2014-04-20 10:26 UTC (permalink / raw)
  To: Noah Slater; +Cc: emacs-orgmode

Noah Slater <nslater@tumbolia.org> writes:

> What do others think about this idea?

I welcome feedback on this but let's take care not to overengineer
this: if we add to many features to `org-clock-display', it will blur
the line between this temporary display and clock tables.

I would first try using temporary clock tables then see if the feature
is still need for org-clock-display.

Just my 2cts of lets-pretend-laziness-is-carefulness, of course,

-- 
 Bastien

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

* Re: Filtering org-clock-display
  2014-04-20 10:26 ` Bastien
@ 2014-04-20 10:52   ` Noah Slater
  2014-04-20 13:18     ` Bastien
  0 siblings, 1 reply; 15+ messages in thread
From: Noah Slater @ 2014-04-20 10:52 UTC (permalink / raw)
  To: Bastien; +Cc: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 2107 bytes --]

I suppose, in a way, blurring the line between org-clock-display and
clocktables is what I am trying to do. I think org-clock-display is much
more useful and easier to use. (Though I don't doubt that clocktables work
better for some folks.)

I started out with clocktables, but I found it clumsy to be checking my
clock times in one location, and then clocking times in another location.
This is true even when the clocktable is in the same file as the nodes.

Bit of context: I'm clock times for my own benefit, not for a client. My
primary concern is time allocation. i.e. Making sure that each of the areas
I clock under receives an appropriate amount of attention.

Old workflow:

- Jump to the top of the file or to the index file with my clocktable
- Refresh the clocktable
- Sort the clocktable by time
- Scan the table for the next area that needs my attention
- Either activate the link or manually find the corresponding node
- Clock on to that node

Note: sorting the clock table doesn't work very well. I want each level to
be sorted recursively.

New (and preferred) workflow:

- Sort nodes recursively (thanks Sacha!)
- org-overview
- org-clock-display
- Drill down into the area I that needs the most attention
- Clock on to that node

In this second workflow, notice that:

- Sorting works (because it can be done recursively, either manually as you
expand each node, or with a recursive function)
- The data (i.e. clocked time) is available *in situ* as I navigate around
the file

Wrt the laziness remark :) I am happy to write patches.



On 20 April 2014 12:26, Bastien <bzg@gnu.org> wrote:

> Noah Slater <nslater@tumbolia.org> writes:
>
> > What do others think about this idea?
>
> I welcome feedback on this but let's take care not to overengineer
> this: if we add to many features to `org-clock-display', it will blur
> the line between this temporary display and clock tables.
>
> I would first try using temporary clock tables then see if the feature
> is still need for org-clock-display.
>
> Just my 2cts of lets-pretend-laziness-is-carefulness, of course,
>
> --
>  Bastien
>

[-- Attachment #2: Type: text/html, Size: 2968 bytes --]

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

* Re: Filtering org-clock-display
  2014-04-20 10:52   ` Noah Slater
@ 2014-04-20 13:18     ` Bastien
  2014-05-24 18:25       ` Noah Slater
  0 siblings, 1 reply; 15+ messages in thread
From: Bastien @ 2014-04-20 13:18 UTC (permalink / raw)
  To: Noah Slater; +Cc: emacs-orgmode

Noah Slater <nslater@tumbolia.org> writes:

> Note: sorting the clock table doesn't work very well. I want each
> level to be sorted recursively.

Yeah, me too -- if you can work on enhancing how the :sort parameters
is handled for clocktables, that'd be great.

As for the rest, please try C-u C-u C-c C-x C-d from master.

We can enhance it by having an option setting the default custom range
for such display, but going further would be too much.

-- 
 Bastien

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

* Re: Filtering org-clock-display
  2014-04-20 13:18     ` Bastien
@ 2014-05-24 18:25       ` Noah Slater
  2014-05-25  5:26         ` Bastien
  0 siblings, 1 reply; 15+ messages in thread
From: Noah Slater @ 2014-05-24 18:25 UTC (permalink / raw)
  To: Bastien; +Cc: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 688 bytes --]

On 20 April 2014 15:18, Bastien <bzg@gnu.org> wrote:

> Noah Slater <nslater@tumbolia.org> writes:
>
> > Note: sorting the clock table doesn't work very well. I want each
> > level to be sorted recursively.
>
> Yeah, me too -- if you can work on enhancing how the :sort parameters
> is handled for clocktables, that'd be great.
>

Okay, I'll consider that, thanks.


> As for the rest, please try C-u C-u C-c C-x C-d from master.
>
> We can enhance it by having an option setting the default custom range
> for such display, but going further would be too much.
>

What does this do? (What changed?) Does it let me filter the display by
time period?

Sorry it took me so long to respond.

[-- Attachment #2: Type: text/html, Size: 1302 bytes --]

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

* Re: Filtering org-clock-display
  2014-05-24 18:25       ` Noah Slater
@ 2014-05-25  5:26         ` Bastien
  2014-05-25 19:47           ` Noah Slater
  0 siblings, 1 reply; 15+ messages in thread
From: Bastien @ 2014-05-25  5:26 UTC (permalink / raw)
  To: Noah Slater; +Cc: emacs-orgmode

Hi Noah,

Noah Slater <nslater@tumbolia.org> writes:

>     As for the rest, please try C-u C-u C-c C-x C-d from master.
>    
>     We can enhance it by having an option setting the default custom
>     range for such display, but going further would be too much.
>
>
> What does this do? (What changed?) Does it let me filter the display
> by time period?

Yes -- try it, you'll see.

> Sorry it took me so long to respond.

No problem!

-- 
 Bastien

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

* Re: Filtering org-clock-display
  2014-05-25  5:26         ` Bastien
@ 2014-05-25 19:47           ` Noah Slater
  2014-05-26  5:14             ` Bastien
  0 siblings, 1 reply; 15+ messages in thread
From: Noah Slater @ 2014-05-25 19:47 UTC (permalink / raw)
  To: Bastien; +Cc: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 495 bytes --]

On 25 May 2014 07:26, Bastien <bzg@gnu.org> wrote:

> Hi Noah,
>
> Noah Slater <nslater@tumbolia.org> writes:
>
> >     As for the rest, please try C-u C-u C-c C-x C-d from master.
> >
> >     We can enhance it by having an option setting the default custom
> >     range for such display, but going further would be too much.
> >
> >
> > What does this do? (What changed?) Does it let me filter the display
> > by time period?
>
> Yes -- try it, you'll see.


How do I configure the filtering?

[-- Attachment #2: Type: text/html, Size: 968 bytes --]

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

* Re: Filtering org-clock-display
  2014-05-25 19:47           ` Noah Slater
@ 2014-05-26  5:14             ` Bastien
  2014-05-26 15:35               ` Noah Slater
  0 siblings, 1 reply; 15+ messages in thread
From: Bastien @ 2014-05-26  5:14 UTC (permalink / raw)
  To: Noah Slater; +Cc: emacs-orgmode

Hi Noah,

Noah Slater <nslater@tumbolia.org> writes:

> How do I configure the filtering?

What filtering?

Please re-read the whole thread (where I mention that we *could* have
an option for the default filtering option).  Also put more context in
your questions -- such terse sentences makes me feel like I'm just an
answering machine.

Thanks,

-- 
 Bastien

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

* Re: Filtering org-clock-display
  2014-05-26  5:14             ` Bastien
@ 2014-05-26 15:35               ` Noah Slater
  2014-05-30 12:15                 ` Bastien
  0 siblings, 1 reply; 15+ messages in thread
From: Noah Slater @ 2014-05-26 15:35 UTC (permalink / raw)
  To: Bastien; +Cc: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 3248 bytes --]

Aha! Sorry, I hadn't updated my checkout to HEAD.

I see that when I run that command now, I get a prompt asking me for
"Range" with the following options:

lastmonth lastweek lastyear thismonth
thisweek thisyear today yesterday

And the new doc:

With one universal prefix argument, show the total time for
today.  With two universal prefix arguments, show the total time
for a custom range, entered at the prompt.  With three universal
prefix arguments, show the total time in the echo area.

That's pretty cool. Any reason it doesn't use the same syntax as the
:tstart param though?

This breaks a function I had written (and perhaps other people's functions).

To replicate this breakage, I wrote this function:

(defun clock-display-test ()
  (interactive)
  (org-clock-display))

Before this change, that would successfully call org-clock-display. Now it
displays this error in *Messages*:

clock-display-test: Wrong number of arguments: (lambda (arg) "Show subtree
times in the entire buffer.

With one universal prefix argument, show the total time for
today.  With two universal prefix arguments, show the total time
for a custom range, entered at the prompt.  With three universal
prefix arguments, show the total time in the echo area.

Use \\[org-clock-remove-overlays] to remove the subtree times."
(interactive "P") (org-clock-remove-overlays) (let* ((todayp (equal arg
(quote (4)))) (customp (equal arg (quote (16)))) (prop (cond (todayp
:org-clock-minutes-today) (customp :org-clock-minutes-custom) (t
:org-clock-minutes))) time h m p) (cond (todayp (org-clock-sum-today))
(customp (org-clock-sum-custom)) (t (org-clock-sum))) (if (eq arg (quote
(64))) nil (save-excursion (goto-char (point-min)) (while (or (and (equal
(setq p (point)) (point-min)) (get-text-property p prop)) (setq p
(next-single-property-change (point) prop))) (goto-char p) (if (setq time
(get-text-property p prop)) (progn (org-clock-put-overlay time)))) (setq h
(/ org-clock-file-total-minutes 60) m (- org-clock-file-total-minutes (* 60
h))) (if org-remove-highlights-with-change (progn (org-add-hook (quote
before-change-functions) (quote org-clock-remove-overlays) nil (quote
local)))))) (message (concat (format "Total file time%s: " (cond (todayp "
for today") (customp " (custom)") (t ""))) (org-minutes-to-clocksum-string
org-clock-file-total-minutes) " (%d hours and %d minutes)") h m))), 0

That doesn't look right to me. Should an error be printing out all that
stuff like that?

How should I change my function to call org-clock-display? Can I pass in
the range as an argument somehow?

Does it make sense for this function to behave like it used to if you just
call it like (org-clock-display) with no other arguments? (i.e. Make this
great new functionality backwards compatible, and off-by-default.)



On 26 May 2014 07:14, Bastien <bzg@gnu.org> wrote:

> Hi Noah,
>
> Noah Slater <nslater@tumbolia.org> writes:
>
> > How do I configure the filtering?
>
> What filtering?
>
> Please re-read the whole thread (where I mention that we *could* have
> an option for the default filtering option).  Also put more context in
> your questions -- such terse sentences makes me feel like I'm just an
> answering machine.
>
> Thanks,
>
> --
>  Bastien
>

[-- Attachment #2: Type: text/html, Size: 4648 bytes --]

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

* Re: Filtering org-clock-display
  2014-05-26 15:35               ` Noah Slater
@ 2014-05-30 12:15                 ` Bastien
  2014-05-31 13:36                   ` Noah Slater
  0 siblings, 1 reply; 15+ messages in thread
From: Bastien @ 2014-05-30 12:15 UTC (permalink / raw)
  To: Noah Slater; +Cc: emacs-orgmode

Hi Noah,

Noah Slater <nslater@tumbolia.org> writes:

> That's pretty cool. Any reason it doesn't use the same syntax as the
> :tstart param though?

I first want to see if the new feature is useful before adding up more
subfeatures.  So let's wait until 8.3 is released and see if (more)
people want more flexibility here.  In the meantime, I think it makes
sense to offer the predefined ranges that we can use in org clock
tables.

> This breaks a function I had written (and perhaps other people's
> functions).

This is now fixed, thanks,

-- 
 Bastien

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

* Re: Filtering org-clock-display
  2014-05-30 12:15                 ` Bastien
@ 2014-05-31 13:36                   ` Noah Slater
  2014-05-31 14:48                     ` Bastien
  0 siblings, 1 reply; 15+ messages in thread
From: Noah Slater @ 2014-05-31 13:36 UTC (permalink / raw)
  To: Bastien; +Cc: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 2544 bytes --]

I'm getting an error on HEAD now:

Debugger entered--Lisp error: (void-function org-add-props)
  (org-add-props "WARNING: No org-loaddefs.el file could be found from
where org.el is loaded." nil (quote face) (quote org-warning))
  (message (org-add-props "WARNING: No org-loaddefs.el file could be found
from where org.el is loaded." nil (quote face) (quote org-warning)))
  (condition-case nil (load (concat (file-name-directory load-file-name)
"org-loaddefs.el") nil t t t) (error (message (org-add-props "WARNING: No
org-loaddefs.el file could be found from where org.el is loaded." nil (qu$
  (or (equal this-command (quote eval-buffer)) (condition-case nil (load
(concat (file-name-directory load-file-name) "org-loaddefs.el") nil t t t)
(error (message (org-add-props "WARNING: No org-loaddefs.el file could b$
  eval-buffer(#<buffer  *load*-416952> nil
"/Users/nslater/.emacs.d/vendor/org-mode/lisp/org.el" nil t)  ; Reading at
buffer position 3681

load-with-code-conversion("/Users/nslater/.emacs.d/vendor/org-mode/lisp/org.el"
"/Users/nslater/.emacs.d/vendor/org-mode/lisp/org.el" nil t)
  require(org)
  eval-buffer(#<buffer  *load*-693116> nil
"/Users/nslater/.emacs.d/lisp/init-org.el" nil t)  ; Reading at buffer
position 127
  load-with-code-conversion("/Users/nslater/.emacs.d/lisp/init-org.el"
"/Users/nslater/.emacs.d/lisp/init-org.el" nil t)
  require(init-org)
  eval-buffer(#<buffer  *load*> nil "/Users/nslater/.emacs.d/init.el" nil
t)  ; Reading at buffer position 2043
  load-with-code-conversion("/Users/nslater/.emacs.d/init.el"
"/Users/nslater/.emacs.d/init.el" t t)
  load("/Users/nslater/.emacs.d/init" t t)
  #[0 "^H\205\262^@     \306=\203^Q^@\307^H\310Q\202;^@
\311=\204^^^@\307^H\312Q\202;^@\313\307\314\315#\203*^@\316\202;^@\313\307\314\317#\203:^@\320\nB^R\321\202;^@\316\322^S\323^A\322\211#\210^K\322=\203a^@\324\325\32$
  command-line()
  normal-top-level()



On 30 May 2014 14:15, Bastien <bzg@gnu.org> wrote:

> Hi Noah,
>
> Noah Slater <nslater@tumbolia.org> writes:
>
> > That's pretty cool. Any reason it doesn't use the same syntax as the
> > :tstart param though?
>
> I first want to see if the new feature is useful before adding up more
> subfeatures.  So let's wait until 8.3 is released and see if (more)
> people want more flexibility here.  In the meantime, I think it makes
> sense to offer the predefined ranges that we can use in org clock
> tables.
>
> > This breaks a function I had written (and perhaps other people's
> > functions).
>
> This is now fixed, thanks,
>
> --
>  Bastien
>

[-- Attachment #2: Type: text/html, Size: 3525 bytes --]

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

* Re: Filtering org-clock-display
  2014-05-31 13:36                   ` Noah Slater
@ 2014-05-31 14:48                     ` Bastien
  2014-05-31 21:36                       ` Noah Slater
  0 siblings, 1 reply; 15+ messages in thread
From: Bastien @ 2014-05-31 14:48 UTC (permalink / raw)
  To: Noah Slater; +Cc: emacs-orgmode

Noah Slater <nslater@tumbolia.org> writes:

> I'm getting an error on HEAD now:

Please run `make' or `make autoloads'.

See http://orgmode.org/manual/Installation.html

-- 
 Bastien

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

* Re: Filtering org-clock-display
  2014-05-31 14:48                     ` Bastien
@ 2014-05-31 21:36                       ` Noah Slater
  2014-07-28 15:45                         ` Bastien
  0 siblings, 1 reply; 15+ messages in thread
From: Noah Slater @ 2014-05-31 21:36 UTC (permalink / raw)
  To: Bastien; +Cc: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 506 bytes --]

Works! Thanks!

Can I pass in the range when calling it from a function?

At the moment, I'm calling org-clock-display from a wrapper function that
does some other things. It would be cool to configure a default range when
calling it in that function.


On 31 May 2014 16:48, Bastien <bzg@gnu.org> wrote:

> Noah Slater <nslater@tumbolia.org> writes:
>
> > I'm getting an error on HEAD now:
>
> Please run `make' or `make autoloads'.
>
> See http://orgmode.org/manual/Installation.html
>
> --
>  Bastien
>

[-- Attachment #2: Type: text/html, Size: 1098 bytes --]

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

* Re: Filtering org-clock-display
  2014-05-31 21:36                       ` Noah Slater
@ 2014-07-28 15:45                         ` Bastien
  2014-08-05 14:51                           ` Noah Slater
  0 siblings, 1 reply; 15+ messages in thread
From: Bastien @ 2014-07-28 15:45 UTC (permalink / raw)
  To: Noah Slater; +Cc: emacs-orgmode

Hi Noah,

Noah Slater <nslater@tumbolia.org> writes:

> Can I pass in the range when calling it from a function?

Not directly.

(org-clock-display '(16)) will interactively prompt for a range.

(let ((org-clock-display-default-range 'thisweek))
  (org-clock-display))

will display the clock with the new option
`org-clock-display-default-range' set to thisweek.

HTH,

-- 
 Bastien

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

* Re: Filtering org-clock-display
  2014-07-28 15:45                         ` Bastien
@ 2014-08-05 14:51                           ` Noah Slater
  0 siblings, 0 replies; 15+ messages in thread
From: Noah Slater @ 2014-08-05 14:51 UTC (permalink / raw)
  To: Bastien; +Cc: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 751 bytes --]

Hello Bastien,

I can't get this to work.

(org-clock-display '(16)) -- this works fine!

(let ((org-clock-display-default-range 'thisweek))
  (org-clock-display))

^ This however just runs org-clock-display for all time without a prompt.

I have updated to HEAD and ran `make`.


On 28 July 2014 17:45, Bastien <bzg@gnu.org> wrote:

> Hi Noah,
>
> Noah Slater <nslater@tumbolia.org> writes:
>
> > Can I pass in the range when calling it from a function?
>
> Not directly.
>
> (org-clock-display '(16)) will interactively prompt for a range.
>
> (let ((org-clock-display-default-range 'thisweek))
>   (org-clock-display))
>
> will display the clock with the new option
> `org-clock-display-default-range' set to thisweek.
>
> HTH,
>
> --
>  Bastien
>

[-- Attachment #2: Type: text/html, Size: 1432 bytes --]

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

end of thread, other threads:[~2014-08-05 14:51 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-04-20  9:25 Filtering org-clock-display Noah Slater
2014-04-20 10:26 ` Bastien
2014-04-20 10:52   ` Noah Slater
2014-04-20 13:18     ` Bastien
2014-05-24 18:25       ` Noah Slater
2014-05-25  5:26         ` Bastien
2014-05-25 19:47           ` Noah Slater
2014-05-26  5:14             ` Bastien
2014-05-26 15:35               ` Noah Slater
2014-05-30 12:15                 ` Bastien
2014-05-31 13:36                   ` Noah Slater
2014-05-31 14:48                     ` Bastien
2014-05-31 21:36                       ` Noah Slater
2014-07-28 15:45                         ` Bastien
2014-08-05 14:51                           ` Noah Slater

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).