help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: setting the mode of a buffer


From: Stefan Monnier
Subject: Re: setting the mode of a buffer
Date: Thu, 13 Mar 2014 08:26:24 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux)

> Reevaluating a defcustom will normally reset the value of the variable,
> so there's no need to unload and reload the file. 

C-h f defcustom

   [...]
   :initialize
        VALUE should be a function used to initialize the
        variable.  It takes two arguments, the symbol and value
        given in the `defcustom' call.  The default is
        `custom-initialize-reset'.
   [...]

C-h f custom-initialize-reset

   [...]
   The value is either the symbol's current value
    (as obtained using the `:get' function), if any,
   [...]

So, no, re-evaluating a defcustom will typically leave the variable at its
old value.

M-: (progn (defcustom sm-t 1 "hhaha") (defcustom sm-t 2 "hhaha") sm-t) RET

returns 1, not 2.  IOW, it works more like defvar than like defconst.


        Stefan




reply via email to

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