Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

can i carry over under a specific heading? #449

Open
Aneeqasif opened this issue Nov 13, 2024 · 1 comment
Open

can i carry over under a specific heading? #449

Aneeqasif opened this issue Nov 13, 2024 · 1 comment

Comments

@Aneeqasif
Copy link

Is your feature request related to a problem? Please describe.
No, i just need some elisp help

Describe the solution you'd like
carry-over but put the todos under a specified heading (assume it exist,create if donot )

Describe alternatives you've considered
I think this may not be relevant to add in the project so if some one help me to make this elisp snippet is more then enough. i have adhd and i initiate my journal using capture template at start of the day this template is kind of a fill-able form that help me stay on line , when carry over happens it puts the yesterdays todos on very end of the file while my todos lives in middle of the form. so all i want is to put the carried over tasks under the relevant headline of my template.

thanks

@Aneeqasif
Copy link
Author

for reference here is my config
one thing that need to be noticed here is carry over is happening before the the template insertion but i think this can be metigated by setting :after-finalize hook key in capture template to org-journal--carryover but again the main problem is still same i-e move carry over items under a specific heading

(defun org-journal-find-location ()
  ;; Open today's journal, but specify a non-nil prefix argument in order to
  ;; inhibit inserting the heading; org-capture will insert the heading.
  (org-journal-new-entry t)
  (unless (eq org-journal-file-type 'daily)
    (org-narrow-to-subtree))
  (goto-char (point-max)))


(defun org-journal-date-location (&optional scheduled-time)
  (let ((scheduled-time (or scheduled-time (org-read-date nil nil nil "Date:"))))
    (setq org-journal--date-location-scheduled-time scheduled-time)
    (org-journal-new-entry t (org-time-string-to-time scheduled-time))
    (unless (eq org-journal-file-type 'daily)
      (org-narrow-to-subtree))
    (goto-char (point-max))))






                      ("j" " Journal")
                      ("ji" "Journal init" plain
                       (function org-journal-find-location)
                       (file ,(concat doom-user-dir "capture-templates/new-journal-initiate.orgcaptmpl"))
                       :jump-to-captured t
                       :immediate-finish t
                       :prepend t
                       )
                      
                      ("jc" "Journal create todo" entry
                       (file+headline (lambda ()(org-journal--get-entry-path (current-time))) "Work plan")
                       "* TODO %?"
                       :unnarrowed t
                       :empty-lines-after 3)
                      
                      ("jd" "Journal on date" plain
                       (function org-journal-date-location)
                       "** TODO %?\n <%(princ org-journal--date-location-scheduled-time)>\n"
                       :jump-to-captured nil
                       :empty-lines-before 2)
                      
                      ("jn" "Journal Night entry" plain
                       (file+headline (lambda ()(org-journal--get-entry-path (current-time))) "Night")
                       (file ,(concat doom-user-dir "capture-templates/new-journal-night.orgcaptmpl"))
                       :empty-lines-after 2
                       :jump-to-captured t
                       )

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant