[Top][All Lists]

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

Re: Emacs 24 semantic C++ completion problem

From: Stefan Monnier
Subject: Re: Emacs 24 semantic C++ completion problem
Date: Wed, 04 Jan 2012 23:43:31 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.92 (gnu/linux)

>>> 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.

Real "no-no"s are hard to come by, and indeed autoloaded defcustoms are
easy to find in Emacs.
The best solution depends on how V is expected to change in time and on
what kind of changes the user is expected to apply to the value.

Note that if the var is modified via Custom, then Custom will store the
chosen value and further changes to V's default will be ignored, so if
that's considered bad, maybe it shouldn't be a defcustom at all.

If elements are almost never removed from that var, maybe splitting it
into two (a defcustom that defaults to nil and defvar which holds the
default set) will make things easier.


reply via email to

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