emacs-devel
[Top][All Lists]
Advanced

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

Recursive compilation?


From: Lars Magne Ingebrigtsen
Subject: Recursive compilation?
Date: Tue, 31 May 2011 22:44:09 +0200
User-agent: Gnus/5.110018 (No Gnus v0.18) Emacs/24.0.50 (gnu/linux)

Sometimes after doing a "bzr update", the Emacs Lisp files won't build
because a new macro is needed from a .el file, but the old .elc file
already exists, so it requires the .elc file, and fails compiling the
.el file, and I delete all the .elc files, and then build everything.

Which takes forever!

So I was wondering whether it would be feasible to compile required
files recursively.

Basically, I envision a function like `M-x
byte-compile-file-recursively' which would work just like the normal
one, but would instrument `require' to call
`byte-compile-file-recursively' on all files that it tries to load and
that are older than their .elc counterparts.

The obvious "gotcha" here is that one probably shouldn't try to
(recursively) byte-compile files in directories that we don't have write
access to.  So if somebody has set their load-path to my directory, and
I have an old .elc file there, then this function shouldn't try to
compile that file, too.

The other caveat is that Makefiles typically first mark all files that
are to be compiled, and then compile them.  This would then possibly
lead to some files being compiled twice.  However, that could be worked
around by `byte-compile-file-recursively' not compiling a file that it's
been asked to compile if the .elc file is newer than the .el file.

So...

I have a feeling that this won't be very difficult to implement, but it
needs meddling with the C layer, since `require' is a C function.  But I
think it would make compiling Emacs after a "bzr update" a lot less
likely to break.

-- 
(domestic pets only, the antidote for overdose, milk.)
  bloggy blog http://lars.ingebrigtsen.no/




reply via email to

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