unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Ordering in `source' property, and auto-loading of c-lang-defconsts
@ 2014-08-28 14:09 Stefan Monnier
  2014-08-31 21:23 ` Alan Mackenzie
  0 siblings, 1 reply; 11+ messages in thread
From: Stefan Monnier @ 2014-08-28 14:09 UTC (permalink / raw)
  To: Martin Stjernholm, Alan Mackenzie; +Cc: emacs-devel


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/


^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2014-09-08 18:52 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-08-28 14:09 Ordering in `source' property, and auto-loading of c-lang-defconsts Stefan Monnier
2014-08-31 21:23 ` Alan Mackenzie
2014-09-01  0:52   ` Stefan Monnier
2014-09-01 22:43     ` Avoiding loading cc-langs (was: Ordering in `source' property, and auto-loading of c-lang-defconsts) Stefan Monnier
2014-09-04  2:38       ` Avoiding loading cc-langs Stefan Monnier
2014-09-06 11:10         ` Alan Mackenzie
2014-09-06 10:12       ` Avoiding loading cc-langs (was: Ordering in `source' property, and auto-loading of c-lang-defconsts) Alan Mackenzie
2014-09-08  1:51         ` Avoiding loading cc-langs Stefan Monnier
2014-09-08 15:46           ` Glenn Morris
2014-09-08 18:45             ` Stefan Monnier
2014-09-08 18:52               ` Glenn Morris

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).