From: Ihor Radchenko <yantar92@gmail.com>
To: TRS-80 <lists.trs-80@isnotmyreal.name>
Cc: emacs-orgmode@gnu.org
Subject: Re: Remove old clock entries
Date: Sun, 05 Sep 2021 21:49:10 +0800 [thread overview]
Message-ID: <874kazw2sp.fsf@localhost> (raw)
In-Reply-To: <61be8a8c827b68af899b45b247bfbf9b@isnotmyreal.name>
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
prev parent reply other threads:[~2021-09-05 13:49 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
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 [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=874kazw2sp.fsf@localhost \
--to=yantar92@gmail.com \
--cc=emacs-orgmode@gnu.org \
--cc=lists.trs-80@isnotmyreal.name \
/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).