2

I have a small script that runs the following command to export my org-mode agendas automatically:

emacs -batch -l ~/.emacs.d/init.el -eval '(org-batch-store-agenda-views)'

Occasionally, a required agenda file is missing or unavailable, which causes emacs to pause at the command prompt with something like the following:

Non-existent agenda file ~/gtd/missing.org.  [R]emove from list or [A]bort?

Emacs will then hang until I kill it using Ctrl+C.

Is there a way to get emacs to automatically abort in batch mode if user input is not available? Or is it possible to set a timeout on the running of emacs in batch mode, so that it automatically exits after a certain period of time.

(I tried using the timeout shell command — e.g. timeout 10s emacs -batch ... — but that doesn't work either.)

FixMaker
  • 121
  • 2
  • 1
    You should report this to the [Org mode mailing list](https://orgmode.org/community.html) as a bug: it should not be the case that a batch function calls a function (`org-check-agenda-file`) that stops and asks the user what to do. – NickD Nov 06 '20 at 16:35

0 Answers0