问题
I'm trying to figure out if there is some way to create a dynamic file name for capture in emacs org-mode.
("z" "test" entry (file+headline ***A date specific headline*** "Notes"))
"** %^{prompt}")
Is there some simple way to pass a date and year to the file part, so that I can have a file dynamically created for each month. What I'd like is something like this:
(concat "/home/me/file/report_notes_" (format-time-string "%m_%Y") ".org")
Edit - I've finally got it working, using backquoting:
`(("z" "test" entry (file+headline ,(capture-report-date-file "/path/path/name_")
"Notes")
"** %^{prompt}")))
then writing a function like this:
(defun capture-report-date-file (path)
(concat path (format-time-string "%m_%Y")))
I got to the answer after reading this answer to a similar question.
回答1:
Have a look at "org-daypage": https://github.com/almost/org-daypage
Right now it creates a page for the current day and saves it to a specific directory, maybe you can modify the code according to your needs.
来源:https://stackoverflow.com/questions/8614642/how-to-type-a-dynamic-file-entry-for-org-capture