From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Lele Gaifax 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 09:28:37 +0100 Organization: Nautilus Entertainments Message-ID: <87vb81wi16.fsf@metapensiero.it> 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; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: ger.gmane.org 1450081766 21740 80.91.229.3 (14 Dec 2015 08:29:26 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 14 Dec 2015 08:29:26 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon Dec 14 09:29:18 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 1a8OVR-0007uS-Mx for geh-help-gnu-emacs@m.gmane.org; Mon, 14 Dec 2015 09:29:17 +0100 Original-Received: from localhost ([::1]:58410 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a8OVQ-0007h4-QL for geh-help-gnu-emacs@m.gmane.org; Mon, 14 Dec 2015 03:29:16 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:51991) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a8OVB-0007ga-Ig for help-gnu-emacs@gnu.org; Mon, 14 Dec 2015 03:29:02 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a8OV7-0007QO-Hx for help-gnu-emacs@gnu.org; Mon, 14 Dec 2015 03:29:01 -0500 Original-Received: from plane.gmane.org ([80.91.229.3]:51332) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a8OV7-0007QI-AT for help-gnu-emacs@gnu.org; Mon, 14 Dec 2015 03:28:57 -0500 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1a8OV5-0007Gy-Ee for help-gnu-emacs@gnu.org; Mon, 14 Dec 2015 09:28:55 +0100 Original-Received: from 151.62.33.97 ([151.62.33.97]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 14 Dec 2015 09:28:55 +0100 Original-Received: from lele by 151.62.33.97 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 14 Dec 2015 09:28:55 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 69 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: 151.62.33.97 User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) Cancel-Lock: sha1:I7et4QRol7K9gST98MqMcDGYPMs= X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 80.91.229.3 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:108403 Archived-At: Drew Adams writes: > 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. My Emacs customization isn't used just by me, I share it with several friends, so I prefer to separate the two: one thing is what I (as the "init" maintainer) decide/propose should be the default setting, another thing is what the friends (or me, as a user of the "init") actually prefer. This preference/override may be expressed either as lisp code in the user's specific file or by her tweaks thru the Customize UI (that go in the same file, in the usual (customize-set-variables ...) form). So init.el basically says: (setq ;; top directory, usually ~/.emacs.d/ esk/top-dir (file-name-directory (or (buffer-file-name) load-file-name)) ;; starter kit lisp sources directory esk/lisp-dir (concat esk/top-dir "esk/") ;; not-yet-packaged-packages directory esk/autoload-dir (concat esk/top-dir "elpa-to-submit/") ;; directory where user specific stuff go esk/user-specific-dir (concat esk/top-dir user-login-name "/") ;; directory containing overrides esk/overrides-dir (concat esk/top-dir "overrides/") ;; user specific configuration file esk/user-specific-config (concat esk/top-dir user-login-name)) ... ;; Avoid using TAB as indentation (set-local 'indent-tabs-mode nil) ;; Do not emit noise (setq visible-bell t) ;; Many other tweaks ... ;; Where emacs will write user custom settings (setq custom-file (concat esk/user-specific-config ".el")) ;; Load user specific customizations (load esk/user-specific-config 'noerror) I'm used to use "current" Emacs version, compiled weekly from the repository, while my friends typically use whatever version comes down from their distribution. My "csetq" macro goal was to be a safer,-past-and-future-proof shortcut to initialize those variables: in such use-case, how can I be sure that `indent-tabs-mode' is still a buffer-local variable, or that `visible-bell' didn't turn into a custom-setting-with-side-effects? ciao, lele. -- nickname: Lele Gaifax | Quando vivrò di quello che ho pensato ieri real: Emanuele Gaifas | comincerò ad aver paura di chi mi copia. lele@metapensiero.it | -- Fortunato Depero, 1929.