*** 4. always add SCHEDULED when in journal and project files :PROPERTIES: :CREATED: [2023-11-17 Fri 19:32] :CUSTOM_ID: emacsconf_61 :END: :BACKLINKS: [2024-01-12 Fri 09:20] <- [[file:~/org/1activity.org::#1activity_3774][org agenda cleanup/puesta a punto, y vaciado de notas de móvil]] :END: #+name: created on [2023-11-17 Fri 19:33:09] #+begin_src emacs-lisp (defun my/org-heading-insert-scheduled () (if (or (and (string-match-p my/diary-file (buffer-name)) (= (org-current-level) 4)) (and (string-match-p my/board-file (buffer-name)) (= (org-current-level) 4)) (and (string-match-p my/proj-file (buffer-name)) ;; projects are 3-level (tasks start at 5-level, we don't care on its children) (> (org-current-level) 4)) (and (string-match-p my/proj-candidates-file (buffer-name)) ;; projects are 4-level (tasks start at 3-level, we don't care on its children) (> (org-current-level) 3)) ) (save-excursion ;; src https://emacs.stackexchange.com/questions/72147/org-mode-adding-creation-date-property-upon-heading-creation ;;(org-back-to-heading) (org-schedule nil (format-time-string "[%Y-%m-%d %a]" nil))))) (add-hook 'org-insert-heading-hook 'my/org-heading-insert-scheduled 'append) #+end_src