Reputation: 1
I would like to export the agenda view to separate file with a unique name based on the current date. Based on this example code:
(setq org-agenda-custom-commands
'(("X" agenda "" nil ("agenda.ps")))
)
The last argument is the file name so I thought I can put the output of the concat
function, e.g.:
(setq org-agenda-custom-commands
'(("X" agenda "" nil (concat (format-time-string "%Y-%m-%d") "-agenda.html")))
)
Unfortunately, this approach fails since the interpreter takes the concat
literally, and a string (expected data type) is not generated. I’m not very familiar with LISP, so any help is greatly appreciated.
Upvotes: 0
Views: 213
Reputation: 953
First of all the last argument is not a filename but rather a list of names, so you must add some extra parentheses.
As you already noted, because of the quote the list is not evaluated, and it's fine since you don't want to evaluate it, except the last element (concat
function). To do so you can use backquote:
(setq org-agenda-custom-commands
`(("X" agenda "" nil (,(concat (format-time-string "%Y-%m-%d") "-agenda.html"))))
)
As a side note, I'm not a specialist of the org-mode
and I'm just answering the question you asked, but I have a feeling that it is possible to achieve your goal in a more simple way. Not sure how, but maybe you can dig in the documentation of org-mode
and probably you'll find something interesting.
Upvotes: 1