From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "B.V. Raghav" Newsgroups: gmane.emacs.help Subject: Re: which one to use: custom-set-variables, customize-set-variable, or customize-set-value? Date: Mon, 14 Dec 2015 08:14:23 +0530 Organization: Indian Institute of Technology Kanpur Message-ID: <87vb81sq9k.fsf@think.bvr.lan> References: <99f3716d-513e-42b5-b43b-fafca9c81f5a@default> <87twnorgig.fsf@metapensiero.it> <63e721db-3901-4017-a254-a679a4d8d04e@default> <87lh90nk3u.fsf@metapensiero.it> <782dca8a-9b67-49f4-bd41-20e80f94ad9e@default> <20151213081701.GA25363@tuxteam.de> <1bb3e90b-9e31-4450-aa11-4c475ffd081a@default> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1450102926 8814 80.91.229.3 (14 Dec 2015 14:22:06 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 14 Dec 2015 14:22:06 +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 Dec 14 15:21:56 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 1a8Tzs-0003OL-Ip for geh-help-gnu-emacs@m.gmane.org; Mon, 14 Dec 2015 15:21:04 +0100 Original-Received: from localhost ([::1]:60296 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a8Tzr-00086v-Q3 for geh-help-gnu-emacs@m.gmane.org; Mon, 14 Dec 2015 09:21:03 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:54241) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a8J7q-0002Ko-Tr for help-gnu-emacs@gnu.org; Sun, 13 Dec 2015 21:44:35 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a8J7n-0000NO-NT for help-gnu-emacs@gnu.org; Sun, 13 Dec 2015 21:44:34 -0500 Original-Received: from mail3.iitk.ac.in ([202.3.77.190]:50252) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a8J7n-0000NB-9p for help-gnu-emacs@gnu.org; Sun, 13 Dec 2015 21:44:31 -0500 Original-Received: from smtp.cc.iitk.ac.in (smtp.cc.iitk.ac.in [172.31.1.22]) by mail3.iitk.ac.in (Postfix) with ESMTP id 6A06A100009E; Mon, 14 Dec 2015 08:14:23 +0530 (IST) Original-Received: from think.bvr.lan (unknown [172.20.220.29]) (Authenticated sender: bvraghav) by smtp.cc.iitk.ac.in (Postfix) with ESMTPA id 5D5E948; Mon, 14 Dec 2015 08:14:23 +0530 (IST) In-Reply-To: <1bb3e90b-9e31-4450-aa11-4c475ffd081a@default> (Drew Adams's message of "Sun, 13 Dec 2015 09:32:14 -0800 (PST)") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 202.3.77.190 X-Mailman-Approved-At: Mon, 14 Dec 2015 09:20:49 -0500 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:108404 Archived-At: Drew Adams writes: >> > As I said, you can certainly do as you suggest. My suggestion is >> > to clearly show in your init file how you are setting the value. >> > Including for different Emacs versions - so you are aware of such >> > changes when you read your code later. But it's just a suggestion. >> >> Here I was trying to make a case for some kind of "generic setter" >> which knows what the right thing is. Of course, such a generic setter >> wouldn't be half as valuable without a context. I wouldn't do it in >> my init file as of now, where it's not "usual". > > BTW, maybe I should also have made clear that I think the best > practice, in general, is to use the Customize UI and let it > manage user options and faces, and to force it to do so in a > separate `custom-file' and not in the init file. > > While one can call Customize functions (`customize-set-variable') > from Lisp code, my advice is to save that for commands you write > that dynamically manipulate (set and possibly save) options and > faces - as opposed to using such functions in an init file. > > (Just one opinion.) I second that. -- (B.V. Raghav) Ph.D. Student, Design Programme Indian Institute of Technology Kanpur Ph: +91-9450988137