1
votes

I am a total emacs/lisp newbie, just trying to export my todo's to ics. In my init file I have (setq org-calendar-icalendar-todo t), and when I export within emacs with C-c C-e I, then I do get the todos exported in the .ics files.

However I want to do this in a batch file. I have run emacs --batch -eval "(org-export-icalendar-all-agenda-files)", but it doesn't seem to pick up the org-calendar-icalendar-todo variable in the init file or produce the output files.

How can I make this happen on the command line?

1
Can't you just add that setq sexp to your -eval? I.e., emacs --batch -eval "(progn (setq org-calendar-icalendar-todo t) (org-export-icalendar-all-agenda-files))" (or the other order, if that is appropriate -- I do not use Org). - Drew
Probably with the batch mode you load an older version of org. - Dror

1 Answers

1
votes

With minimal movements you can do this:

emacs --batch -l ~/.emacs --eval "(org-export-icalendar-all-agenda-files)"

If loading the whole config is too much for you, just create a separate file ~/foo.el with your preferred config and replace ~/.emacs with ~/foo.el in the command above.