From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Luc Teirlinck Newsgroups: gmane.emacs.devel Subject: Re: [drew.adams@oracle.com: Info on define-minor-mode - :init-valueor :initial-value?] Date: Sat, 30 Jul 2005 20:02:00 -0500 (CDT) Message-ID: <200507310102.j6V120625623@raven.dms.auburn.edu> References: <200507290256.j6T2uPh18315@raven.dms.auburn.edu> NNTP-Posting-Host: main.gmane.org X-Trace: sea.gmane.org 1122771956 8447 80.91.229.2 (31 Jul 2005 01:05:56 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sun, 31 Jul 2005 01:05:56 +0000 (UTC) Cc: drew.adams@oracle.com, emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Jul 31 03:05:50 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1Dz2Gz-0004IW-Ss for ged-emacs-devel@m.gmane.org; Sun, 31 Jul 2005 03:05:50 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Dz2JZ-0005Rx-9u for ged-emacs-devel@m.gmane.org; Sat, 30 Jul 2005 21:08:29 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Dz2JF-0005Pm-N3 for emacs-devel@gnu.org; Sat, 30 Jul 2005 21:08:09 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Dz2JD-0005OP-85 for emacs-devel@gnu.org; Sat, 30 Jul 2005 21:08:07 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Dz2JD-0005Ne-0P for emacs-devel@gnu.org; Sat, 30 Jul 2005 21:08:07 -0400 Original-Received: from [131.204.53.104] (helo=manatee.dms.auburn.edu) by monty-python.gnu.org with esmtp (Exim 4.34) id 1Dz2Pp-00018i-Cu; Sat, 30 Jul 2005 21:14:57 -0400 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 j6V12lCK029683; Sat, 30 Jul 2005 20:02:47 -0500 (CDT) Original-Received: (from teirllm@localhost) by raven.dms.auburn.edu (8.11.7p1+Sun/8.11.7) id j6V120625623; Sat, 30 Jul 2005 20:02:00 -0500 (CDT) X-Authentication-Warning: raven.dms.auburn.edu: teirllm set sender to teirllm@dms.auburn.edu using -f Original-To: rms@gnu.org In-reply-to: (rms@gnu.org) 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 Xref: news.gmane.org gmane.emacs.devel:41365 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:41365 Richard Stallman wrote: If we can't arrange to make just the defcustom do the job, documenting this method is ok with me. Perhaps we should document a simple way and a complex way. The simple way is that it all gets done by the :set function when the defcustom's expansion is executed. That requires putting the defcustom after the minor mode function and generating a defvar before the function. You'd use custom-initialize-reset. For cases which are more complex, you'd use custom-initialize-default and then write (if foo-mode (foo-mode 1)) at the end of the file. If we are willing to change define-minor-mode, then I do not believe that there is any need for the more complex method, unless there is some reason why the define-minor-mode can not be delayed until all functions called by the minor mode have been defined. If we make define-minor-mode write a compiler defvar, then define the mode function and then write the defcustom, one can use custom-initialize-set if the define-minor-mode is not autoloaded, and custom-initialize-reset if it is to be autoloaded. Actually, custom-initialize-reset is relatively harmless for the default define-minor-mode :set function. (The problems I was referring to concern non minor mode :set functions, as I pointed out in my other message.) Sincerely, Luc.