Gnus development mailing list
 help / color / mirror / Atom feed
From: Harry Putnam <reader@newsguy.com>
Subject: Re: How to make gnus read something besides .gnus in batch mode
Date: Mon, 30 Jun 2003 08:07:23 -0700	[thread overview]
Message-ID: <m3he674n9w.fsf@newsguy.com> (raw)
In-Reply-To: <87of0gujzn.fsf@indigo.shootybangbang.com>

John Paul Wallington <jpw@gnu.org> writes:

>>> Many arguments are deleted from `command-line-args' as they are
>>> processed.  How about checking the `noninteractive' variable ?

[...]

> I don't think it makes sense to heed `noninteractive' in a form that
> is passed to emacs -batch -eval because that would be redundant.
>
> [Nevertheless, emacs -batch -eval 'noninteractive' is syntactically
> correct at least, and to "make it do something" you could say emacs
> -batch -eval '(print noninteractive)' or emacs -batch -eval '(if
> noninteractive (print "foo"))'.]
>
> It makes more sense to heed `noninteractive' in your .gnus file.

Yes,  I was looking for the correct syntax to access it.  You've
supplied it.  Test for boolean value.

> emacs -q -no-site-file -batch -l ~/.my_gnus.el -f gnus-agent-batch
>
> Maybe it helps to frob the variable `gnus-init-file' to avoid loading
> ~/.gnus ?  For example, you could put (setq gnus-init-file
> (expand-file-name "~/.my_gnus.el")) at the start of ~/.my_gnus.el
> (untested).

L. Mitchell posted something that does that same thing I think:
emacs -batch --eval '(setq gnus-init-file "~/.not-dot-gnus")' \
 -f gnus-agent-batch

After being shown the proper stuff to look at and some experimentation.
It looks like one cannot slurp the contents of command-line-args even
by sticking it in a variable first thing:

 $ emacs -eval '(defvar myargs command-line-args)' \ 
   -q -no-site-file -batch  -eval '(print myargs)'

("emacs" "-eval" "(defvar myargs command-line-args)" "-eval" "(print
myargs)")

Still doesn't know about `-q', `-no-stite-file', or `-batch'

But noninteractive knows its a -batch command.

cat new.el
(message "Hello World from new.el")
(if noninteractive (print "Running noninteractive"))

=========

     $ emacs -q -no-site-file -batch -l ./new.el
   Hello World from new.el

   "Running noninteractive"

I have enough to solve my problme but still wondered if there just is
no way to grab all of command-line-args before processing begins?
Oh, and where is the extra newline coming from in the above output?




  reply	other threads:[~2003-06-30 15:07 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-06-29 17:24 Harry Putnam
2003-06-29 20:47 ` Harry Putnam
2003-06-30  4:32   ` John Paul Wallington
2003-06-30  6:25     ` Harry Putnam
2003-06-30  7:01       ` John Paul Wallington
2003-06-30 15:07         ` Harry Putnam [this message]
2003-06-30 17:06           ` John Paul Wallington
2003-06-29 21:22 ` lawrence mitchell
2003-07-01  0:15 ` Harry Putnam
2003-07-01 14:17   ` 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=m3he674n9w.fsf@newsguy.com \
    --to=reader@newsguy.com \
    /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).