From: lee <lee@yun.yagibdah.de>
To: help-gnu-emacs@gnu.org
Subject: Re: setting the mode of a buffer
Date: Sat, 15 Mar 2014 22:12:56 +0100 [thread overview]
Message-ID: <8761nfupwn.fsf@yun.yagibdah.de> (raw)
In-Reply-To: <jwvmwgu1e70.fsf-monnier+gmane.emacs.help@gnu.org> (Stefan Monnier's message of "Thu, 13 Mar 2014 08:26:24 -0400")
Stefan Monnier <monnier@iro.umontreal.ca> writes:
>> 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.
Awesome --- it means I just have to do it right and use functions to set
up things and don`t need to unload the mode anymore :)
I got this mode from somewhere quite a while ago, and I think it isn`t
done right. There isn`t anything to disable it, either.
--
Knowledge is volatile and fluid. Software is power.
next prev parent reply other threads:[~2014-03-15 21:12 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <mailman.16657.1394156425.10748.help-gnu-emacs@gnu.org>
2014-03-07 8:47 ` setting the mode of a buffer Joost Kremers
2014-03-07 11:28 ` lee
[not found] ` <mailman.16664.1394193871.10748.help-gnu-emacs@gnu.org>
2014-03-12 22:19 ` Joost Kremers
2014-03-13 12:26 ` Stefan Monnier
2014-03-15 21:12 ` lee [this message]
2014-03-15 21:09 ` lee
[not found] ` <mailman.17152.1394713615.10748.help-gnu-emacs@gnu.org>
2014-03-17 11:17 ` Joost Kremers
2014-03-07 0:10 lee
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=8761nfupwn.fsf@yun.yagibdah.de \
--to=lee@yun.yagibdah.de \
--cc=help-gnu-emacs@gnu.org \
/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 external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.