emacsorg-mode

Disable org-add-log-note on change state


I'm trying to create a function that changes a dated task to undated, removes the deadline, and refiles it -- without ever seeing the pop-up window for taking notes.

I've tried everything I can think of, short of hacking the source, to eliminate the *Org Note* window when changing the state with the following function. I've tried all of the following: kill-buffer; fmakunbound; remove post-command-hook; setq nil every function with org-add-log...; delete-window; org-kill-note-or-show-branches; sit-for .... before some of the previous ideas.

Can anyone think of a way to prevent the pop-up window from happening?

(defun someday ()
    (interactive)
        (org-todo "Someday")
        (org-priority ?D)
        (org-deadline 'remove)
        (setq org-archive-save-context-info nil)
        (setq org-archive-location "/Users/HOME/.0.data/*TODO*::* UNDATED")
        (org-archive-subtree) )

Solution

  • Try wrapping everything in your function (after the interactive call) with

    (flet ((org-add-log-setup (a b c d e) nil))
        Your code
        ....
    )
    

    It locally overrides the add log function to do nothing. (I'm writing this on a cellphone, so let me know if it doesn't work=).