emacs-devel
[Top][All Lists]
Advanced

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

Re: custom-set-variables fails to set variable


From: Richard M. Stallman
Subject: Re: custom-set-variables fails to set variable
Date: Sat, 12 Nov 2005 16:21:52 -0500

       A more automatic solution could be: define-derived-mode
       could automatically produce an autoload definition
       of the defvar.  That would solve the problem, right?
       It is not normal for update-file-autoloads to generate
       an autoload with no autoload cookie, but we could do that.

    Unless I am confused, this also has the disadvantage that it is not
    going to work for uses of define-derived-mode in third party packages.

You are right.  So that approach won't work.

Meanwhile, another point occurs to me.
Why is the defvar that comes from the define-derived-mode
executed before the defcustom?  Could that be solved
by putting the defcustom earlier in the file?

Another idea: replace the defvar with a put call that will put on a
variable-documentation property.

    Yes, but both the manual and the automated solutions have the
    potential for problems.  Somebody supplying a defcustom may want a
    tailor-made docstring for the defcustom, mentioning typical uses for
    the hook and the defvar's docstring could overwrite that.

We don't want the automatically generated doc string to override
an explicit one, so perhaps the define-derived-mode should generate

  (unless (get VAR 'variable-documentation)
    (put VAR 'variable-documentation STRING))




reply via email to

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