(defvar rogue-var) ;; to silence the compiler for the next line.
        (unless (default-boundp rogue-var) (setq rogue-var nil))
        (defcustom rogue-var ...
        ...
          :initialize 'custom-initialize-set
        ...)

    Suppose we implement a keyword in defcustom that causes it to generate
    all that.  That will look nice in the source code, but at execution
    time it will be equivalent to the above.

    I think that would be clearly better than all three of the above
    solutions.

Sounds great to me.

Or what about just reusing keyword :initialize, perhaps redefining its
behavior to recognize this special case? After all, this is about
initializing the value. The case could be distinguished by supplying
:initialize with an argument `custom-initialize-set-runtime' (or some better
name).

Ignore that suggestion if it makes little sense - I'm no pro on defcustom.

Anyway, I like the idea of implementing Luc's "ugly" code via a defcustom
keyword. Perhaps someone will point out problems with it, but I can't think
of any offhand.

Question: How will users see/detect/understand this behavior? What will they
see in "Show initial Lisp expression"? I assume the keyword behavior would
be documented, but I'm wondering what users will see in Customize.



_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-devel

Reply via email to