* Remove old clock entries
@ 2021-03-01 6:20 Julien Cubizolles
2021-03-03 15:22 ` TRS-80
0 siblings, 1 reply; 3+ messages in thread
From: Julien Cubizolles @ 2021-03-01 6:20 UTC (permalink / raw)
To: emacs-orgmode
I'm clocking the time spent on daily tasks like email and for that I
have a "Daily Routine" TODO entry. Clocking in this task adds a new
clock line everyday, leading to a very populated CLOCK drawer. I'd like
to limit its size by either a maximum number of clock entries by
removing the older ones or better, removing the entries older than some
date. Is there some variable to that effect ?
--
Julien Cubizolles
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Remove old clock entries
2021-03-01 6:20 Remove old clock entries Julien Cubizolles
@ 2021-03-03 15:22 ` TRS-80
2021-09-05 13:49 ` Ihor Radchenko
0 siblings, 1 reply; 3+ messages in thread
From: TRS-80 @ 2021-03-03 15:22 UTC (permalink / raw)
To: emacs-orgmode
On 2021-03-01 01:20, Julien Cubizolles wrote:
> I'm clocking the time spent on daily tasks like email and for that I
> have a "Daily Routine" TODO entry. Clocking in this task adds a new
> clock line everyday, leading to a very populated CLOCK drawer. I'd
> like to limit its size by either a maximum number of clock entries
> by removing the older ones or better, removing the entries older
> than some date. Is there some variable to that effect ?
Not that I am aware of (anyone is welcome to correct me if I am
wrong).
Because I have similar problem, I have been thinking about this for a
while. I am no longer clocking, but in my case I have a lot of state
change logging. But these are similar.
I was thinking about incorporating some handling of these entries into
a custom archival function. Which would also handle some other things
at the same time. But so far, it's just some notes and thoughts about
desired functionality and how it might work. And I keep monitoring
the mailing list for some better ideas. :)
Cheers,
TRS-80
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Remove old clock entries
2021-03-03 15:22 ` TRS-80
@ 2021-09-05 13:49 ` Ihor Radchenko
0 siblings, 0 replies; 3+ messages in thread
From: Ihor Radchenko @ 2021-09-05 13:49 UTC (permalink / raw)
To: TRS-80; +Cc: emacs-orgmode
TRS-80 <lists.trs-80@isnotmyreal.name> writes:
> I was thinking about incorporating some handling of these entries into
> a custom archival function. Which would also handle some other things
> at the same time. But so far, it's just some notes and thoughts about
> desired functionality and how it might work. And I keep monitoring
> the mailing list for some better ideas. :)
FYI:
Credit: https://www.reddit.com/r/orgmode/comments/dg43hs/can_i_archive_a_property_drawer/f3frk2n/
#+begin_src emacs-lisp
(defun my/org-archive-delete-logbook ()
(save-excursion
(org-end-of-meta-data)
(let ((elm (org-element-at-point)))
(when (and
(equal (org-element-type elm) 'drawer)
(equal (org-element-property :drawer-name elm) "LOGBOOK"))
(delete-region (org-element-property :begin elm)
(org-element-property :end elm))))))
(defun my/org-archive-without-delete ()
(cl-letf (((symbol-function 'org-cut-subtree) (lambda () nil)))
(org-archive-subtree)))
(defun my/org-archive-logbook ()
(interactive)
(my/org-archive-without-delete)
(my/org-archive-delete-logbook))
#+end_src
Best,
Ihor
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2021-09-05 13:49 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-03-01 6:20 Remove old clock entries Julien Cubizolles
2021-03-03 15:22 ` TRS-80
2021-09-05 13:49 ` Ihor Radchenko
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).