From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Alan Schmitt Newsgroups: gmane.emacs.help 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 Message-ID: References: <99f3716d-513e-42b5-b43b-fafca9c81f5a@default> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" X-Trace: ger.gmane.org 1448898331 25928 80.91.229.3 (30 Nov 2015 15:45:31 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 30 Nov 2015 15:45:31 +0000 (UTC) Cc: help-gnu-emacs@gnu.org To: Drew Adams Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon Nov 30 16:45:23 2015 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1a3Qdm-0005tW-Hz for geh-help-gnu-emacs@m.gmane.org; Mon, 30 Nov 2015 16:45:22 +0100 Original-Received: from localhost ([::1]:41643 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a3Qdl-0008EX-Kp for geh-help-gnu-emacs@m.gmane.org; Mon, 30 Nov 2015 10:45:21 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:44691) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a3QdW-0008Ag-Jj for help-gnu-emacs@gnu.org; Mon, 30 Nov 2015 10:45:10 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a3QdR-0001Uk-Lb for help-gnu-emacs@gnu.org; Mon, 30 Nov 2015 10:45:06 -0500 Original-Received: from mail3-relais-sop.national.inria.fr ([192.134.164.104]:49445) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a3QdR-0001Ub-F0 for help-gnu-emacs@gnu.org; Mon, 30 Nov 2015 10:45:01 -0500 X-IronPort-AV: E=Sophos;i="5.20,364,1444687200"; d="asc'?scan'208";a="155631691" Original-Received: from charm-ecran.irisa.fr (HELO top.local) ([131.254.101.83]) by mail3-relais-sop.national.inria.fr with ESMTP/TLS/AES128-GCM-SHA256; 30 Nov 2015 16:44:59 +0100 In-Reply-To: <99f3716d-513e-42b5-b43b-fafca9c81f5a@default> (Drew Adams's message of "Mon, 30 Nov 2015 07:20:27 -0800 (PST)") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (darwin) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 192.134.164.104 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:108260 Archived-At: --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 2015-11-30 16:20, Drew Adams 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 =2D-=20 OpenPGP Key ID : 040D0A3B4ED2E5C7 Athmospheric CO=E2=82=82 (Updated November 29, 2015, Mauna Loa Obs.): 400.3= 7 ppm --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQEcBAEBCgAGBQJWXG77AAoJEAQNCjtO0uXHf8cH/AuEJ45WI4tUsUNfJcVLlf/h w+/3Er3nkN4asycZUFJtAo52DzaeR9nV1jTH/1Bg83w+vNR2+4WjRiz4uy7t/W/z ez6e+uRHLgzAIq6Vgr4wBG6KQIi+AemA+8w1TB1SHY5m6RVjBhP2a/A9zB8vcLTd +gHd2TyvVD4LLQv1ED1rEgU4BtxGzTukFwFuJdOr+3P3WP9hzH083pXrtZ+/YGaN HghQnhPMeE2hhhWoaHSSF0aAY8IfQf4sz3bhyJE8cKb5yLks7d+9AS6in7V8VUjc pjueyDjiOLZxznZ5IOp3SJMTh/NJCS8zBp1tIttp5Mo7KstfgJ1OZsnlvATCSDI= =PbV9 -----END PGP SIGNATURE----- --=-=-=--