emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Noah Slater <nslater@tumbolia.org>
To: Bastien <bzg@gnu.org>
Cc: emacs-orgmode@gnu.org
Subject: Re: Filtering org-clock-display
Date: Mon, 26 May 2014 17:35:51 +0200	[thread overview]
Message-ID: <CA+Y+445Jd2vv2N-YRqZ88RU20GmpLQAXJL7GcsRcPuYDPrTByQ@mail.gmail.com> (raw)
In-Reply-To: <87oayl3yvo.fsf@bzg.ath.cx>

[-- 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 --]

  reply	other threads:[~2014-05-26 15:36 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CA+Y+445Jd2vv2N-YRqZ88RU20GmpLQAXJL7GcsRcPuYDPrTByQ@mail.gmail.com \
    --to=nslater@tumbolia.org \
    --cc=bzg@gnu.org \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).