I am trying to use emacs -batch to create a csv file that shows all the todo items in my org-mode file. It works great on my linux box, but I can't get it to work in OSX.
Here is the command I am using:
emacs -batch -l ~/.emacs org-mode -eval '(org-batch-agenda-csv "t")'
OSX doesn't recognize org-batch-agenda-csv, but it will recognize a non-csv version:
emacs -batch -l ~/.emacs org-mode -eval '(org-batch-agenda "t")'
However, this still doesn't work. It comes back with the following response:
Agenda file ~/projects.org is not in `org-mode'
I think I have narrowed down the root problem. Emacs and emacs as opened by the terminal work differently. Emacs will autorecognize my org files, but if I open them in the terminal, emacs will start in fundamental mode. I think if I could get emacs terminal mode to auto-recognize org-files the problem would go away. Oddly, it doesn't seem to have trouble auto-recognizing other file types. It is almost like it isn't actually reading my .emacs file.
I can't seem to find anything through google. Hopefully I'm not the only person who has this issue.
Appreciate any pointers you can help me with.
-- Russ
Thanks Lindydancer. So for some reason OSX terminal opens up emacs version 22 instead of version 24. The same command works great if it is called as the binary file from Applications file.
/Applications/Emacs.app/Contents/MacOS/Emacs -batch -l ~/.emacs org-mode -eval '(org-batch-agenda "t")'
Thanks for the help!