From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Luc Teirlinck Newsgroups: gmane.emacs.devel Subject: Re: Eliminating "changed in Emacs outside of Customize" Date: Tue, 1 Feb 2005 19:03:30 -0600 (CST) Message-ID: <200502020103.j1213U805651@raven.dms.auburn.edu> References: <87lla8xdps.fsf-monnier+emacs@gnu.org> <008801c508a4$01110ac0$0200a8c0@sedrcw11488> <200502012211.j11MBnj02899@raven.dms.auburn.edu> <00ea01c508ae$34589740$0200a8c0@sedrcw11488> NNTP-Posting-Host: main.gmane.org X-Trace: sea.gmane.org 1107306851 30038 80.91.229.2 (2 Feb 2005 01:14:11 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 2 Feb 2005 01:14:11 +0000 (UTC) Cc: rms@gnu.org, emacs-devel@gnu.org, monnier@iro.umontreal.ca, drew.adams@oracle.com, abraham@dina.kvl.dk Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Feb 02 02:14:10 2005 Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1Cw95k-0000By-5i for ged-emacs-devel@m.gmane.org; Wed, 02 Feb 2005 02:14:00 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Cw9Il-0004UM-Iq for ged-emacs-devel@m.gmane.org; Tue, 01 Feb 2005 20:27:27 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Cw9Gg-0003V6-Kh for emacs-devel@gnu.org; Tue, 01 Feb 2005 20:25:18 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Cw9GX-0003Q5-PP for emacs-devel@gnu.org; Tue, 01 Feb 2005 20:25:14 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Cw9GS-0003OG-2l for emacs-devel@gnu.org; Tue, 01 Feb 2005 20:25:04 -0500 Original-Received: from [131.204.53.104] (helo=manatee.dms.auburn.edu) by monty-python.gnu.org with esmtp (Exim 4.34) id 1Cw8wm-0001lN-2o; Tue, 01 Feb 2005 20:04:44 -0500 Original-Received: from raven.dms.auburn.edu (raven.dms.auburn.edu [131.204.53.29]) by manatee.dms.auburn.edu (8.12.10/8.12.10) with ESMTP id j1214f9N007971; Tue, 1 Feb 2005 19:04:41 -0600 (CST) Original-Received: (from teirllm@localhost) by raven.dms.auburn.edu (8.11.7p1+Sun/8.11.7) id j1213U805651; Tue, 1 Feb 2005 19:03:30 -0600 (CST) X-Authentication-Warning: raven.dms.auburn.edu: teirllm set sender to teirllm@dms.auburn.edu using -f Original-To: lennart.borgman.073@student.lu.se In-reply-to: <00ea01c508ae$34589740$0200a8c0@sedrcw11488> (lennart.borgman.073@student.lu.se) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org X-MailScanner-To: ged-emacs-devel@m.gmane.org Xref: main.gmane.org gmane.emacs.devel:32738 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:32738 Lennart Borgman wrote: Could you please take this a little bit more precise? I vaugely remember the discussion, but not the details. It looks to me that there is a mixing of things. Why should :initialize execute :set if it only is for the purpose of initializing something, but not actually setting the symbol value? Should not that code then be in :initialize? If I remember correctly, it is for the sake of autoloaded defcustoms. For those, loaddefs.el sets the value, but does not execute the :set function, because it does not know the :set function. When the file is later loaded, `custom-initialize-reset' assures that the :set function gets executed. This usually leads to the correct behavior for people who customized the value using Custom, but can easily lead to very wrong results for people who set it outside Custom. So how do you get around the above problem if you can not use the default :initialize function, because you do not want to force people to use Custom to set your variable? The problem that `custom-initialize-reset' tries to address only occurs when the _"standard"_ (or "Stock" or ...) value requires a :set function to be properly initialized. I personally try to avoid such a situation in the defcustoms I write. The problem also does not occur if you do not autoload the defcustom. That will become more difficult. Indeed, `custom-set-variables' used to (actually still does, I believe) keep track of :require's using stuff like: '(global-font-lock-mode t nil (font-core)) where (font-core) says to load the file "font-core". If I understood correctly, this feature is scheduled for elimination, because it creates incompatibility between different Emacs versions. Instead, it is planned to autoload the defcustoms in question to record the :require's that way. The person implementing this will have to very carefully grep for :initialize in addition to :require keywords to make sure that this does not break anything. Of course, one could eliminate the :initialize problem completely by making loaddefs _execute_ the :require (maybe it already does), but, unless I misunderstand something, in that case one could just as well preload the file and then there is no need for an autoload and there is no problem whatsoever. Sincerely, Luc.