[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: which one to use: custom-set-variables, customize-set-variable, or c
From: |
Alan Schmitt |
Subject: |
Re: which one to use: custom-set-variables, customize-set-variable, or customize-set-value? |
Date: |
Mon, 30 Nov 2015 16:44:59 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.5 (darwin) |
On 2015-11-30 16:20, Drew Adams <drew.adams@oracle.com> writes:
> Here is one example of a :set function (from character-fold+.el)
> that does something more than just change the value:
>
> (defcustom char-fold-symmetric nil
> "Non-nil means char-fold searching treats equivalent chars the same.
> That is, use of any of a set of char-fold equivalent chars in a search
> string finds any of them in the text being searched.
>
> If nil then only the \"base\" or \"canonical\" char of the set matches
> any of them. The others match only themselves, even when char-folding
> is turned on."
> :set (lambda (sym defs)
> (custom-set-default sym defs)
> (update-char-fold-table))
> :type 'boolean :group 'isearch)
>
> Standard function `custom-set-default' is the usual way to change
> the variable's (default) value, so this :set function firt calls
> that. Then it calls a function that changes some other state,
> taking the new variable value into account.
Ah, very interesting. Thanks for the explanation.
Alan
--
OpenPGP Key ID : 040D0A3B4ED2E5C7
Athmospheric CO₂ (Updated November 29, 2015, Mauna Loa Obs.): 400.37 ppm
signature.asc
Description: PGP signature