emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Ordering in `source' property, and auto-loading of c-lang-defconsts


From: Stefan Monnier
Subject: Ordering in `source' property, and auto-loading of c-lang-defconsts
Date: Thu, 28 Aug 2014 10:09:13 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4.50 (gnu/linux)

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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]