When I try to export my agenda to ics (ical) from the command line, I use the following command: emacs --batch --user $USER --eval "(progn (org-agenda-list nil nil 'year) (org-icalendar-combine-agenda-files))"
But this fails because, it says No catch for tag: --cl-block-nil--, org-agenda-date-weekend and it fails to produce an ics file. However, when I'm actually executing the year-view and `org-icalendar-combine-agenda-files` in my running session of emacs, it works fine. I used to have that problem but someone here helped me solve it by adding '(require 'cl-lib) to one of my init files. But why isn't this working to prevent the cl-block error when I run the batch mode? Ideas?