TRS-80 <lists.trs...@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

Reply via email to