How to enter dynamic file entry for org capture

I am trying to figure out if there is a way to create a dynamic filename for capture in org-mode emacs.

("z" "test" entry (file+headline ***A date specific headline*** "Notes")) "** %^{prompt}") 

Is there an easy way to pass the date and year of the file part so that I can create a file dynamically created for each month. I would like something like this:

 (concat "/home/me/file/report_notes_" (format-time-string "%m_%Y") ".org") 

Edit - I finally got it working using backquoting:

 `(("z" "test" entry (file+headline ,(capture-report-date-file "/path/path/name_") "Notes") "** %^{prompt}"))) 

then writing this function:

 (defun capture-report-date-file (path) (concat path (format-time-string "%m_%Y"))) 

I got an answer after reading this answer to a similar question.

+1
source share
1 answer

Take a look at the "org-daypage": https://github.com/almost/org-daypage

Now he creates a page for the current day and saves it in a specific directory, perhaps you can change the code to suit your needs.

+3
source

Source: https://habr.com/ru/post/922585/


All Articles