I coded a function that accesses lines in a folded drawer:
(defun org-try-merging-last-clock-out () "Try to merge the latest clock-out, and catch the error if the discrepancy is not zero." (save-restriction (save-excursion (org-clock-goto) (search-forward org-last-inserted-timestamp) (condition-case nil (org-clock-merge t) (error)))))
org-clock-merge is an interactive function that I defined in this other thread that merges two clock lines. It is long and I can copy it here if needed.
My clock lines are in a
LOGBOOK drawer. The headline initially looks like this:
** DONE Some task...
After calling the function programmatically through the
org-clock-out-hook, it looks like this:
** DONE Some task CLOSED: [2019-09-24 Tue 15:56] SCHEDULED: <2019-10-07 Mon> :PROPERTIES: :CREATED: [2019-09-23 Mon] :END: :LOGBOOK:...
I confirm that my
org-clock-merge function ran and merged the clock stamps. I would like the headline appearance not to change after running the command.
Does a function similar to
save-restriction for narrowing exist for org-mode cycling?