[Top][All Lists]

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

Re: [Orgmode] Clean Org Clock with step

From: Bastien
Subject: Re: [Orgmode] Clean Org Clock with step
Date: Sat, 25 Jul 2009 20:37:43 +0800
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (gnu/linux)

meingbg <address@hidden> writes:

> Just looking at the output, maybe this could be implemented as a regexp 
> replace
> on the entire block performed after putting together the tables? Just thinking
> it might save you some headache, if you don't think it's too ugly of a hack.

Well, it *is* to ugly of a hack, but here it is:

(defun my-org-remove-empty-daily-clock-report ()
  "Remove empty daily clock reports"
  (while (re-search-forward "^Daily report:.*$" nil t)
    (let ((beg0 (match-beginning 0))
          (beg1 (1+ (match-end 0)))
          (end (save-excursion 
                 (re-search-forward "^$\\|^#\\+END.*" nil t)
                 (match-beginning 0))))
      (when (re-search-forward "Total time.*0:00" end t)
        (delete-region beg0 end)
        (delete-char -1)))))

It will definitely not make its way thru Org, we need a mechanism that
prevents the display of empty report instead.

> And while I'm at it - my employer requires me to report not only what I'm 
> doing
> and how long it takes, but also when I'm doing it. I assume most people
> wouldn't benefit from a feature like this, and that there are many other 
> things
> on the wish list with higher priority, so I'm just asking if someone could
> point out an API guide or something like that, it would be wonderful.

That makes sense...


reply via email to

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