GNU bug report logs - #20682
25.0.50; Enable users to combine --script and --quick

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: Michael Heerdegen <michael_heerdegen@HIDDEN>; merged with #25671; dated Thu, 28 May 2015 13:58:02 UTC; Maintainer for emacs is bug-gnu-emacs@HIDDEN.
Merged 20682 25671. Request was from Glenn Morris <rgm@HIDDEN> to control <at> debbugs.gnu.org. Full text available.

Message received at 20682 <at> debbugs.gnu.org:


Received: (at 20682) by debbugs.gnu.org; 28 May 2015 20:30:29 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu May 28 16:30:28 2015
Received: from localhost ([127.0.0.1]:59832 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.80)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1Yy4Re-00073U-01
	for submit <at> debbugs.gnu.org; Thu, 28 May 2015 16:30:27 -0400
Received: from fencepost.gnu.org ([208.118.235.10]:35697 ident=Debian-exim)
 by debbugs.gnu.org with esmtp (Exim 4.80)
 (envelope-from <rgm@HIDDEN>) id 1Yy4RY-00072H-Q1
 for 20682 <at> debbugs.gnu.org; Thu, 28 May 2015 16:30:22 -0400
Received: from rgm by fencepost.gnu.org with local (Exim 4.71)
 (envelope-from <rgm@HIDDEN>)
 id 1Yy4RX-0006cG-G9; Thu, 28 May 2015 16:30:19 -0400
From: Glenn Morris <rgm@HIDDEN>
To: Stefan Monnier <monnier@HIDDEN>
Subject: Re: bug#20682: 25.0.50; Enable users to combine --script and --quick
References: <878uc8pzyc.fsf@HIDDEN> <jwv4mmw8sg5.fsf-monnier+emacsbugs@HIDDEN>
X-Spook: undercover bank Bruxelles Mahmoud Ahmadinejad AK-47
X-Ran: hCQzCkq%YLu*72Ip6s;>yIuhG$Ek}&ZY+X<$!$yF#`V$K{!v$OEV!<G=,pK8~{j*C../?)
X-Hue: yellow
X-Debbugs-No-Ack: yes
X-Attribution: GM
Date: Thu, 28 May 2015 16:30:19 -0400
In-Reply-To: <jwv4mmw8sg5.fsf-monnier+emacsbugs@HIDDEN> (Stefan Monnier's
 message of "Thu, 28 May 2015 14:48:04 -0400")
Message-ID: <l6k2vsphr8.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
X-Spam-Score: -4.3 (----)
X-Debbugs-Envelope-To: 20682
Cc: Michael Heerdegen <michael_heerdegen@HIDDEN>, 20682 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -4.3 (----)

Stefan Monnier wrote:

> OTOH I'd be happy to see a new argument that lets you provide various
> args as one.  E.g. "emacs --args=-Q,--script" which would be more
> generally useful to deal with the limit of only one arg in shebang.
> Given the size limit of shebang lines, we'd also want this extra arg to
> be shortish.
>
> An alternative would be to combine --args and --script, so you could
> say "emacs --script=-Q" to get what you're asking for.

Apparently it's somewhat conventional (perl, ruby) to use "-x" for this
purpose. A nice write-up at

https://github.com/smikes/node/blob/minus-x-switch/doc/Minus-X-Switch-Proposal.md

Amazingly, "-x" is available as an Emacs command-line switch...


Personally, I'd probably just use a trivial shell wrapper script.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#20682; Package emacs. Full text available.

Message received at 20682 <at> debbugs.gnu.org:


Received: (at 20682) by debbugs.gnu.org; 28 May 2015 18:48:09 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu May 28 14:48:09 2015
Received: from localhost ([127.0.0.1]:59795 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.80)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1Yy2qe-0004QP-6b
	for submit <at> debbugs.gnu.org; Thu, 28 May 2015 14:48:09 -0400
Received: from chene.dit.umontreal.ca ([132.204.246.20]:57465)
 by debbugs.gnu.org with esmtp (Exim 4.80)
 (envelope-from <monnier@HIDDEN>) id 1Yy2qc-0004QF-EB
 for 20682 <at> debbugs.gnu.org; Thu, 28 May 2015 14:48:07 -0400
Received: from ceviche.home (lechon.iro.umontreal.ca [132.204.27.242])
 by chene.dit.umontreal.ca (8.14.1/8.14.1) with ESMTP id t4SIm3oV016373;
 Thu, 28 May 2015 14:48:04 -0400
Received: by ceviche.home (Postfix, from userid 20848)
 id 9B0E2660D6; Thu, 28 May 2015 14:48:04 -0400 (EDT)
From: Stefan Monnier <monnier@HIDDEN>
To: Michael Heerdegen <michael_heerdegen@HIDDEN>
Subject: Re: bug#20682: 25.0.50; Enable users to combine --script and --quick
Message-ID: <jwv4mmw8sg5.fsf-monnier+emacsbugs@HIDDEN>
References: <878uc8pzyc.fsf@HIDDEN>
Date: Thu, 28 May 2015 14:48:04 -0400
In-Reply-To: <878uc8pzyc.fsf@HIDDEN> (Michael Heerdegen's message of "Thu, 28
 May 2015 15:57:15 +0200")
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: quoted-printable
X-NAI-Spam-Flag: NO
X-NAI-Spam-Threshold: 5
X-NAI-Spam-Score: 0
X-NAI-Spam-Rules: 1 Rules triggered
	RV5320=0
X-NAI-Spam-Version: 2.3.0.9393 : core <5320> : inlines <3095> : streams
 <1446230> : uri <1942656>
X-Spam-Score: -1.3 (-)
X-Debbugs-Envelope-To: 20682
Cc: 20682 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.3 (-)

> This is a feature request to enable users to write emacs scripts (=E0 la
> --script) that can be executed in a way that --quick does (i.e. avoid
> loading site stuff).

I'm not very much in favor of adding yet another ad-hoc arg for that.
OTOH I'd be happy to see a new argument that lets you provide various
args as one.  E.g. "emacs --args=3D-Q,--script" which would be more
generally useful to deal with the limit of only one arg in shebang.
Given the size limit of shebang lines, we'd also want this extra arg to
be shortish.

An alternative would be to combine --args and --script, so you could
say "emacs --script=3D-Q" to get what you're asking for.

>  - There are no messages like:

>      Loading 00debian-vars...
>      Loading /etc/emacs/site-start.d/50a2ps.el (source)...
>      Loading /etc/emacs/site-start.d/50autoconf.el (source)...
>      Loading /etc/emacs/site-start.d/50cmake-data.el (source)...
>      Loading /etc/emacs/site-start.d/50dictionaries-common.el (source)...
>      Loading debian-ispell...
>      Loading /var/cache/dictionaries-common/emacsen-ispell-default.el (so=
urce)...
>      Loading /var/cache/dictionaries-common/emacsen-ispell-dicts.el (sour=
ce)...
>      Loading /etc/emacs/site-start.d/51debian-el.el (source)...

>    when running a script.  That would be a nice thing if you wanted to
>    write something like wc or so.

I consider those messages as bugs.

BTW, Ideally, Debian packaging of Emacs packages should move towards
installing those packages as ELPA packages (i.e. install them into one
of package-directory-list and let Emacs load their <pkg>-autoloads.el
file).

>  - It would speed up startup by a factor of five (for me, 0.01 secs
>    vs. 0.002 secs when using the wrapper from above)

We should look into speeding this up, BTW.  Part of it might be
a problem on Debian's side (where those files do too much), but
I suspect that the problem goes deeper and we should figure out how to
improve it.  E.g. package.el's handling of package initialization could
use some optimization for the usual case where the set of packages is
the same as last time.

E.g. Ideally we could cache somewhere the last set of packages seen
along with the resulting set of <pkg>-autoloads.el files that we loaded
and actually keep the concatenation of those files into a single file
which we'd load instead.  Of course, this won't work currently because
those files are "position dependent" (e.g. they use load-file-name or
#$), but we should try and solve those problems.

>  - It might not be necessary to load site stuff.  On the contrary, if
>    you want to write portable scripts, it might be more desirable to be
>    able to write environment independent scripts

I tend to consider that any <pkg>-autoloads.el file should be 100%
harmless, or at least that the kind of changes they cause should be no
worse than the kinds of changes you experience when going from
Emacs-A.B to Emacs-A.C or Emacs-A+1.C


        Stefan


PS: Just to clarify, this should not be taken as an argument against
providing a way to get both -Q and --script as a single arg.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#20682; Package emacs. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 28 May 2015 13:57:34 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu May 28 09:57:34 2015
Received: from localhost ([127.0.0.1]:59610 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.80)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1YxyJQ-0005hT-VU
	for submit <at> debbugs.gnu.org; Thu, 28 May 2015 09:57:33 -0400
Received: from eggs.gnu.org ([208.118.235.92]:48604)
 by debbugs.gnu.org with esmtp (Exim 4.80)
 (envelope-from <michael_heerdegen@HIDDEN>) id 1YxyJN-0005hL-Sl
 for submit <at> debbugs.gnu.org; Thu, 28 May 2015 09:57:30 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <michael_heerdegen@HIDDEN>) id 1YxyJH-0000vh-I2
 for submit <at> debbugs.gnu.org; Thu, 28 May 2015 09:57:24 -0400
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,FREEMAIL_FROM
 autolearn=disabled version=3.3.2
Received: from lists.gnu.org ([2001:4830:134:3::11]:39806)
 by eggs.gnu.org with esmtp (Exim 4.71)
 (envelope-from <michael_heerdegen@HIDDEN>) id 1YxyJH-0000vd-Fk
 for submit <at> debbugs.gnu.org; Thu, 28 May 2015 09:57:23 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:33862)
 by lists.gnu.org with esmtp (Exim 4.71)
 (envelope-from <michael_heerdegen@HIDDEN>) id 1YxyJG-00023P-9P
 for bug-gnu-emacs@HIDDEN; Thu, 28 May 2015 09:57:23 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <michael_heerdegen@HIDDEN>) id 1YxyJD-0000ut-35
 for bug-gnu-emacs@HIDDEN; Thu, 28 May 2015 09:57:22 -0400
Received: from mout.web.de ([212.227.17.11]:56286)
 by eggs.gnu.org with esmtp (Exim 4.71)
 (envelope-from <michael_heerdegen@HIDDEN>) id 1YxyJC-0000un-Oo
 for bug-gnu-emacs@HIDDEN; Thu, 28 May 2015 09:57:19 -0400
Received: from drachen.dragon ([178.10.202.12]) by smtp.web.de (mrweb102) with
 ESMTPSA (Nemesis) id 0MGign-1YtJb22buT-00DVXy;
 Thu, 28 May 2015 15:57:17 +0200
From: Michael Heerdegen <michael_heerdegen@HIDDEN>
To: bug-gnu-emacs@HIDDEN
Subject: 25.0.50; Enable users to combine --script and --quick
Date: Thu, 28 May 2015 15:57:15 +0200
Message-ID: <878uc8pzyc.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Provags-ID: V03:K0:g0qzVBXLEOyESxOjEpgjEpOTM4MFqhKsGi/wJ7A9Dpc3VezVBUe
 jC1Vfo+YA9bm8hNttrpSL9kVEngFWuKEg4YbsMo7wrzQNpfJ6NYlje3cvJImi5LirjqBvJE
 ijTBbYaY2cZVodd0UfkW2i3CSqenBJuYcTrATgafKZz4cGKVQXmHQ5b48yADAmUoStY9eKa
 /IVnj2S6hJfa7t8BA8d1w==
X-UI-Out-Filterresults: notjunk:1;
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic]
X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address
 (bad octet value).
X-Received-From: 2001:4830:134:3::11
X-Spam-Score: -4.1 (----)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -4.1 (----)


Hello!

This is a feature request to enable users to write emacs scripts (=C3=A0 la
--script) that can be executed in a way that --quick does (i.e. avoid
loading site stuff).

AFAIK this is not directly possible currently, because if you try with a
file starting like this:

#!/usr/bin/emacs -Q --script

the "#!" implementation on most Unices will not be able to pass more
than one argument to the interpreter.

The only thing that can be done to force --quick is to define a separate
interpreter like this:

--8<---------------cut here---------------start------------->8---
#!/bin/bash

emacs --quick --script $@
--8<---------------cut here---------------end--------------->8---

(suggested by saint@HIDDEN in g.e.help).

I have been told in the same thread that if --script would be available
as -s, one could start scripts with "#!/usr/bin/emacs -Qs" and that
would already solve the problem.


These are the main reason why using --quick can be desirable:

 - There are no messages like:

     Loading 00debian-vars...
     Loading /etc/emacs/site-start.d/50a2ps.el (source)...
     Loading /etc/emacs/site-start.d/50autoconf.el (source)...
     Loading /etc/emacs/site-start.d/50cmake-data.el (source)...
     Loading /etc/emacs/site-start.d/50dictionaries-common.el (source)...
     Loading debian-ispell...
     Loading /var/cache/dictionaries-common/emacsen-ispell-default.el (sour=
ce)...
     Loading /var/cache/dictionaries-common/emacsen-ispell-dicts.el (source=
)...
     Loading /etc/emacs/site-start.d/51debian-el.el (source)...

   when running a script.  That would be a nice thing if you wanted to
   write something like wc or so.

 - It would speed up startup by a factor of five (for me, 0.01 secs
   vs. 0.002 secs when using the wrapper from above)

 - It might not be necessary to load site stuff.  On the contrary, if
   you want to write portable scripts, it might be more desirable to be
   able to write environment independent scripts


Many thanks,

Michael.




In GNU Emacs 25.0.50.2 (x86_64-unknown-linux-gnu, GTK+ Version 3.14.5)
 of 2015-05-27 on drachen
Windowing system distributor `The X.Org Foundation', version 11.0.11701000
System Description:	Debian GNU/Linux testing (stretch)

Configured features:
XPM JPEG TIFF GIF PNG RSVG IMAGEMAGICK SOUND DBUS GSETTINGS NOTIFY
LIBXML2 FREETYPE XFT ZLIB





Acknowledgement sent to Michael Heerdegen <michael_heerdegen@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs@HIDDEN. Full text available.
Report forwarded to bug-gnu-emacs@HIDDEN:
bug#20682; 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.