From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: "Jeff Dwork" Newsgroups: gmane.emacs.devel Subject: Re: customize Date: Fri, 2 Aug 2002 17:46:44 -0700 Sender: emacs-devel-admin@gnu.org Message-ID: <15691.10228.135288.202730@localhost.localdomain> References: <200207111201.g6BC1OM16938@aztec.santafe.edu> <15680.26449.937153.817907@localhost.localdomain> <200207271853.g6RIrdt10834@aztec.santafe.edu> <200207300100.g6U100I14581@aztec.santafe.edu> NNTP-Posting-Host: localhost.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: main.gmane.org 1028335593 31627 127.0.0.1 (3 Aug 2002 00:46:33 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Sat, 3 Aug 2002 00:46:33 +0000 (UTC) Cc: eddy@opera.no, emacs-devel@gnu.org Return-path: Original-Received: from quimby.gnus.org ([80.91.224.244]) by main.gmane.org with esmtp (Exim 3.33 #1 (Debian)) id 17an3w-0008E0-00 for ; Sat, 03 Aug 2002 02:46:32 +0200 Original-Received: from fencepost.gnu.org ([199.232.76.164]) by quimby.gnus.org with esmtp (Exim 3.12 #1 (Debian)) id 17anNL-0006gN-00 for ; Sat, 03 Aug 2002 03:06:35 +0200 Original-Received: from localhost ([127.0.0.1] helo=fencepost.gnu.org) by fencepost.gnu.org with esmtp (Exim 3.35 #1 (Debian)) id 17an4R-0000Mq-00; Fri, 02 Aug 2002 20:47:03 -0400 Original-Received: from amdext.amd.com ([139.95.251.1]) by fencepost.gnu.org with esmtp (Exim 3.35 #1 (Debian)) id 17an4C-0000Lu-00; Fri, 02 Aug 2002 20:46:48 -0400 Original-Received: from ssvlgs01.amd.com (ssvlgs01.amd.com [139.95.250.16]) by amdext.amd.com (8.9.3/8.9.3/AMD) with SMTP id RAA07069; Fri, 2 Aug 2002 17:46:46 -0700 (PDT) Original-Received: from 139.95.250.1 by ssvlgs01.amd.com with ESMTP (Tumbleweed MMS SMTP Relay (MMS v4.7);); Fri, 02 Aug 2002 17:46:46 -0700 X-Server-Uuid: 02753650-11b0-11d5-bbc5-00508bf987eb Original-Received: from carmel.amd.com (carmel.amd.com [139.95.74.141]) by amdint.amd.com (8.9.3/8.9.3/AMD) with ESMTP id RAA05561; Fri, 2 Aug 2002 17:46:45 -0700 (PDT) Original-Received: from localhost.localdomain.amd.com (shambala.amd.com [139.95.74.26]) by carmel.amd.com (8.11.4/8.11.4) with SMTP id g730ki629859; Fri, 2 Aug 2002 17:46:44 -0700 (PDT) X-Mailer: emacs 19.34.1 (via feedmail 10 I); VM 7.07 under Emacs 19.34.1 Original-To: rms@gnu.org In-Reply-To: <200207300100.g6U100I14581@aztec.santafe.edu> X-WSS-ID: 1155F87C3178096-01-01 Errors-To: emacs-devel-admin@gnu.org X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.0.11 Precedence: bulk List-Help: List-Post: List-Subscribe: , List-Id: Emacs development discussions. List-Unsubscribe: , List-Archive: Xref: main.gmane.org gmane.emacs.devel:6258 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:6258 Here is an example of my problem with customize writing to .emacs file. I use 19.34 and I'm transitioning to 21. Many things I do in my version 19 .emacs are done differently in version 21, so I don't want 21 to see my 19 stuff and my 19 stuff may not understand my version 21 stuff. So I tested the version in .emacs. This is: GNU Emacs 21.1.1 (i686-pc-linux-gnu, X toolkit) of 2002-02-19 on go002 All invocations are: emacs --no-site-file I start with this in .emacs: ******************************************** (if (< emacs-major-version 21) (progn ; here we set load-path for emacs 19 ; this is just a dummy for test (setq jrd-init-var "19") (setq jrd-init-var2 "xx") ) ; here we set load-path for emacs 21 and later ; this is just a dummy for test (setq jrd-init-var "21") (setq jrd-init-var2 "yy") ) ******************************************** I start emacs 21, customize a variable and save it for the future. I now have this: ******************************************** (if (< emacs-major-version 21) (progn ; here we set load-path for emacs 19 ; this is just a dummy for test (setq jrd-init-var "19") (setq jrd-init-var2 "xx") ) ; here we set load-path for emacs 21 and later ; this is just a dummy for test (setq jrd-init-var "21") (setq jrd-init-var2 "yy") ) (custom-set-variables ;; custom-set-variables was added by Custom -- don't edit or cut/paste it! ;; Your init file should contain only one such instance. '(confirm-kill-emacs (quote y-or-n-p))) (custom-set-faces ;; custom-set-faces was added by Custom -- don't edit or cut/paste it! ;; Your init file should contain only one such instance. ) ******************************************** But this won't work because the custom-set-variables is outside the if. I could write some code to make emacs 19 ignore this function, but I don't want to. So I move custom-set-* inside the if. ******************************************** (if (< emacs-major-version 21) (progn ; here we set load-path for emacs 19 ; this is just a dummy for test (setq jrd-init-var "19") (setq jrd-init-var2 "xx") ) ; here we set load-path for emacs 21 and later ; this is just a dummy for test (setq jrd-init-var "21") ; move custom stuff so only emacs 21 sees it (custom-set-variables ;; custom-set-variables was added by Custom -- don't edit or cut/paste it! ;; Your init file should contain only one such instance. '(confirm-kill-emacs (quote y-or-n-p))) (custom-set-faces ;; custom-set-faces was added by Custom -- don't edit or cut/paste it! ;; Your init file should contain only one such instance. ) (setq jrd-init-var2 "yy") ) ******************************************** I run emacs 21 again and customize another variable and I get this: ******************************************** (if (< emacs-major-version 21) (progn ; here we set load-path for emacs 19 ; this is just a dummy for test (setq jrd-init-var "19") (setq jrd-init-var2 "xx") ) ; here we set load-path for emacs 21 and later ; this is just a dummy for test (setq jrd-init-var "21") ; move custom stuff so only emacs 21 sees it (custom-set-variables ;; custom-set-variables was added by Custom -- don't edit or cut/paste it! ;; Your init file should contain only one such instance. '(confirm-kill-emacs (quote y-or-n-p))) (custom-set-faces ;; custom-set-faces was added by Custom -- don't edit or cut/paste it! ;; Your init file should contain only one such instance. ) (setq jrd-init-var2 "yy") ) (custom-set-variables ;; custom-set-variables was added by Custom -- don't edit or cut/paste it! ;; Your init file should contain only one such instance. '(confirm-kill-emacs (quote y-or-n-p)) '(partial-completion-mode t nil (complete))) (custom-set-faces ;; custom-set-faces was added by Custom -- don't edit or cut/paste it! ;; Your init file should contain only one such instance. ) ******************************************** Now we have two instances of custom-set-variables, which is not good. If I leave the custom-set stuff where emacs 21 wrote it the first time, I can add code after it and emacs will find what it wrote and modify it correctly, although Eddy seems to have found problems with this. I only did a simple test. In any case, this is all fixed by customizing custom-file. Then customize modifies a file that contains only code written by customize and I can load custom-file from my .emacs however I want. As long as custom-file has reasonably prominent mention in the initial customize buffer, I don't think it is necessary to change the default. Thanks for all your good works, Jeff Richard Stallman writes: > To: eddy@opera.no > cc: jeff.dwork@amd.com, emacs-devel@gnu.org > Subject: Re: customize > Date: Mon, 29 Jul 2002 19:00:00 -0600 (MDT) > > > I documented custom-face, but I don't see a reason to change the > > default to use a different file. > > Jeff was discussing customisation of custom-file, not custom-face. > > It was custom-file that I documented. I wrote the wrong name in the > message. > > * Database reason: one file then contains only customize's actions, > making it much easier to keep track of which pieces of one's > config come from where. > > It is easy enough to distinguish--the stuff written by Customize > is compact, distinctive, and clearly labeled. > > * Priority/ordering reason: customize adds things to the end of its > file: this is sensible for it, but potentially bad for elisp which > needs to be executed after customizations; using a separate file > for customize lets my ~/.emacs load the customize part early, late > or in between, at my option, rather than having it always be last. > > There appears to be some controversy about whether this is really true. > Part of the controversy may be that your description of the problem > is heavy on emotions and the facts are not clear. > > > After it is there, you can add stuff in ~/.emacs after it. > and get a layer-cake of intermingled fragments, some of one's own > construction, others added by customize > > Could you show an example of this? As far as I know, customize writes > all its definitions for variables in a single sexp, and all its specs > for faces in a single sexp, and this can't produce very many layers. > > If you show me what the problem looks like, maybe I can change Customize > to edit the file in a way that is more convenient. > > * Byte-compilation: putting it all in a separate .el file provides > for the possibility of byte-compiling the customization elisp. > > You can byte-compile .emacs, so is this really an advantage? -- Jeff Dwork | jeff.dwork@amd.com Advanced Micro Devices, M/S 45 | 408-749-5216 (voice) 408-774-8448 (fax) PO Box 3453 |---------------------------------------- Sunnyvale, Ca 94088-3453 |