emacs 2025-10-16

I don't believe either option in 1. works as desired. SCHEDULED creates the desired new timestamp for the next day, but resets the state to TODO. org-todo-repeat-to-state allows the state to get to DONE, but it seems regardless of SCHEDULED it won't automatically return to TODO — I don't believe there's any background process that runs at 6am. So I think I'll need to investigate org-recur org "habits" if I want to be able to both A. set it to DONE and B. have it revert to TODO later

For 2. I ended up popping from the kill ring instead, though you are absolutely right that advice seems like the best option here. Thank you!

1. use .+1d repeater:

** TODO Morning routine
   SCHEDULED: <2024-01-01 Mon 06:00 .+1d>
or, (setq org-todo-repeat-to-state "DONE") 2. advise org-capture-kill - looks like it calls org-capture-finalize, which calls kill-region, make it use delete-region instead

✍️ 1

This one might be tricky, you may have to use cl-letf in your advising function:

(defun my-advising-fn (orig-fun & rest args
   (cl-letf (((symbol-function 'kill-region)
             (lambda (beg end &optional _)
               (delete-region beg end))))
    (apply orig-fun args))


(advice-add 'org-capture-kill :around #'my-advising-fn)
I never can remember the differences btw these three, even though I open this SO post every few months: https://stackoverflow.com/questions/39550578/in-emacs-what-is-the-difference-between-cl-flet-and-cl-letf

👀 1