GNU bug report logs - #19206
25.0.50; CC Mode tracks wrong source files

Previous Next

Packages: emacs, cc-mode;

Reported by: Sebastian Wiesner <swiesner <at> lunaryorn.com>

Date: Fri, 28 Nov 2014 10:21:02 UTC

Severity: normal

Found in version 25.0.50

Done: Alan Mackenzie <acm <at> muc.de>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Alan Mackenzie <acm <at> muc.de>
To: Sebastian Wiesner <swiesner <at> lunaryorn.com>
Cc: 19206 <at> debbugs.gnu.org
Subject: bug#19206: 25.0.50; CC Mode tracks wrong source files
Date: Tue, 2 Dec 2014 12:02:26 +0000
Hello, Sebastian.

On Tue, Dec 02, 2014 at 12:03:21PM +0100, Sebastian Wiesner wrote:

> > Am 30.11.2014 um 19:42 schrieb Alan Mackenzie <acm <at> muc.de>:

> > Hello, again, Sebastian.

> > On Fri, Nov 28, 2014 at 10:25:42PM -0000, Alan Mackenzie wrote:
> >> Hello, Sebastian.
> >> In article <mailman.14863.1417170074.1147.bug-gnu-emacs <at> gnu.org> you wrote:
> >>> CC Mode tracks wrong source files when a CC Mode derived mode is
> >>> installed non-interactively.

[ .... ]

> > OK.  The problem was that CC Mode was using the flag
> > `load-in-progress' to assume that a CC Mode file was being loaded,
> > for example by a `require' form inside a compilation of another CC
> > Mode file.  This assumption breaks down when another file, such as
> > cc-miscompile.el, while loading, initiates compilation of a CC Mode
> > derivative.

[ .... ]

> > No, that wouldn't work.  What I've implemented is when both loading
> > and byte-compilation are active at the same time, CC Mode walks down
> > the lisp stack to discover which one of them is actually active.

> Well, if you say… I find this “solution” horrifying, but I am probably
> just unable to appreciate the full complexity of this issue.

It is horrifying.  I spent quite some time over the weekend searching for
a better solution, without success.  The issue is quite simple: when
loading and compiling are nested in some unknown order, how do you
determine which of them is the "innermost" activity?

But, then again, maybe I could bind the "compilation flags" to nil around
each invocation of `load' inside the CC Mode compilation system.  Yes,
I'll give that a try.

> > Please try the following patch, which seems to work in the test case you
> > supplied, in the real situation, and let me know how well it works.  The
> > d-mode.elc produced can be successfully loaded into the Emacs that built
> > it.

> Do I need to build a patched Emacs to try it?

You need to rebuild CC Mode, but not necessarily the Emacs core.  This
should do the job:

    emacs -Q -batch -f batch-byte-compile path/to/lisp/progmodes/cc-*.el

, or you could just do a `make' from the main Emacs directory, possibly
deleting cc-*.elc first, just to make sure.

But feel free to wait until I've tried the alternative, better, approach
above.  I'll get back to you later.

-- 
Alan Mackenzie (Nuremberg, Germany).




This bug report was last modified 10 years and 134 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.