Hi, Richard!

On Sunday 26th August 2007 you wrote:

>    > For instance, if you put the macros etc. into one file whose name
>    > comes alphabetically before the rest, maybe everything will work
>    > reliably.

>    Surely the right tool for this job is the (or a?) makefile?  If we're
>    going to fix the problem, we might as well fix it properly.

>A fix in the makefile is better than no fix, but it is troublesome
>because it would require major changes in something which is now very
>simple.


Is "major" not an exaggeration?  The sort of change I suggested (recording
the precise dependencies between the cc-*.elc files) would be fairly
localised in effect.  It could set a precedent for further changes,
though.

I think the makefile is simple because it doesn't reflect the inherent
complexity of Emacs (or, at least, of CC Mode), and this is why compiling
CC Mode is troublesome.

>Practically speaking, we would be much better off if you could
>solve this by changes in the cc-mode files themselves.

I can't see how this can be done.  The case I am thinking about is when a

change happens in cc-langs.el, say the introduction of a new language
variable c-foo - this is what I changed in a bug fix last week.  The
sequence of compilations now needed is this:
(i) Compile cc-langs.el; this puts the details of c-foo into a macro in
  cc-langs.elc.
(ii) Compile cc-engine.el and cc-mode.el; from the cc-langs macro, the
  first generates
    (defvar c-foo "Doc string.")
  in cc-engine.elc.  The second generates (in effect), the following in
  CC Mode's initialisation in cc-mode.elc:

    (setq cc-foo
     (cond
      ((eq major mode 'c-mode) "c-foo")
      ((eq major mode 'c++-mode) "c++-foo")
      .....))
     
0         1         2         3         4         5         6         7  3
Thus changing cc-langs.el makes a recompiliation of cc-{mode,engine}.el
necessary.  I can't see how this can be done sensibly within the CC Mode
files.  Possibly, cc-{mode,engine}.el could, at compilation time, get the
timestamps for cc-langs.el{,c}, compare them, and recursively compile

cc-langs.el if necessary.  But this is a horrible idea.

Or were you thinking of a different troublesome case?

--
Alan Mackenzie (Nuremberg, Germany).