unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@iro.umontreal.ca>
To: Martin Stjernholm  <mast@lysator.liu.se>,
	Alan Mackenzie <bug-cc-mode@gnu.org>
Cc: emacs-devel@gnu.org
Subject: Ordering in `source' property, and auto-loading of c-lang-defconsts
Date: Thu, 28 Aug 2014 10:09:13 -0400	[thread overview]
Message-ID: <jwvvbpc7mee.fsf-monnier+emacs@gnu.org> (raw)


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/


             reply	other threads:[~2014-08-28 14:09 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-28 14:09 Stefan Monnier [this message]
2014-08-31 21:23 ` Ordering in `source' property, and auto-loading of c-lang-defconsts 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=jwvvbpc7mee.fsf-monnier+emacs@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=bug-cc-mode@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=mast@lysator.liu.se \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).