2014-02-27 100 views
1

我是一個完全的emacs/lisp新手,只是試圖導出我的待辦事項到ics。在我的init文件中,我有(setq org-calendar-icalendar-todo t),並且當我用C-c C-e I導出emacs時,我確實得到了在.ics文件中導出的todos。如何在批處理模式下在emacs中設置變量

但是我想在批處理文件中做到這一點。我已經運行了emacs --batch -eval「(org-export-icalendar-all-agenda-files)」,但它似乎並沒有在init文件中找到org-calendar-icalendar-todo變量,輸出文件。

我該如何在命令行上做到這一點?

+0

難道你不能只添加'setq' sexp到你的'-eval'嗎?即,'emacs --batch -eval'(progn(setq org-calendar-icalendar-todo t)(org-export-icalendar-all-agenda-files))「'(或其他順序,如果合適的話 - - 我不使用組織)。 – Drew

+0

可能在批處理模式下加載舊版本的組織。 – Dror

回答

1

以最小的運動,你可以這樣做:

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

如果加載整個配置是你太多,只需要創建一個單獨的文件 ~/foo.el與您首選的配置,並在 命令~/foo.el替換~/.emacs以上。

相關問題