From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Alan Mackenzie Newsgroups: gmane.emacs.bugs Subject: bug#19206: 25.0.50; CC Mode tracks wrong source files Date: Tue, 2 Dec 2014 12:02:26 +0000 Message-ID: <20141202120226.GA4018@acm.acm> References: <20141128222542.60510.qmail@mail.muc.de> <20141130184221.GA12974@acm.acm> <9C8C5538-BC19-4094-832C-3F3259DE37A5@lunaryorn.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: ger.gmane.org 1417521811 5800 80.91.229.3 (2 Dec 2014 12:03:31 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 2 Dec 2014 12:03:31 +0000 (UTC) Cc: 19206@debbugs.gnu.org To: Sebastian Wiesner Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Dec 02 13:03:25 2014 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1XvmAv-00084p-As for geb-bug-gnu-emacs@m.gmane.org; Tue, 02 Dec 2014 13:03:25 +0100 Original-Received: from localhost ([::1]:36308 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XvmAu-0003r5-Up for geb-bug-gnu-emacs@m.gmane.org; Tue, 02 Dec 2014 07:03:24 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:49039) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XvmAm-0003qg-47 for bug-gnu-emacs@gnu.org; Tue, 02 Dec 2014 07:03:21 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XvmAh-0007e7-13 for bug-gnu-emacs@gnu.org; Tue, 02 Dec 2014 07:03:16 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:54247) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XvmAY-0007bV-Hb; Tue, 02 Dec 2014 07:03:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1XvmAY-0004UH-5Y; Tue, 02 Dec 2014 07:03:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Alan Mackenzie Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org, bug-cc-mode@gnu.org Resent-Date: Tue, 02 Dec 2014 12:03:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 19206 X-GNU-PR-Package: emacs,cc-mode X-GNU-PR-Keywords: Original-Received: via spool by 19206-submit@debbugs.gnu.org id=B19206.141752177717239 (code B ref 19206); Tue, 02 Dec 2014 12:03:02 +0000 Original-Received: (at 19206) by debbugs.gnu.org; 2 Dec 2014 12:02:57 +0000 Original-Received: from localhost ([127.0.0.1]:51460 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XvmAT-0004Tz-5p for submit@debbugs.gnu.org; Tue, 02 Dec 2014 07:02:57 -0500 Original-Received: from colin.muc.de ([193.149.48.1]:32994 helo=mail.muc.de) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XvmAP-0004Tn-KI for 19206@debbugs.gnu.org; Tue, 02 Dec 2014 07:02:54 -0500 Original-Received: (qmail 265 invoked by uid 3782); 2 Dec 2014 12:02:52 -0000 Original-Received: from acm.muc.de (pD951A056.dip0.t-ipconnect.de [217.81.160.86]) by colin.muc.de (tmda-ofmipd) with ESMTP; Tue, 02 Dec 2014 13:02:51 +0100 Original-Received: (qmail 4388 invoked by uid 1000); 2 Dec 2014 12:02:26 -0000 Content-Disposition: inline In-Reply-To: <9C8C5538-BC19-4094-832C-3F3259DE37A5@lunaryorn.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-Delivery-Agent: TMDA/1.1.12 (Macallan) X-Primary-Address: acm@muc.de X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:96796 Archived-At: 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 : > > Hello, again, Sebastian. > > On Fri, Nov 28, 2014 at 10:25:42PM -0000, Alan Mackenzie wrote: > >> Hello, Sebastian. > >> In article 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).