+++ /dev/null
-;;; re-org-defuns.el -*- lexical-binding: t; -*-
-;; This file is not part of GNU Emacs
-
-;;; Code:
-
-(defun re/org-auto-generate-ids-in-file ()
- "Add ID properties to all headlines in the current
- file which do not already have one."
- (interactive)
- (org-map-entries 'org-id-get-create))
-
-(defun re/org-save-all ()
- "Save all `org-agenda-files' without user confirmation."
- (interactive)
- (message "Saving all org-agenda-files buffers...")
- (save-some-buffers t
- (lambda ()
- (when (member (buffer-file-name) org-agenda-files) t)))
- (message "Saving all org-agenda-files buffers... done"))
-
-(defun re/org-archive-all ()
- "Archive all tasks marked `DONE' in agenda files"
- (interactive)
- (message "Archiving all completed tasks in org-agenda-files...")
- (org-map-entries (lambda ()
- (org-archive-subtree)
- (setq org-map-continue-from (org-element-property
- :begin
- (org-element-at-point))))
- "/DONE"
- 'agenda)
- (message "Archiving all completed tasks in org-agenda-files... done"))
-
-(provide 're-org-defuns)
-;;; re-org-defuns.el ends here
org-attach-id-to-path-function-list '(org-attach-id-ts-folder-format
org-attach-id-uuid-folder-format))
+(defun re/org-auto-generate-ids-in-file ()
+ "Add ID properties to all headlines in the current
+ file which do not already have one."
+ (interactive)
+ (org-map-entries 'org-id-get-create))
+
+(defun re/org-save-all ()
+ "Save all `org-agenda-files' without user confirmation."
+ (interactive)
+ (message "Saving all org-agenda-files buffers...")
+ (save-some-buffers t
+ (lambda ()
+ (when (member (buffer-file-name) org-agenda-files) t)))
+ (message "Saving all org-agenda-files buffers... done"))
+
(advice-add 'org-refile :after (lambda (&rest _) (re/org-save-all)))
\f
;; Archiving (use re/org-archive-all periodically)
+(defun re/org-archive-all ()
+ "Archive all tasks marked `DONE' in agenda files"
+ (interactive)
+ (message "Archiving all completed tasks in org-agenda-files...")
+ (org-map-entries (lambda ()
+ (org-archive-subtree)
+ (setq org-map-continue-from (org-element-property
+ :begin
+ (org-element-at-point))))
+ "/DONE"
+ 'agenda)
+ (message "Archiving all completed tasks in org-agenda-files... done"))
+
(setq org-archive-location (concat "~/org/old.org_keep::datetree/")
org-agenda-text-search-extra-files '(agenda-archives))