diff options
Diffstat (limited to 'lisp/ss-org.el')
| -rw-r--r-- | lisp/ss-org.el | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/lisp/ss-org.el b/lisp/ss-org.el index 6f1ae1b..88590fa 100644 --- a/lisp/ss-org.el +++ b/lisp/ss-org.el @@ -243,6 +243,19 @@ This is for significant navigation points only and clears forward history." (interactive) (find-file (ss-require-existing-file ss-moc-file))) +(defun ss-org-refresh-agenda-files-for-refile (&rest _args) + "Refresh `org-agenda-files' before refile when agenda setup is available." + (when (fboundp 'ss-refresh-org-agenda-files) + (ss-refresh-org-agenda-files))) + +(defun ss-org-configure-refile () + "Configure Org refile to target any heading in `org-agenda-files'." + (setq org-refile-targets '((org-agenda-files :regexp . "^\\*+ ")) + org-refile-use-outline-path 'file + org-outline-path-complete-in-steps nil) + (unless (advice-member-p #'ss-org-refresh-agenda-files-for-refile #'org-refile) + (advice-add 'org-refile :before #'ss-org-refresh-agenda-files-for-refile))) + (defun ss-org-setup () "Initialize base Org configuration." (use-package org @@ -259,6 +272,7 @@ This is for significant navigation points only and clears forward history." "DONE(d)" "CANCELLED(x@)")) org-log-done 'note org-log-into-drawer t) + (ss-org-configure-refile) (add-hook 'org-mode-hook (lambda () (setq-local org-hide-emphasis-markers t) |
