From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/68278 Path: news.gmane.org!not-for-mail From: Harry Putnam Newsgroups: gmane.emacs.gnus.general Subject: How to avoid loading certain things in batch mode Date: Tue, 10 Feb 2009 10:59:02 -0600 Organization: Still searching... Message-ID: <877i3yfctl.fsf@newsguy.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1234285190 13959 80.91.229.12 (10 Feb 2009 16:59:50 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 10 Feb 2009 16:59:50 +0000 (UTC) To: ding@gnus.org Original-X-From: ding-owner+M16718@lists.math.uh.edu Tue Feb 10 18:01:05 2009 Return-path: Envelope-to: ding-account@gmane.org Original-Received: from util0.math.uh.edu ([129.7.128.18]) by lo.gmane.org with esmtp (Exim 4.50) id 1LWvyc-0004ZD-2U for ding-account@gmane.org; Tue, 10 Feb 2009 18:00:50 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.math.uh.edu) by util0.math.uh.edu with smtp (Exim 4.63) (envelope-from ) id 1LWvxH-0002se-H1; Tue, 10 Feb 2009 10:59:27 -0600 Original-Received: from mx2.math.uh.edu ([129.7.128.33]) by util0.math.uh.edu with esmtps (TLSv1:AES256-SHA:256) (Exim 4.63) (envelope-from ) id 1LWvxF-0002rM-Uz for ding@lists.math.uh.edu; Tue, 10 Feb 2009 10:59:25 -0600 Original-Received: from quimby.gnus.org ([80.91.231.51]) by mx2.math.uh.edu with esmtp (Exim 4.69) (envelope-from ) id 1LWvxC-00048D-WF for ding@lists.math.uh.edu; Tue, 10 Feb 2009 10:59:25 -0600 Original-Received: from main.gmane.org ([80.91.229.2] helo=ciao.gmane.org) by quimby.gnus.org with esmtp (Exim 3.36 #1 (Debian)) id 1LWvxX-0002E6-00 for ; Tue, 10 Feb 2009 17:59:43 +0100 Original-Received: from list by ciao.gmane.org with local (Exim 4.43) id 1LWvxD-0005Xd-3w for ding@gnus.org; Tue, 10 Feb 2009 16:59:23 +0000 Original-Received: from c-98-215-178-6.hsd1.in.comcast.net ([98.215.178.6]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 10 Feb 2009 16:59:23 +0000 Original-Received: from reader by c-98-215-178-6.hsd1.in.comcast.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 10 Feb 2009 16:59:23 +0000 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 72 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: c-98-215-178-6.hsd1.in.comcast.net User-Agent: Gnus/5.110011 (No Gnus v0.11) Emacs/23.0.60 (gnu/linux) Cancel-Lock: sha1:1W/3OrrtbIvb+AHBxeIf2FG3eA0= X-Spam-Score: -3.6 (---) List-ID: Precedence: bulk Xref: news.gmane.org gmane.emacs.gnus.general:68278 Archived-At: 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.