help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Emacs in batch mode: handling of commandline arguments


From: Thorsten Jolitz
Subject: Emacs in batch mode: handling of commandline arguments
Date: Mon, 01 Jul 2013 00:32:46 +0200
User-agent: Gnus/5.130002 (Ma Gnus v0.2) Emacs/24.3 (gnu/linux)

Hi List,

I try to write a generic, flexible and robust function in another
programming language for calling Emacs in batch mode. I did quite a lot
of experimenting, but I'm still a bit confused about the following
questions:

 1. chaining of '--load' args

    with a call like this

    ,-----------------------------------------------------
    | emacs --batch --load=file1 --load=file2 --load=file3
    `-----------------------------------------------------

    is only file1 loaded and the others are ignored?

 2. chaining of '--eval' args

    is a call like this

    ,-----------------------------------------------------
    | emacs --batch --eval='(+ 3 4)' --eval='(- 5 3)' --eval='(* 3 3)'
    `-----------------------------------------------------

    equivalent to

    ,-------------------------------------------------------
    | emacs --batch --eval='(progn (+ 3 4) (- 5 3) (* 3 3))'
    `-------------------------------------------------------

 3. mixing of '--load' and '--eval' args

    with a call like this

    ,-----------------------------------------------------
    | emacs --batch --load=file1 --eval='(+ 3 4)'
    `-----------------------------------------------------

    is only file1 loaded and evaluation ignored?

 4. what about processes?

    with a call like this

    ,-----------------------------------------
    | emacs --batch --load=file1 --load=file2
    `-----------------------------------------

    and given that both files are actually loaded - would variable 'myVar'
    set in file1

    ,----------------
    | (setq myVar 33)
    `----------------

    be available in file2

    ,-------------------------
    | (setq myVar (+ myVar 7))
    `-------------------------

    ?

I less words: can there be several --load and --eval statements in one
'emacs --batch' call, and are they all executed in the same Emacs
process (i.e. are the results of earlier evaluations available for later
evaluations)?

--
cheers,
Thorsten




reply via email to

[Prev in Thread] Current Thread [Next in Thread]