unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@iro.umontreal.ca>
To: Vyacheslav Gonakhchyan <ytriffy@gmail.com>
Cc: "Eric M. Ludlam" <ericludlam@gmail.com>, emacs-devel@gnu.org
Subject: Re: Emacs 24 semantic C++ completion problem
Date: Wed, 04 Jan 2012 23:43:31 -0500	[thread overview]
Message-ID: <jwvmxa2n4tv.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <87aa65hpcb.fsf@engster.org> (David Engster's message of "Mon, 02 Jan 2012 20:33:08 +0100")

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


        Stefan



      reply	other threads:[~2012-01-05  4:43 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-29 18:32 Emacs 24 semantic C++ completion problem Vyacheslav Gonakhchyan
2011-12-29 22:03 ` Eric M. Ludlam
2011-12-30  9:22   ` David Engster
2011-12-30 11:31     ` Vyacheslav Gonakhchyan
2011-12-30 11:57       ` David Engster
2011-12-30 15:00         ` Vyacheslav Gonakhchyan
2011-12-30 16:51           ` David Engster
2011-12-30 19:52             ` Vyacheslav Gonakhchyan
2011-12-30 20:06               ` David Engster
2011-12-30 21:14                 ` Vyacheslav Gonakhchyan
2011-12-30 22:22                   ` David Engster
2011-12-31  7:05                     ` Vyacheslav Gonakhchyan
2011-12-31 12:07                       ` David Engster
2011-12-31 12:16                         ` David Engster
2012-01-01 22:43                         ` Stefan Monnier
2012-01-02 19:33                           ` David Engster
2012-01-05  4:43                             ` Stefan Monnier [this message]

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=jwvmxa2n4tv.fsf-monnier+emacs@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=emacs-devel@gnu.org \
    --cc=ericludlam@gmail.com \
    --cc=ytriffy@gmail.com \
    /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).