From: Ihor Radchenko <yantar92@gmail.com>
To: Samuel Wales <samologist@gmail.com>
Cc: "emacs-orgmode@gnu.org" <emacs-orgmode@gnu.org>, fr_ml@t-online.de
Subject: Re: [BUG] LOGBOOK makes property search (in org-agenda) too slow(?)
Date: Sun, 13 Mar 2022 22:07:10 +0800 [thread overview]
Message-ID: <87v8wic5f5.fsf@localhost> (raw)
In-Reply-To: <CAJcAo8soTb+wQVSt+4s9hY_2VOHfPUDqdSZYG-nEzc=hNN3v5g@mail.gmail.com>
Samuel Wales <samologist@gmail.com> writes:
> are there intereim workarounds like semi-automatically moving large
> logbook entries, or entire logbooks, to a task that says "was logbook
> for ..." and then archiving that task? or automatically archiving old
> logbook entries?
My largest logbook contains ~2.5k clock records with no obvious impact
on performance (on main). However, when I was using older Org versions,
I used the following helper functions:
Credit: https://www.reddit.com/r/orgmode/comments/dg43hs/can_i_archive_a_property_drawer/f3frk2n/
Caveat: you might get duplicate IDs using the functions below. I just
changed the archived ID manually in the past.
#+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
prev parent reply other threads:[~2022-03-13 14:08 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-03-12 8:12 [BUG] LOGBOOK makes property search (in org-agenda) too slow(?) fr_ml
2022-03-12 9:24 ` Milan Zamazal
2022-03-12 12:33 ` Ihor Radchenko
2022-03-12 23:29 ` Samuel Wales
2022-03-13 14:07 ` Ihor Radchenko [this message]
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=87v8wic5f5.fsf@localhost \
--to=yantar92@gmail.com \
--cc=emacs-orgmode@gnu.org \
--cc=fr_ml@t-online.de \
--cc=samologist@gmail.com \
/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).