unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@IRO.UMontreal.CA>
To: Michael Heerdegen <michael_heerdegen@web.de>
Cc: 20682@debbugs.gnu.org
Subject: bug#20682: 25.0.50; Enable users to combine --script and --quick
Date: Thu, 28 May 2015 14:48:04 -0400	[thread overview]
Message-ID: <jwv4mmw8sg5.fsf-monnier+emacsbugs@gnu.org> (raw)
In-Reply-To: <878uc8pzyc.fsf@web.de> (Michael Heerdegen's message of "Thu, 28 May 2015 15:57:15 +0200")

> This is a feature request to enable users to write emacs scripts (à 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=-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.

>  - 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 (source)...
>      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.

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.





  reply	other threads:[~2015-05-28 18:48 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-28 13:57 bug#20682: 25.0.50; Enable users to combine --script and --quick Michael Heerdegen
2015-05-28 18:48 ` Stefan Monnier [this message]
2015-05-28 20:30   ` Glenn Morris
2022-04-18 11:01     ` bug#20682: bug#25671: Feature request: emacs -Q --script as a single binary Lars Ingebrigtsen
2022-05-05 22:14       ` Michael Heerdegen
2022-05-06 12:05         ` bug#20682: " Lars Ingebrigtsen
2022-05-07  2:08           ` Michael Heerdegen

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

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=jwv4mmw8sg5.fsf-monnier+emacsbugs@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=20682@debbugs.gnu.org \
    --cc=michael_heerdegen@web.de \
    /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.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).