Gnus development mailing list
 help / color / mirror / Atom feed
* How to avoid loading certain things in batch mode
@ 2009-02-10 16:59 Harry Putnam
  2009-02-11 20:36 ` Reiner Steib
  0 siblings, 1 reply; 3+ messages in thread
From: Harry Putnam @ 2009-02-10 16:59 UTC (permalink / raw)
  To: ding

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.




^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: How to avoid loading certain things in batch mode
  2009-02-10 16:59 How to avoid loading certain things in batch mode Harry Putnam
@ 2009-02-11 20:36 ` Reiner Steib
  2009-02-13 16:37   ` Harry Putnam
  0 siblings, 1 reply; 3+ messages in thread
From: Reiner Steib @ 2009-02-11 20:36 UTC (permalink / raw)
  To: ding

On Tue, Feb 10 2009, Harry Putnam wrote:

> 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.  

We could give more specific help if you posted the code in question.

> 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? 

,----[ <f1> v noninteractive RET ]
| noninteractive is a variable defined in `src/emacs.c'.
| Its value is nil
| 
| Documentation:
| Non-nil means Emacs is running without interactive terminal.
`----

You can use code like...

(unless noninteractive
  ...fancy stuff...)

Bye, Reiner.
-- 
       ,,,
      (o o)
---ooO-(_)-Ooo---  |  PGP key available  |  http://rsteib.home.pages.de/




^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: How to avoid loading certain things in batch mode
  2009-02-11 20:36 ` Reiner Steib
@ 2009-02-13 16:37   ` Harry Putnam
  0 siblings, 0 replies; 3+ messages in thread
From: Harry Putnam @ 2009-02-13 16:37 UTC (permalink / raw)
  To: ding

Reiner Steib <reinersteib+gmane@imap.cc> writes:

> On Tue, Feb 10 2009, Harry Putnam wrote:
>
>> 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.  
>
> We could give more specific help if you posted the code in question.

Well maybe, but I haven't sorted out all the different parts that make
-batch cough.. and any way, what is doing it isn't as important as how
to steer gnus around it when in batch mode.

Thanks for supplying that information in your post

[...]
>
> (unless noninteractive
>   ...fancy stuff...)

Yup that is what I was after.




^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2009-02-13 16:37 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-02-10 16:59 How to avoid loading certain things in batch mode Harry Putnam
2009-02-11 20:36 ` Reiner Steib
2009-02-13 16:37   ` Harry Putnam

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).