From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.cc-mode.general,gmane.emacs.devel Subject: Ordering in `source' property, and auto-loading of c-lang-defconsts Date: Thu, 28 Aug 2014 10:09:13 -0400 Message-ID: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1409235006 26870 80.91.229.3 (28 Aug 2014 14:10:06 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 28 Aug 2014 14:10:06 +0000 (UTC) Cc: emacs-devel@gnu.org To: Martin Stjernholm , Alan Mackenzie Original-X-From: cc-mode-help-bounces@lists.sourceforge.net Thu Aug 28 16:10:00 2014 Return-path: Envelope-to: sf-cc-mode-help@m.gmane.org Original-Received: from lists.sourceforge.net ([216.34.181.88]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1XN0Oa-0001am-EN for sf-cc-mode-help@m.gmane.org; Thu, 28 Aug 2014 16:09:48 +0200 Original-Received: from localhost ([127.0.0.1] helo=sfs-ml-1.v29.ch3.sourceforge.com) by sfs-ml-1.v29.ch3.sourceforge.com with esmtp (Exim 4.76) (envelope-from ) id 1XN0OP-0004jc-A9; Thu, 28 Aug 2014 14:09:37 +0000 Original-Received: from sog-mx-1.v43.ch3.sourceforge.com ([172.29.43.191] helo=mx.sourceforge.net) by sfs-ml-1.v29.ch3.sourceforge.com with esmtp (Exim 4.76) (envelope-from ) id 1XN0OO-0004jW-6C for cc-mode-help@lists.sourceforge.net; Thu, 28 Aug 2014 14:09:36 +0000 Received-SPF: softfail (sog-mx-1.v43.ch3.sourceforge.com: transitioning domain of iro.umontreal.ca does not designate 208.118.235.10 as permitted sender) client-ip=208.118.235.10; envelope-from=monnier@iro.umontreal.ca; helo=fencepost.gnu.org; Original-Received: from fencepost.gnu.org ([208.118.235.10]) by sog-mx-1.v43.ch3.sourceforge.com with esmtps (TLSv1:AES256-SHA:256) (Exim 4.76) id 1XN0OM-0006iy-6V for cc-mode-help@lists.sourceforge.net; Thu, 28 Aug 2014 14:09:36 +0000 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:54277) by fencepost.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1XN0OG-0001b8-H9 for bug-cc-mode@gnu.org; Thu, 28 Aug 2014 10:09:28 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XN0O7-00014c-Ts for bug-cc-mode@gnu.org; Thu, 28 Aug 2014 10:09:28 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.1 required=5.0 tests=BAYES_50,RCVD_IN_DNSWL_LOW autolearn=disabled version=3.3.2 Original-Received: from ironport2-out.teksavvy.com ([206.248.154.181]:33041) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XN0O7-00013b-Qx; Thu, 28 Aug 2014 10:09:19 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AvEGAIDvNVPAqyTi/2dsb2JhbABZgwYBg0m5A4c6gRcXdIMCHAcpJiYYDSQBiAvSGReOIliEPwSrA4NMIYEs X-IPAS-Result: AvEGAIDvNVPAqyTi/2dsb2JhbABZgwYBg0m5A4c6gRcXdIMCHAcpJiYYDSQBiAvSGReOIliEPwSrA4NMIYEs X-IronPort-AV: E=Sophos;i="4.97,753,1389762000"; d="scan'208";a="88055959" Original-Received: from 192-171-36-226.cpe.pppoe.ca (HELO pastel.home) ([192.171.36.226]) by ironport2-out.teksavvy.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 28 Aug 2014 10:09:13 -0400 Original-Received: by pastel.home (Postfix, from userid 20848) id 3D14964139; Thu, 28 Aug 2014 10:09:13 -0400 (EDT) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4.50 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 206.248.154.181 X-Spam-Score: 1.0 (+) X-Spam-Report: Spam Filtering performed by mx.sourceforge.net. See http://spamassassin.org/tag/ for more details. 1.0 SPF_SOFTFAIL SPF: sender does not match SPF record (softfail) X-Headers-End: 1XN0OM-0006iy-6V X-BeenThere: cc-mode-help@lists.sourceforge.net X-Mailman-Version: 2.1.9 Precedence: list List-Id: "Bug reports, feature requests, and general talk about CC Mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: cc-mode-help-bounces@lists.sourceforge.net Xref: news.gmane.org gmane.emacs.cc-mode.general:6430 gmane.emacs.devel:173866 Archived-At: I'm trying to understand some of cc-defs.el and cc-langs.el code and while there are very many questions, I'll stick to a fairly limited subset for now. Hopefully once that's cleared, it'll be easier for me to guess what the rest is about: - What the relationship between the `source' property and the `symbol-value' of the symbols that are in the c-lang-constants obarray? - Do those symbols hold other information (I don't see another property being used, nor does the symbol-function slot seem to be used, but maybe I just missed it)? - It seems that the `source' property contain an list of (FILE . LANG-ALIST) entries (where each LANG-ALIST is a list of (MODES . CODE)). Right? Here's the main question: - Why is this FILE needed? Why is it important to preserve ordering between various FILEs? Why do we sometimes `load' those FILEs (in c-find-assignment-for-mode)? Which kind of concrete situation is this supposed to address? My vague understanding is that we want to allow c-lang-defconst to be called (for the same variable) from different files for different major modes. Of course, for those modes supported natively by CC-mode, they're all in cc-langs.el so there's only ever a single FILE there and it never needs to be (auto)loaded. But even for modes distributed separately [BTW, it'd be good to try and keep track of them to some extent, which reminds me I should do the same for SMIE], I don't see why ordering is important (I mean I understand why ordering is important w.r.t the derivation hierarchy, but not w.r.t FILEs) nor in which circumstance you'd already know about the existence of a call to c-lang-defconst in some FILE yet that FILE isn't loaded yet (i.e. why/when would you know and need to (auto)load FILE from c-find-assignment-for-mode)? Stefan ------------------------------------------------------------------------------ Slashdot TV. Video for Nerds. Stuff that matters. http://tv.slashdot.org/