GNU bug report logs - #4399
simple way to identify top-level --script file

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: emacs; Severity: wishlist; Reported by: Tom Tromey <tromey@HIDDEN>; dated Fri, 11 Sep 2009 02:15:04 UTC; Maintainer for emacs is bug-gnu-emacs@HIDDEN.
Changed bug title to 'simple way to identify top-level --script file' from '23.1; let a file know it was run with --script ' Request was from Glenn Morris <rgm@HIDDEN> to control@HIDDEN. Full text available.
Severity set to 'wishlist' from 'normal' Request was from Glenn Morris <rgm@HIDDEN> to control@HIDDEN. Full text available.
Did not alter fixed versions and reopened. Request was from Debbugs Internal Request <help-debbugs@HIDDEN> to internal_control@HIDDEN. Full text available.

Message received at 4399@HIDDEN:


Received: (at 4399) by emacsbugs.donarmstrong.com; 19 Sep 2009 03:19:12 +0000
From rgm@HIDDEN Fri Sep 18 20:19:11 2009
X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02
	(2008-06-10) on rzlab.ucr.edu
X-Spam-Level: 
X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available.
	hammytokens:Tokens not available.
X-Spam-Status: No, score=-8.6 required=4.0 tests=AWL,HAS_BUG_NUMBER,
	VALID_BTS_CONTROL,X_DEBBUGS_NO_ACK autolearn=ham
	version=3.2.5-bugs.debian.org_2005_01_02
Received: from fencepost.gnu.org (fencepost.gnu.org [140.186.70.10])
	by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id n8J3JANC032055;
	Fri, 18 Sep 2009 20:19:11 -0700
Received: from rgm by fencepost.gnu.org with local (Exim 4.67)
	(envelope-from <rgm@HIDDEN>)
	id 1MoqTd-0002GL-K2; Fri, 18 Sep 2009 23:19:09 -0400
From: Glenn Morris <rgm@HIDDEN>
To: Tom Tromey <tromey@HIDDEN>
Cc: 4399 <at> debbugs.gnu.org
Subject: Re: bug#4399: 23.1; let a file know it was run with --script
References: <m3y6omi6a8.fsf@HIDDEN>
	<qk3a6u3zew.fsf@HIDDEN> <m3fxakf96t.fsf@HIDDEN>
	<l97hvwp1s3.fsf@HIDDEN> <m3y6occc90.fsf@HIDDEN>
	<t2vdjgxell.fsf@HIDDEN> <m3r5u3agd3.fsf@HIDDEN>
X-Spook: CDC csystems enigma fraud high security sniper Jiang
X-Ran: jJ-PUY`j`\H|+j`[L4GyJEO"X=~i46sAwy9<Hmp)NJ_Vih^~^vmZt/90]4n0W9#m2Xx7]T
X-Hue: blue
X-Debbugs-No-Ack: yes
X-Attribution: GM
Date: Fri, 18 Sep 2009 23:19:09 -0400
Message-ID: <cxljkbsjte.fsf@HIDDEN>
User-Agent: Gnus (www.gnus.org), GNU Emacs (www.gnu.org/software/emacs/)
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii

reopen 4399
severity 4399 wishlist
retitle 4399 simple way to identify top-level --script file
stop

Tom Tromey wrote:

> I guess this will work as long as I don't mind hard-coding in the file's
> name.  Unless there's a way to also get this?

On reflection, it seems a pretty poor solution, so I'll reopen this as
a wishlist.

Summary:

When using --script, it would be nice if there was a simple way for
the file so loaded to identify itself as the "main file", distinct
from any libraries it might require.


(I'd probably just use a hack like:

#!/bin/sh

exec emacs -batch -l test.el -f batch-run-test

but I suppose this is against the spirit of --script)



Information forwarded to bug-submit-list@HIDDEN, Emacs Bugs <bug-gnu-emacs@HIDDEN>:
bug#4399; Package emacs. Full text available.

Message received at 4399@HIDDEN:


Received: (at 4399) by emacsbugs.donarmstrong.com; 19 Sep 2009 01:11:13 +0000
From tromey@HIDDEN Fri Sep 18 18:11:12 2009
X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02
	(2008-06-10) on rzlab.ucr.edu
X-Spam-Level: 
X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available.
	hammytokens:Tokens not available.
X-Spam-Status: No, score=-2.0 required=4.0 tests=AWL,HAS_BUG_NUMBER,
	SPF_HELO_PASS autolearn=ham version=3.2.5-bugs.debian.org_2005_01_02
Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28])
	by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id n8J1BBkD011625
	for <4399@HIDDEN>; Fri, 18 Sep 2009 18:11:12 -0700
Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12])
	by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id n8J1B6QY003335;
	Fri, 18 Sep 2009 21:11:06 -0400
Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199])
	by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id n8J1B5DW000702;
	Fri, 18 Sep 2009 21:11:05 -0400
Received: from opsy.redhat.com (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1])
	by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id n8J1B42D012161;
	Fri, 18 Sep 2009 21:11:04 -0400
Received: by opsy.redhat.com (Postfix, from userid 500)
	id 2198F3782A5; Fri, 18 Sep 2009 19:11:04 -0600 (MDT)
From: Tom Tromey <tromey@HIDDEN>
To: Glenn Morris <rgm@HIDDEN>
Cc: 4399 <at> debbugs.gnu.org
Subject: Re: bug#4399: 23.1; let a file know it was run with --script
References: <m3y6omi6a8.fsf@HIDDEN>
	<qk3a6u3zew.fsf@HIDDEN> <m3fxakf96t.fsf@HIDDEN>
	<l97hvwp1s3.fsf@HIDDEN> <m3y6occc90.fsf@HIDDEN>
	<t2vdjgxell.fsf@HIDDEN>
Reply-To: Tom Tromey <tromey@HIDDEN>
X-Attribution:  Tom
Date: Fri, 18 Sep 2009 19:11:04 -0600
In-Reply-To: <t2vdjgxell.fsf@HIDDEN> (Glenn Morris's message of
	"Fri, 18 Sep 2009 15:00:38 -0400")
Message-ID: <m3r5u3agd3.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
X-Scanned-By: MIMEDefang 2.67 on 10.5.11.12

GM> That's what I was suggesting checking command-line-args for.

Ah, now I get it.
I guess this will work as long as I don't mind hard-coding in the file's
name.  Unless there's a way to also get this?

thanks,
Tom



Acknowledgement sent to Tom Tromey <tromey@HIDDEN>:
Extra info received and forwarded to list. Copy sent to Emacs Bugs <bug-gnu-emacs@HIDDEN>. Full text available.
Information forwarded to bug-submit-list@HIDDEN, Emacs Bugs <bug-gnu-emacs@HIDDEN>:
bug#4399; Package emacs. Full text available.

Message received at 4399@HIDDEN:


Received: (at 4399) by emacsbugs.donarmstrong.com; 18 Sep 2009 19:00:41 +0000
From rgm@HIDDEN Fri Sep 18 12:00:40 2009
X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02
	(2008-06-10) on rzlab.ucr.edu
X-Spam-Level: 
X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available.
	hammytokens:Tokens not available.
X-Spam-Status: No, score=-7.6 required=4.0 tests=AWL,HAS_BUG_NUMBER,
	X_DEBBUGS_NO_ACK autolearn=ham version=3.2.5-bugs.debian.org_2005_01_02
Received: from fencepost.gnu.org (fencepost.gnu.org [140.186.70.10])
	by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id n8IJ0dAk010671
	for <4399@HIDDEN>; Fri, 18 Sep 2009 12:00:40 -0700
Received: from rgm by fencepost.gnu.org with local (Exim 4.67)
	(envelope-from <rgm@HIDDEN>)
	id 1MoihD-0007jf-12; Fri, 18 Sep 2009 15:00:39 -0400
From: Glenn Morris <rgm@HIDDEN>
To: Tom Tromey <tromey@HIDDEN>
Cc: 4399 <at> debbugs.gnu.org
Subject: Re: bug#4399: 23.1; let a file know it was run with --script
References: <m3y6omi6a8.fsf@HIDDEN>
	<qk3a6u3zew.fsf@HIDDEN> <m3fxakf96t.fsf@HIDDEN>
	<l97hvwp1s3.fsf@HIDDEN> <m3y6occc90.fsf@HIDDEN>
X-Spook: argus Bruxelles strategic White House rs9512c CIA morse
X-Ran: w?h3!*kv*FLlcV}iv6Zt~o{4xcx'i(5_yk>0`)fcv&xMhMG+"uW]&u$M#k__mG:VH[R8!E
X-Hue: black
X-Debbugs-No-Ack: yes
X-Attribution: GM
Date: Fri, 18 Sep 2009 15:00:38 -0400
In-Reply-To: <m3y6occc90.fsf@HIDDEN> (Tom Tromey's message of "Fri,
	18 Sep 2009 12:56:59 -0600")
Message-ID: <t2vdjgxell.fsf@HIDDEN>
User-Agent: Gnus (www.gnus.org), GNU Emacs (www.gnu.org/software/emacs/)
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii

Tom Tromey wrote:

>>>>>> "GM" == Glenn Morris <rgm@HIDDEN> writes:
>
> GM> It sounds like noninteractive will work fine (you could perhaps check
> GM> command-line-args if you want finer control)?
>
> I don't think that has the same effect if you load multiple such files.
> I only want the "main" one to eval the code.

That's what I was suggesting checking command-line-args for.

If you still need some extra functionality, we can leave reopen this
as a wishlist.



Information forwarded to bug-submit-list@HIDDEN, Emacs Bugs <bug-gnu-emacs@HIDDEN>:
bug#4399; Package emacs. Full text available.

Message received at 4399@HIDDEN:


Received: (at 4399) by emacsbugs.donarmstrong.com; 18 Sep 2009 18:57:08 +0000
From tromey@HIDDEN Fri Sep 18 11:57:07 2009
X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02
	(2008-06-10) on rzlab.ucr.edu
X-Spam-Level: 
X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available.
	hammytokens:Tokens not available.
X-Spam-Status: No, score=-2.0 required=4.0 tests=AWL,HAS_BUG_NUMBER,
	SPF_HELO_PASS autolearn=ham version=3.2.5-bugs.debian.org_2005_01_02
Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28])
	by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id n8IIv6ee009927
	for <4399@HIDDEN>; Fri, 18 Sep 2009 11:57:07 -0700
Received: from int-mx04.intmail.prod.int.phx2.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.17])
	by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id n8IIv3gp011333;
	Fri, 18 Sep 2009 14:57:03 -0400
Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199])
	by int-mx04.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id n8IIux0b019032;
	Fri, 18 Sep 2009 14:56:59 -0400
Received: from opsy.redhat.com (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1])
	by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id n8IIv0f2014421;
	Fri, 18 Sep 2009 14:57:01 -0400
Received: by opsy.redhat.com (Postfix, from userid 500)
	id 4D99A3782A5; Fri, 18 Sep 2009 12:57:00 -0600 (MDT)
From: Tom Tromey <tromey@HIDDEN>
To: Glenn Morris <rgm@HIDDEN>
Cc: 4399 <at> debbugs.gnu.org
Subject: Re: bug#4399: 23.1; let a file know it was run with --script
References: <m3y6omi6a8.fsf@HIDDEN>
	<qk3a6u3zew.fsf@HIDDEN> <m3fxakf96t.fsf@HIDDEN>
	<l97hvwp1s3.fsf@HIDDEN>
Reply-To: Tom Tromey <tromey@HIDDEN>
X-Attribution:  Tom
Date: Fri, 18 Sep 2009 12:56:59 -0600
In-Reply-To: <l97hvwp1s3.fsf@HIDDEN> (Glenn Morris's message of
	"Fri, 18 Sep 2009 14:04:44 -0400")
Message-ID: <m3y6occc90.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
X-Scanned-By: MIMEDefang 2.67 on 10.5.11.17

>>>>> "GM" == Glenn Morris <rgm@HIDDEN> writes:

GM> It sounds like noninteractive will work fine (you could perhaps check
GM> command-line-args if you want finer control)? Or use the traditional:

I don't think that has the same effect if you load multiple such files.
I only want the "main" one to eval the code.

GM> emacs -batch -l ./test.el -f batch-run-tests

This won't work if you want to use #! to start a script.

I guess I can work around this by writing a new .el that just loads
things and evals something.

Tom



Acknowledgement sent to Tom Tromey <tromey@HIDDEN>:
Extra info received and forwarded to list. Copy sent to Emacs Bugs <bug-gnu-emacs@HIDDEN>. Full text available.
Information forwarded to bug-submit-list@HIDDEN, Emacs Bugs <bug-gnu-emacs@HIDDEN>:
bug#4399; Package emacs. Full text available.

Message received at 4399@HIDDEN:


Received: (at 4399) by emacsbugs.donarmstrong.com; 18 Sep 2009 18:04:47 +0000
From rgm@HIDDEN Fri Sep 18 11:04:46 2009
X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02
	(2008-06-10) on rzlab.ucr.edu
X-Spam-Level: 
X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available.
	hammytokens:Tokens not available.
X-Spam-Status: No, score=-7.6 required=4.0 tests=AWL,HAS_BUG_NUMBER,
	X_DEBBUGS_NO_ACK autolearn=ham version=3.2.5-bugs.debian.org_2005_01_02
Received: from fencepost.gnu.org (fencepost.gnu.org [140.186.70.10])
	by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id n8II4iRi001052
	for <4399@HIDDEN>; Fri, 18 Sep 2009 11:04:46 -0700
Received: from rgm by fencepost.gnu.org with local (Exim 4.67)
	(envelope-from <rgm@HIDDEN>)
	id 1Mohp6-0003bk-7w; Fri, 18 Sep 2009 14:04:44 -0400
From: Glenn Morris <rgm@HIDDEN>
To: Tom Tromey <tromey@HIDDEN>
Cc: 4399 <at> debbugs.gnu.org
Subject: Re: bug#4399: 23.1; let a file know it was run with --script
References: <m3y6omi6a8.fsf@HIDDEN>
	<qk3a6u3zew.fsf@HIDDEN> <m3fxakf96t.fsf@HIDDEN>
X-Spook: Bush Wired kilo class class struggle e-bomb MDA Mossad
X-Ran: {M7)V;omqxJ-c,W^;4g_B%3W|kRVErpQ_^"f:U]R]$7H=Ym:ot85G~v_pe>dIhIc{+5f*`
X-Hue: black
X-Debbugs-No-Ack: yes
X-Attribution: GM
Date: Fri, 18 Sep 2009 14:04:44 -0400
Message-ID: <l97hvwp1s3.fsf@HIDDEN>
User-Agent: Gnus (www.gnus.org), GNU Emacs (www.gnu.org/software/emacs/)
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii

Tom Tromey wrote:

> 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.

It sounds like noninteractive will work fine (you could perhaps check
command-line-args if you want finer control)? Or use the traditional:

emacs -batch -l ./test.el -f batch-run-tests



Information forwarded to bug-submit-list@HIDDEN, Emacs Bugs <bug-gnu-emacs@HIDDEN>:
bug#4399; Package emacs. Full text available.

Message received at 4399@HIDDEN:


Received: (at 4399) by emacsbugs.donarmstrong.com; 18 Sep 2009 17:34:59 +0000
From tromey@HIDDEN Fri Sep 18 10:34:59 2009
X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02
	(2008-06-10) on rzlab.ucr.edu
X-Spam-Level: 
X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available.
	hammytokens:Tokens not available.
X-Spam-Status: No, score=-1.9 required=4.0 tests=AWL,HAS_BUG_NUMBER,
	SPF_HELO_PASS autolearn=ham version=3.2.5-bugs.debian.org_2005_01_02
Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28])
	by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id n8IHYvHC029021
	for <4399@HIDDEN>; Fri, 18 Sep 2009 10:34:59 -0700
Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11])
	by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id n8IHYqhg032161;
	Fri, 18 Sep 2009 13:34:52 -0400
Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199])
	by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id n8IHYpcD007585;
	Fri, 18 Sep 2009 13:34:51 -0400
Received: from opsy.redhat.com (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1])
	by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id n8IHYoiY007626;
	Fri, 18 Sep 2009 13:34:51 -0400
Received: by opsy.redhat.com (Postfix, from userid 500)
	id 3F626378204; Fri, 18 Sep 2009 11:34:50 -0600 (MDT)
From: Tom Tromey <tromey@HIDDEN>
To: Glenn Morris <rgm@HIDDEN>
Cc: 4399 <at> debbugs.gnu.org
Subject: Re: bug#4399: 23.1; let a file know it was run with --script
References: <m3y6omi6a8.fsf@HIDDEN>
	<qk3a6u3zew.fsf@HIDDEN>
Reply-To: Tom Tromey <tromey@HIDDEN>
X-Attribution:  Tom
Date: Fri, 18 Sep 2009 11:34:50 -0600
In-Reply-To: <qk3a6u3zew.fsf@HIDDEN> (Glenn Morris's message of
	"Thu, 10 Sep 2009 23:58:47 -0400")
Message-ID: <m3fxakf96t.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
X-Scanned-By: MIMEDefang 2.67 on 10.5.11.11

>>>>> "GM" == Glenn Morris <rgm@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



Acknowledgement sent to Tom Tromey <tromey@HIDDEN>:
Extra info received and forwarded to list. Copy sent to Emacs Bugs <bug-gnu-emacs@HIDDEN>. Full text available.
Information forwarded to bug-submit-list@HIDDEN, Emacs Bugs <bug-gnu-emacs@HIDDEN>:
bug#4399; Package emacs. Full text available.
bug closed, send any further explanations to Tom Tromey <tromey@HIDDEN> Request was from Glenn Morris <rgm@HIDDEN> to control@HIDDEN. Full text available.

Message received at 4399@HIDDEN:


Received: (at 4399) by emacsbugs.donarmstrong.com; 11 Sep 2009 03:58:50 +0000
From rgm@HIDDEN Thu Sep 10 20:58:50 2009
X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02
	(2008-06-10) on rzlab.ucr.edu
X-Spam-Level: 
X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available.
	hammytokens:Tokens not available.
X-Spam-Status: No, score=-7.6 required=4.0 tests=AWL,HAS_BUG_NUMBER,
	X_DEBBUGS_NO_ACK autolearn=ham version=3.2.5-bugs.debian.org_2005_01_02
Received: from fencepost.gnu.org (fencepost.gnu.org [140.186.70.10])
	by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id n8B3wmiN009020
	for <4399@HIDDEN>; Thu, 10 Sep 2009 20:58:50 -0700
Received: from rgm by fencepost.gnu.org with local (Exim 4.67)
	(envelope-from <rgm@HIDDEN>)
	id 1MlxHb-0006jK-TB; Thu, 10 Sep 2009 23:58:47 -0400
From: Glenn Morris <rgm@HIDDEN>
To: Tom Tromey <tromey@HIDDEN>
Cc: 4399 <at> debbugs.gnu.org
Subject: Re: bug#4399: 23.1; let a file know it was run with --script
References: <m3y6omi6a8.fsf@HIDDEN>
X-Spook: Vince Foster terrorist ARPA Crypto AG S Key Bosnia
X-Ran: 8"l1au'"9w2tz]f{UV7WpO*^#oy:7B?z=8:M=#Oi9f@*wSj,"]3F*v++<Vq2,"6!QRh4BK
X-Hue: cyan
X-Debbugs-No-Ack: yes
X-Attribution: GM
Date: Thu, 10 Sep 2009 23:58:47 -0400
In-Reply-To: <m3y6omi6a8.fsf@HIDDEN> (Tom Tromey's message of "Thu,
	10 Sep 2009 20:06:39 -0600")
Message-ID: <qk3a6u3zew.fsf@HIDDEN>
User-Agent: Gnus (www.gnus.org), GNU Emacs (www.gnu.org/software/emacs/)
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii

Tom Tromey wrote:

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

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



Information forwarded to bug-submit-list@HIDDEN, Emacs Bugs <bug-gnu-emacs@HIDDEN>:
bug#4399; Package emacs. Full text available.

Message received at submit@HIDDEN:


Received: (at submit) by emacsbugs.donarmstrong.com; 11 Sep 2009 02:06:50 +0000
From tromey@HIDDEN Thu Sep 10 19:06:50 2009
X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02
	(2008-06-10) on rzlab.ucr.edu
X-Spam-Level: 
X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available.
	hammytokens:Tokens not available.
X-Spam-Status: No, score=-0.5 required=4.0 tests=AWL,FOURLA autolearn=no
	version=3.2.5-bugs.debian.org_2005_01_02
Received: from lists.gnu.org (lists.gnu.org [199.232.76.165])
	by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id n8B26nYh020699
	for <submit@HIDDEN>; Thu, 10 Sep 2009 19:06:50 -0700
Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43)
	id 1MlvXD-00084m-V3
	for bug-gnu-emacs@HIDDEN; Thu, 10 Sep 2009 22:06:48 -0400
Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43)
	id 1MlvX9-0007zy-Qp
	for bug-gnu-emacs@HIDDEN; Thu, 10 Sep 2009 22:06:47 -0400
Received: from [199.232.76.173] (port=44362 helo=monty-python.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.43)
	id 1MlvX9-0007zo-MW
	for bug-gnu-emacs@HIDDEN; Thu, 10 Sep 2009 22:06:43 -0400
Received: from mx1.redhat.com ([209.132.183.28]:62438)
	by monty-python.gnu.org with esmtp (Exim 4.60)
	(envelope-from <tromey@HIDDEN>)
	id 1MlvX9-000704-2f
	for bug-gnu-emacs@HIDDEN; Thu, 10 Sep 2009 22:06:43 -0400
Received: from int-mx05.intmail.prod.int.phx2.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.18])
	by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id n8B26gCs007850
	for <bug-gnu-emacs@HIDDEN>; Thu, 10 Sep 2009 22:06:42 -0400
Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199])
	by int-mx05.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id n8B26fgK007823;
	Thu, 10 Sep 2009 22:06:41 -0400
Received: from opsy.redhat.com (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1])
	by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id n8B26erI002496;
	Thu, 10 Sep 2009 22:06:40 -0400
Received: by opsy.redhat.com (Postfix, from userid 500)
	id E5A20378183; Thu, 10 Sep 2009 20:06:39 -0600 (MDT)
From: Tom Tromey <tromey@HIDDEN>
To: bug-gnu-emacs@HIDDEN
Subject: 23.1; let a file know it was run with --script 
Reply-To: Tom Tromey <tromey@HIDDEN>
X-Attribution: Tom
Date: Thu, 10 Sep 2009 20:06:39 -0600
Message-ID: <m3y6omi6a8.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
X-Scanned-By: MIMEDefang 2.67 on 10.5.11.18
X-detected-operating-system: by monty-python.gnu.org: Genre and OS details not recognized.


Please write in English if possible, because the Emacs maintainers
usually do not have translators to read other languages for them.

Your bug report will be posted to the bug-gnu-emacs@HIDDEN mailing list,
and to the gnu.emacs.bug news group.

Please describe exactly what actions triggered the bug
and the precise symptoms of the bug:


On occasion it would be convenient to have a .el file which could check
whether it was invoked with --script.  (Python can do this, it is quite
handy there.)

I don't think there is a way to do this currently.


If Emacs crashed, and you have the Emacs process in the gdb debugger,
please include the output from the following gdb commands:
    `bt full' and `xbacktrace'.
If you would like to further debug the crash, please read the file
/usr/share/emacs/23.1/etc/DEBUG for instructions.


In GNU Emacs 23.1.1 (i386-redhat-linux-gnu, GTK+ Version 2.16.5)
 of 2009-08-26 on x86-2.fedora.phx.redhat.com
Windowing system distributor `The X.Org Foundation', version 11.0.10601901
configured using `configure  '--build=i386-redhat-linux-gnu' '--host=i386-redhat-linux-gnu' '--target=i586-redhat-linux-gnu' '--program-prefix=' '--prefix=/usr' '--exec-prefix=/usr' '--bindir=/usr/bin' '--sbindir=/usr/sbin' '--sysconfdir=/etc' '--datadir=/usr/share' '--includedir=/usr/include' '--libdir=/usr/lib' '--libexecdir=/usr/libexec' '--localstatedir=/var' '--sharedstatedir=/var/lib' '--mandir=/usr/share/man' '--infodir=/usr/share/info' '--with-dbus' '--with-gif' '--with-jpeg' '--with-png' '--with-rsvg' '--with-tiff' '--with-xft' '--with-xpm' '--with-x-toolkit=gtk' 'build_alias=i386-redhat-linux-gnu' 'host_alias=i386-redhat-linux-gnu' 'target_alias=i586-redhat-linux-gnu' 'CFLAGS=-DMAIL_USE_LOCKF -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i586 -mtune=generic -fasynchronous-unwind-tables''

Important settings:
  value of $LC_ALL: nil
  value of $LC_COLLATE: nil
  value of $LC_CTYPE: nil
  value of $LC_MESSAGES: nil
  value of $LC_MONETARY: nil
  value of $LC_NUMERIC: nil
  value of $LC_TIME: nil
  value of $LANG: en_US.UTF-8
  value of $XMODIFIERS: nil
  locale-coding-system: utf-8-unix
  default-enable-multibyte-characters: t

Major mode: Group

Minor modes in effect:
  gnus-agent-mode: t
  shell-dirtrack-mode: t
  erc-list-mode: t
  erc-menu-mode: t
  erc-autojoin-mode: t
  erc-ring-mode: t
  erc-pcomplete-mode: t
  erc-track-mode: t
  erc-track-minor-mode: t
  erc-match-mode: t
  erc-button-mode: t
  erc-fill-mode: t
  erc-stamp-mode: t
  erc-netsplit-mode: t
  erc-spelling-mode: t
  erc-truncate-mode: t
  diff-auto-refine-mode: t
  gnus-undo-mode: t
  erc-status-mode: t
  erc-services-mode: t
  erc-networks-mode: t
  erc-irccontrols-mode: t
  erc-noncommands-mode: t
  erc-move-to-prompt-mode: t
  erc-readonly-mode: t
  tooltip-mode: t
  mouse-wheel-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  global-auto-composition-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  line-number-mode: t
  transient-mark-mode: t

Recent input:
q SPC 5 0 <return> M-> SPC Q y C-n C-n C-SPC C-u E 
SPC C-u E q C-z o <f10> <f10> C-z o C-r o t h e r C-a 
SPC 5 0 <return> M-> C-u C-u C-p C-u C-n p = C-u E 
E E E E E S-SPC E S-SPC E S-SPC E S-SPC E C-u C-p C-n 
M S-SPC M S-SPC M S-SPC q s C-u C-u C-n p p SPC 5 0 
<return> M-> q SPC M-> q C-s a r c C-a C-s f r C-a 
SPC 5 0 <return> M-> Q y s ESC [ > 1 ; 2 0 0 5 ; 0 
c C-x b * G TAB RET 1 g n n SPC ESC > Q y C-r o t h 
e r C-a SPC 5 0 RET ESC > C-u C-p C-p p C-u RET RET 
RET RET RET C-u RET M SPC n M SPC SPC E E SPC SPC SPC 
E = C-l C-a ESC v ESC v ESC v q s ESC [ 2 1 ~ ESC [ 
2 1 ~ ESC [ 2 1 ~ ESC [ 2 1 ~ ESC [ 2 1 ~ ESC [ 2 1 
~ C-v C-l p p p SPC E q n n SPC ESC > C-p C-p E E q 
C-l C-u C-n C-u C-n C-u C-n C-l n SPC 5 RET Q y n n 
n SPC 5 0 RET ESC > Q y p SPC 5 0 RET ESC > Q y s ESC 
v ESC [ 2 1 ~ ESC [ 2 1 ~ ESC [ 2 1 ~ ESC [ 2 1 ~ ESC 
[ 2 1 ~ ESC x r e p o r t - e m TAB b TAB RET

Recent messages:
Retrieving newsgroup: nnml:mail.cygnus...
Fetching headers for nnml:mail.cygnus...done
Generating summary...done
Mark set
Discard changes to this group and exit? (y or n) 
(No changes need to be saved)
Saving /home/tromey/.newsrc.eld...
Saving file /home/tromey/.newsrc.eld...
Wrote /home/tromey/.newsrc.eld
Saving /home/tromey/.newsrc.eld...done

Tom




Acknowledgement sent to Tom Tromey <tromey@HIDDEN>:
New bug report received and forwarded. Copy sent to Emacs Bugs <bug-gnu-emacs@HIDDEN>. Full text available.
Report forwarded to bug-submit-list@HIDDEN, Emacs Bugs <bug-gnu-emacs@HIDDEN>:
bug#4399; Package emacs. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Mon, 25 Nov 2019 12:00:02 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.