unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@iro.umontreal.ca>
To: emacs-devel@gnu.org
Subject: Re: Recursive compilation?
Date: Tue, 31 May 2011 22:38:43 -0300	[thread overview]
Message-ID: <jwv62oqpc6e.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <m3hb8azfa8.fsf@quimbies.gnus.org> (Lars Magne Ingebrigtsen's message of "Wed, 01 Jun 2011 00:17:03 +0200")

>> I'm personally using a different hack which doesn't solve all those
>> problems either but is simple and doesn't suffer from as many problems
>> in my experience: prefer loading the .el file if it's more recent.
> I was thinking that perhaps if file a.el requires a macro from b.el, and
> b.el isn't compiled, then a.elc would end up in a somewhat less compiled
> state than it otherwise would?

When a.el calls an inlinable function from b.el, then the result will
indeed be different (even tho in both cases the function will be
inlined), yet in most cases it shouldn't make much of a difference.

> But if that's not the case, then perhaps `require', when run via
> `byte-compile-file', should just always load the .el file if it's more
> recent?  That certainly sounds easy enough to implement --
> `byte-compile-file' could just bind a variable to signal that it wanted
> this behaviour.

I use the patch below,


        Stefan


=== modified file 'lisp/emacs-lisp/bytecomp.el'
--- lisp/emacs-lisp/bytecomp.el	2011-05-30 17:14:19 +0000
+++ lisp/emacs-lisp/bytecomp.el	2011-05-31 20:48:24 +0000
@@ -1713,6 +1720,12 @@
   (setq byte-compile-last-logged-file nil)
   (let ((byte-compile-current-file filename)
         (byte-compile-current-group nil)
+        ;; Prefer source files over compiled files.  This is so that when
+        ;; several files are changed and recompiled, each new file is
+        ;; properly recompiled with the new macros in the other new files.
+        (load-suffixes (sort (copy-sequence load-suffixes)
+                             (lambda (s1 s2) (and (string-match "\\.elc\\b" s2)
+                                             (string-match "\\.el\\b" s1)))))
 	(set-auto-coding-for-load t)
 	target-file input-buffer output-buffer
 	byte-compile-dest-file)



  reply	other threads:[~2011-06-01  1:38 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-31 20:44 Recursive compilation? Lars Magne Ingebrigtsen
2011-05-31 21:52 ` Stefan Monnier
2011-05-31 22:17   ` Lars Magne Ingebrigtsen
2011-06-01  1:38     ` Stefan Monnier [this message]
2011-06-01 11:48       ` Lars Magne Ingebrigtsen
2011-06-01 20:14 ` Dimitri Fontaine
2011-06-03 21:55   ` Lars Magne Ingebrigtsen
2011-06-04  6:29     ` Eli Zaretskii
2011-06-04 15:54       ` Lars Magne Ingebrigtsen
2011-06-04 16:08         ` Eli Zaretskii
2011-06-04 17:50           ` Glenn Morris
2011-06-06 20:05           ` Stefan Monnier
2011-06-09 17:51             ` Lars Magne Ingebrigtsen
2011-06-04 17:48         ` Glenn Morris
2011-06-06 20:46     ` Dimitri Fontaine
2011-06-07  0:23       ` Daniel Colascione

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=jwv62oqpc6e.fsf-monnier+emacs@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=emacs-devel@gnu.org \
    /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).