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

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

bug#4399: 23.1; let a file know it was run with --script


From: Tom Tromey
Subject: bug#4399: 23.1; let a file know it was run with --script
Date: Fri, 18 Sep 2009 11:34:50 -0600
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux)

>>>>> "GM" == Glenn Morris <address@hidden> writes:

Sorry for the delay in my reply.

>> On occasion it would be convenient to have a .el file which could check
>> whether it was invoked with --script.

GM> You can check for a non-nil value of `noninteractive'. Or do you need
GM> to distinguish --batch from --script for some reason?

I was hoping for something like the python idiom:

    if __name__ == "__main__":

... this lets a file determine if it was invoked "as the main program".

My specific use was for tests: I want "emacs --script test.el" to run
the tests, but I want to be able to load the file just to get the defuns
without running the test suite.

Tom





reply via email to

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