Harry Putnam writes: > I want to run batch commands but not read my standard .emacs .gnus > site-start.el. I've learned from the past that things in any init > files that write to standard out like (message) can cause I/O errors. > But I like having some of those in there... so: > > I compile an init file on the fly for gnus (or emacs) to read. But > how can I aim gnus at only that file? Even with the kind help I've gotten on this, I'm still having problems with it. I think the general mechanism is sound but have trouble figuring out why it fails, or partially fails. The init file created is attached as text/plain at the end so you should be able to inline it with a . The full command line: emacs -q -no-site-file -batch \ -eval '(setq gnus-init-file "/tmp/my_gnus_init.el")'\ -f gnus-agent-batch If I run this as is, I get these kind of errors: $ emacs -q -no-site-file -batch -eval '(setq gnus-init-file "/tmp/my_gnus_init.el")' -f gnus-agent-batch Reading /home/reader/.newsrc-enews.newsguy.com.eld... Reading active file from enews.newsguy.com via nntp... Reading active file via nnml... Opening nnml server... nnml: Reading incoming mail from directory... Wrote /home/reader/Mail/bperl/12471 1)**Mail source error ((void-function nnheader-parse-naked-head)). Continue? (yes or no) yes nnml: Reading incoming mail from file... Processing mail from ~/.emacs-mail-crash-box... Creating mail directory /home/reader/Mail/mail/misc/ Wrote /home/reader/Mail/mail/misc/8 2)**Symbol's function definition is void: nnheader-parse-naked-head [Errors marked by `N)**' Two things of note here 1) I never had a mail box named `/home/reader/Mail/mail/misc/' before and there is nothing in the lone init file to suggest it. 2) Even if I delete .emacs-mail-crash-box. It will give the same message. So changing the command line to make sure all gnusy like stuff is loaded by saying -f gnus before -f gnus-agent-batch: emacs -q -no-site-file -batch \ -eval '(setq gnus-init-file "/tmp/my_gnus_init.el")' -f gnus -f gnus-agent-batch And deleting .emacs-mail-crash-box, removing Mail/mail/misc and removing the reference to it in .newsrc.eld. Produces a different kind of error: (Also note that the init file can be evalled with no errors) $ emacs -q -no-site-file -batch \ > -eval '(setq gnus-init-file "/tmp/my_gnus_init.el")' \ > -f gnus -f gnus-agent-batch Reading /home/reader/.newsrc-enews.newsguy.com.eld... Reading active file from enews.newsguy.com via nntp... Generating the cache active file... Generating the cache active file...done No new newsgroups Checking new news... Opening nntp server on nntp.perl.org... Opening nndir server on /anex/mail.bk... Opening nndir server on /home/reader/Mail/prinb... Opening nndraft server... Opening nntp server on news.gmane.org... Opening nntp server on news.easysw.com... Opening nntp server on news.gmane.org... Opening nntp server on news.west.cox.net... Opening nntp server on news.gmane.org... Opening nntp server on news.west.cox.net... Opening nndir server on /tmp/mns... Opening nndir server on /tmp/mns1... Checking new news...done Opening nntp server on enews.newsguy.com... Reading active file from enews.newsguy.com via nntp... Checking new news... Opening nntp server on nntp.perl.org... Opening nndir server on /anex/mail.bk... Opening nndir server on /home/reader/Mail/prinb... Opening nntp server on news.gmane.org... Opening nntp server on news.easysw.com... Opening nntp server on news.gmane.org... Opening nntp server on news.west.cox.net... Opening nntp server on news.gmane.org... Opening nntp server on news.west.cox.net... Opening nndir server on /tmp/mns... Opening nndir server on /tmp/mns1... Checking new news...done Error ((wrong-type-argument number-or-marker-p nil)). Continue? (y or n) y Error ((wrong-type-argument number-or-marker-p nil)). Continue? (y or n) Please answer y or n. Error ((wrong-type-argument number-or-marker-p nil)). Continue? (y or n) y Finished fetching articles into the Gnus agent