Gnus development mailing list
 help / color / mirror / Atom feed
From: Harry Putnam <reader@newsguy.com>
To: ding@gnus.org
Subject: How to avoid loading certain things in batch mode
Date: Tue, 10 Feb 2009 10:59:02 -0600	[thread overview]
Message-ID: <877i3yfctl.fsf@newsguy.com> (raw)

I'm trying to setup a user (gnusu) on my home machine that does
nothing but run gnus and download certain groups as new posts arrive.
I'll also want to read news there and possibly post or reply.
I won't be doing mail to speak of.  That will remain at my normal
users gnus setup.

I know how to do the part about downloading certain groups.. I do it
by creating a category of true and adding whatever groups to it.

The point of all this is to remove the massive news directories that
will accumulate (and I want them to accumulate) from my normal `home'
partition so that backups are not bogged down with it or tricky
scripts to avoid backing up certain things are not required.

I probably won't bother to backup those news directories at all in fact.

I want to run gnus in batch mode as described in the manual at:

(info "(gnus)Batching Agents")

 [...]

 #!/bin/sh
  emacs -batch -l ~/.emacs -l ~/.gnus.el -f gnus-agent-batch >\
    /dev/null 2>&1

It appears there is code in various of my init files that are ok when
running a live session but -batch mode balks at them.

For example:
  emacs -batch -l ~/.emacs -l ~/.gnus -f gnus-agent-batch
   [...]
   Loading /home/gnusu/.emacs-dir/sub_gnus.el...
   Symbol's value as variable is void: gnus-summary-mode-map

That file (sub_gnus.el) loads fine in a live session but balks when gnus
is run in batch mode.  I think this file is probably not really needed
since it introduces certain handlers and few other things not really
required for batch mode, but there are others that cause problems too.

I wondered if I might be able to construct a conditional that would
know gnus is being run in batch mode.. and to skip certain code that
way? 

Another way:
I thought maybe to run 

  `emacs -Q -batch [then load whatever]'

I haven't tried that so not even sure it would work but even if it did
that method would need a whole second set of `.emacs and .gnus' or
whatever other stuff

Also I'm not sure what would happen in a live session if a cron
inspired `batch' run happened while gnus was live.  How to update the
record keeping so the live session knows about it.

Another thought might be that I don't really need much from any of
my init files...for a batch run... whose purpose is really only to
download new posts, and update whatever record keeping gnus does in
that circumstance. Maybe I could create a barebones init file just for
batch runs that does that.

Still the problem of integrating the batch runs into a possible live
session would remain.

I have done something like the above description some time in the
misty past but don't remember now how or what I did. I do remember
getting some code from Lars for the setup that integrated the batch
runs with live gnus, but have lost track of it too.

Any thoughts on the subject would be welcome.




             reply	other threads:[~2009-02-10 16:59 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-02-10 16:59 Harry Putnam [this message]
2009-02-11 20:36 ` Reiner Steib
2009-02-13 16:37   ` Harry Putnam

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=877i3yfctl.fsf@newsguy.com \
    --to=reader@newsguy.com \
    --cc=ding@gnus.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).