diff --git a/modules/lang/org/autoload/org-capture.el b/modules/lang/org/autoload/org-capture.el index 7b273c231..7ff91baea 100644 --- a/modules/lang/org/autoload/org-capture.el +++ b/modules/lang/org/autoload/org-capture.el @@ -23,7 +23,8 @@ ;;;###autoload (defun +org-capture-cleanup-frame-h () "Closes the org-capture frame once done adding an entry." - (when (+org-capture-frame-p) + (when (and (+org-capture-frame-p) + (not org-capture-is-refiling)) (delete-frame nil t))) ;;;###autoload diff --git a/modules/lang/org/config.el b/modules/lang/org/config.el index e097d767f..59edc5fd0 100644 --- a/modules/lang/org/config.el +++ b/modules/lang/org/config.el @@ -353,6 +353,10 @@ relative to `org-directory', unless it is an absolute path." (defun +org-init-capture-frame-h () (add-hook 'org-capture-after-finalize-hook #'+org-capture-cleanup-frame-h) + (defadvice! +org-capture-refile-cleanup-frame (&rest _) + :after #'org-capture-refile + (+org-capture-cleanup-frame-h)) + (when (featurep! :ui doom-dashboard) (add-hook '+doom-dashboard-inhibit-functions #'+org-capture-frame-p)))