emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] Filtering org-clock-display


From: Noah Slater
Subject: Re: [O] Filtering org-clock-display
Date: Mon, 26 May 2014 17:35:51 +0200

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 <address@hidden> wrote:
Hi Noah,

Noah Slater <address@hidden> 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


reply via email to

[Prev in Thread] Current Thread [Next in Thread]