* How can I accomplish this: Run unplugged and do everthing in batch mode.
@ 2003-07-02 19:18 Harry Putnam
0 siblings, 0 replies; only message in thread
From: Harry Putnam @ 2003-07-02 19:18 UTC (permalink / raw)
I'd like to just run unplugged all the time. Relying on batch fetches
to keep things up to date. I guess the problem is how to update the
offline gnus from stuff collected by online batch jobs.
I have code that lars posted long ago. It may be dated by now but
still looks pretty similar to gnus-batch. I've lost track of how
much I may have butched it up. And no longer have Lars post. It was
several years ago (on ding),
I'm running a batch command that loads two things. A my_gnus.el
generated by scripting that scans .emacs .gnus .site-start.el for
lines with the key symbol ;;;batch following. So as to avoid
unecessary stuff.
It all happens from a perl script that runs emacs like:
emacs -q -no-site-file -batch -l $my_gnus_el -l $my_batch_el \
-f hp-fetch-news
$my_gnus_el is loaded in emacs because it redirects gnus to use
$my_gnus_el as init file. And points to the right directory for
gnus/lisp so I get my cvs version. Then $my_batch_el contains the
function hp-fetch-news. After gnus libraries are loaded. (Shown
below after $my_gnus_el)
The last item in $my_batch_el (shown at the end) `(gnus-group-quit)'
is documented as closing out without saving anything. I wondered if
it should be `gnus-group-exit'.
Also confused about this from $my_batch_el:
;; The let below might load ~/.gnus if "" trying nil
;;(let ((init-file-user "")
(let ((init-file-user nil)
(gnus-always-read-dribble-file t)
Lars original formula used init-file-user "" But I don't want to
load .gnus so thought maybe I should set that nil.
Finally, in the running unplugged gnus I run a function that is
supposed to refresh it. pgnus-unplugged. That is loaded on startup.
(defun pgnus-unplugged ()
(interactive)
(setq gnus-plugged nil)
(gnus))
(setq gnus-read-active-file t)
[aside
Sorry about all the data, I tried to organize it so it would come
after any discriptions and be a little easier to plow thru.]
Pretty sure the above way was what Lars had. So figured it probably
needs to be there. `gnus-group-exit' is suppose to save stuff on the
way out.
I can't really tell for sure if this is working, but I'm starting to
see those `undownloaded' marked articles in some of my agentized
groups. Theoretically that should happen, if the batch fetches are
working.. (I think).
I'm confused about how the running `unplugged' gnus can get refreshed
from the batch jobs. Currently I run this code I had when it was
still pgnus.
cat $my_gnus_el (no formatting) just the lines and where they came
from ( a couple things appear twice but I don't think it hurts
anything):
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
(add-to-list 'load-path "/usr/local/gnus/lisp"
(setq gnus-init-file "/tmp/my_gnus_init.el")
(load-library "gnus")
(setq mail-user-agent 'gnus-user-agent) ;;;batch:76:/home/reader/.gnus
(setq max-lisp-eval-depth 2000) ;;;batch:80:/home/reader/.gnus
(setq message-syntax-checks ;;;batch:81:/home/reader/.gnus
'((sender . disabled))) ;;;batch:82:/home/reader/.gnus
(defun message-make-fqdn () ;;;batch:84:/home/reader/.gnus
"My hacked message-id." ;;;batch:85:/home/reader/.gnus
"newsguy.com") ;;;batch:86:/home/reader/.gnus
(setq gnus-expert-user t) ;;;batch:95:/home/reader/.gnus
(setq gnus-agent-short-article 50) ;;;batch:96:/home/reader/.gnus
(setq gnus-use-adaptive-scoring nil) ;;;batch:152:/home/reader/.gnus
(setq mail-sources ;;;batch:159:/home/reader/.gnus
'((file :path "/var/spool/mail/reader") ;;;batch:160:/home/reader/.gnus
(directory :path "/home/reader/spool/" :suffix ".in"))) ;;;batch:161:/home/reader/.gnus
(setq gnus-extra-headers ;;;batch:164:/home/reader/.gnus
'(To Newsgroups Keywords )) ;;;batch:165:/home/reader/.gnus
(setq nnmail-extra-headers gnus-extra-headers) ;;;batch:166:/home/reader/.gnus
(setq gnus-ignored-from-addresses ;;;batch:167:/home/reader/.gnus
"Harry Putnam") ;;;batch:168:/home/reader/.gnus
(setq message-user-organization "Still searching...") ;;;batch:171:/home/reader/.gnus
(setq gnus-select-method '(nntp "enews.newsguy.com")) ;;;batch:172:/home/reader/.gnus
(setq user-mail-address "reader@newsguy.com") ;;;batch:175:/home/reader/.gnus
(setq gnus-check-new-newsgroups 'ask-server) ;;;batch:183:/home/reader/.gnus
(setq gnus-agent-handle-level 3) ;;;batch:186:/home/reader/.gnus
(setq gnus-activate-foreign-newsgroups 3) ;;;batch:187:/home/reader/.gnus
(setq mail-source-delete-incoming t) ;;;batch:188:/home/reader/.gnus
(setq gnus-use-long-file-name t) ;;;batch:189:/home/reader/.gnus
(setq nnmail-crosspost nil) ;;;batch:190:/home/reader/.gnus
(setq gnus-secondary-select-methods ;;;batch:194:/home/reader/.gnus
'((nnml ""))) ;;;batch:195:/home/reader/.gnus
(setq nnmail-split-methods ;;;batch:197:/home/reader/.gnus
'(("tests" "^Subject:.*test.*labridge") ;;;batch:198:/home/reader/.gnus
("Edited" "^Subject: \\[ed\\]\\|^Subject: \\[ed\\]") ;;;batch:199:/home/reader/.gnus
("misc" ""))) ;;;batch:200:/home/reader/.gnus
(setq user-mail-address "reader@newsguy.com") ;;;batch:124:/home/reader/.emacs
(setq message-syntax-checks '((sender . disabled))) ;;;batch:125:/home/reader/.emacs
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Then this batching function is loaded:
cat $my_batch_el
(defun hp-fetch-news ()
(interactive)
;; The let below might load ~/.gnus if "" trying nil
;;(let ((init-file-user "")
(let ((init-file-user nil)
(gnus-always-read-dribble-file t))
(gnus))
;; not sure what this does or if I need it either
(let ((gnus-agent-confirmation-function 'gnus-agent-batch-confirmation))
(gnus-group-send-queue)
(gnus-agent-fetch-session)
(gnus-group-quit)))
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2003-07-02 19:18 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-07-02 19:18 How can I accomplish this: Run unplugged and do everthing in batch mode 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).