I have org-log-refile set to 'note which works great when moving tasks around. However, when I'm capturing, I'd like this behavior disabled.

I tried the following with org-capture-mode-hook, org-capture-after-finalize-hook, org-capture-before-finalize-hook, and org-capture-prepare-finalize-hook to no avail.

;; Record time and note when a task is refiled
(setq org-log-refile 'note)
;; Disable when refiled from org-capture
(add-hook 'org-capture-mode-hook (lambda ()
                                   (setq-local org-log-refile nil)))

The following seems to work as intended:

;; Disable when refiled from org-capture
(define-advice org-capture-refile (:around (oldfunc &rest args) org-disable-log-refile)
  "Set `org-log-refile' to nil while capturing."
  (let ((org-log-refile nil))
    (apply oldfunc args)))
  • That is indeed the best solution IMO. – NickD Apr 15 '18 at 4:01

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.