Screw the `y-or-n-p` prompt

I have a script that runs every 45 minutes on a cronjob, which syncs four things:

  • My local ‘vdir’ folders, which is managed by ‘vdirsyncer’

  • My ‘Mates’ index, for contacts from the vdir folder.

  • My BBDB contacts file, via a custom elisp wrapper function I wrote. This uses emacs -batch, as described below.

  • My Org mode calendars / todo files, with org-caldav. Again, via emacs -batch

After a while, it became apparent to me that this script was hanging, at some point during execution.

I ran the script interactively, and it appears that some ‘feature’ causes the org-caldav sync process to stall when it comes to save files - a la, the yes-or-no-p prompt.

I did research into it, and found that it was more than likely a problem with the GNU Emacs file-saving core functions - which I didn’t think needed to be fixed.

So, as part of my dirtest hack yet [citation needed], I decided to merely do something along the lines of this:

yes | emacs --batch --load ~/.emacs.d/init.el --eval "(shymega/org-caldav-sync--batch)"

This hack works a treat! Of course, it’s not a real solution, and I am mildly ashamed of it..