all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Juanma Barranquero" <lekktu@gmail.com>
To: "Stefan Monnier" <monnier@iro.umontreal.ca>
Cc: Chong Yidong <cyd@stupidchicken.com>, Emacs Devel <emacs-devel@gnu.org>
Subject: Re: user-init-file source vs. compiled
Date: Fri, 2 Feb 2007 17:03:35 +0100	[thread overview]
Message-ID: <f7ccd24b0702020803g538abbd8vd8d28b20a7acd315@mail.gmail.com> (raw)
In-Reply-To: <jwvk5z060u7.fsf-monnier+emacs@gnu.org>

On 2/2/07, Stefan Monnier <monnier@iro.umontreal.ca> wrote:

> 10% smaller will result in a non-measurably faster load, and will still take
> 90% more disk space.  So what's the advantage again?

The wonderful, perhaps subjective feeling that it is loading faster :)

> I don't want to make it impossible to byte-compile your .emacs.  If that's
> really what you want, go for it.

I've been using Emacs for nine years and I just started to
byte-compile my .emacs a week ago, so it's not a matter of me "really
wanting". This thread was about a variable's description being
inaccurate (fortunately it is now fixed).

> I'm just saying that we should discourage
> people from doing that, because too many users think "oh Emacs takes a long
> time to start, I bet if I byte-compile it it'll start faster", but it turns
> out it's not faster and next time they forget to re-compile their .emacs
> they get bitten.

I've added this to my site-start.el:

(catch 'init-file
  (dolist (source-file '("~/.emacs.el" "~/.emacs." "~/_emacs.el"
                         "~/_emacs" "~/.emacs.d/init.el"))
    (when (file-exists-p source-file)
      (require 'bytecomp)
      (unless (fboundp 'time-less-p) (require 'time-date))
      (let ((byte-file (byte-compile-dest-file source-file)))
        (when (and (file-exists-p byte-file)
                   (time-less-p (nth 5 (file-attributes byte-file))
                                (nth 5 (file-attributes source-file))))
          (unless (byte-compile-file source-file)
            (setq init-file-user nil))))
      (throw 'init-file t))))

which recompiles my .emacs.el if needed (the compilation log is quite
visible, so I don't miss that something happened), with the added
benefit that .emacs(.elc?)? is not loaded if the compilation fails.

> It's not the most common problem on gnu.emacs.help, but
> it's sufficiently common that I think the potential very minor advantage(s)
> is just not worth it.

By all means, if you think users should not compile their .emacs
unless they know what they're doing, just add a prominent notice to
the relevant docs. You're talking about what should we recommend; I
was just talking about not misleading people, given the fact that
bytecompiling .emacs is *allowed*. I have no opinion on whether we
should en- or discourage bytecompiling the init file.

> OTOH I'm in favor of adding some kind of hack so that the .emacs file
> automatically goes through the byte-compiler's sanity checks when you save
> it (so they user might can warnings about using obsolete
> variables/functions).

That's a really nice idea.

                    /L/e/k/t/u

  reply	other threads:[~2007-02-02 16:03 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-02-01 15:10 user-init-file source vs. compiled Juanma Barranquero
2007-02-01 15:46 ` Lennart Borgman (gmail)
2007-02-01 16:07   ` Juanma Barranquero
2007-02-01 16:21     ` Lennart Borgman (gmail)
2007-02-01 17:04       ` Juanma Barranquero
2007-02-01 17:20         ` Lennart Borgman (gmail)
2007-02-01 18:18           ` Juanma Barranquero
2007-02-01 19:17 ` Stefan Monnier
2007-02-01 20:02   ` Chong Yidong
2007-02-01 22:41     ` Stefan Monnier
2007-02-01 23:03       ` Juanma Barranquero
2007-02-02 15:30         ` Stefan Monnier
2007-02-02 16:03           ` Juanma Barranquero [this message]
2007-02-02 16:30             ` Lennart Borgman (gmail)
2007-02-02 16:38               ` Juanma Barranquero
2007-02-02 17:15                 ` Lennart Borgman (gmail)
2007-02-02 17:21                   ` Juanma Barranquero
2007-02-02 16:47             ` Stefan Monnier
2007-02-02 17:08               ` Juanma Barranquero
2007-02-01 20:07   ` Juanma Barranquero
2007-02-01 20:50 ` Eli Zaretskii
2007-02-01 22:06   ` Juanma Barranquero

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

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

  git send-email \
    --in-reply-to=f7ccd24b0702020803g538abbd8vd8d28b20a7acd315@mail.gmail.com \
    --to=lekktu@gmail.com \
    --cc=cyd@stupidchicken.com \
    --cc=emacs-devel@gnu.org \
    --cc=monnier@iro.umontreal.ca \
    /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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.