[Top][All Lists]

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

Re: Emacs 24 semantic C++ completion problem

From: David Engster
Subject: Re: Emacs 24 semantic C++ completion problem
Date: Mon, 02 Jan 2012 20:33:08 +0100
User-agent: Gnus/5.110018 (No Gnus v0.18) Emacs/24.0.92 (darwin)

Stefan Monnier writes:
>> We used to have the `semantic-lex-c-preprocessor-symbol-file' defcustom
>> autoloaded, but that would never get past the Monnier-filter. I'm not
> Could someone explain to me what is the problem?

The general problem is this: Say you have a custom variable V, belonging
to package P, which is initialized with some list of filenames. When you
require P, it will use V's value to set up some things, but will only do
so once. How should the user add further filenames to V in his .emacs?
If he first requires P, then any changes to V will be moot. Hence he has
to look up the default value of V and then use setq-default, with the
additional files added. The simplest solution (or rather: cop-out) is to
autoload the defcustom, but I remember you saying that this is a no-no.

[To add a few details: `semantic-lex-c-preprocessor-symbol-file' is a
variable containing a list of C header files from which pre-processor
#defines will be included when parsing further C(++) files. Since
Semantic goes to great lengths to minimize startup time (a common
complaint back in the days), this will only be done when
semantic/bovine/c is actually loaded. It then parses those files and
populates `semantic-lex-c-preprocessor-symbol-map' with the macros it
finds, which is a c-mode local variable. Now, you may say that this is
bad design, and I tend to agree, but setting up the c-mode parser is
a pretty delicate issue.]


reply via email to

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