From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Drew Adams" Newsgroups: gmane.emacs.devel Subject: RE: [drew.adams@oracle.com: Info on define-minor-mode -:init-valueor :initial-value?] Date: Sat, 30 Jul 2005 06:58:27 -0700 Message-ID: References: <200507300422.j6U4MiB22285@raven.dms.auburn.edu> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1122731988 7173 80.91.229.2 (30 Jul 2005 13:59:48 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sat, 30 Jul 2005 13:59:48 +0000 (UTC) Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Jul 30 15:59:38 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1Dyrs2-0001dn-Lq for ged-emacs-devel@m.gmane.org; Sat, 30 Jul 2005 15:59:22 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Dyrua-0005hU-Pc for ged-emacs-devel@m.gmane.org; Sat, 30 Jul 2005 10:02:00 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1DyruD-0005dc-4D for emacs-devel@gnu.org; Sat, 30 Jul 2005 10:01:37 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Dyru7-0005az-UO for emacs-devel@gnu.org; Sat, 30 Jul 2005 10:01:33 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Dyru7-0005aw-OL for emacs-devel@gnu.org; Sat, 30 Jul 2005 10:01:31 -0400 Original-Received: from [141.146.126.230] (helo=agminet03.oracle.com) by monty-python.gnu.org with esmtp (TLS-1.0:DHE_RSA_3DES_EDE_CBC_SHA:24) (Exim 4.34) id 1Dys30-0002jF-5x for emacs-devel@gnu.org; Sat, 30 Jul 2005 10:10:42 -0400 Original-Received: from agminet03.oracle.com (localhost [127.0.0.1]) by agminet03.oracle.com (Switch-3.1.7/Switch-3.1.7) with ESMTP id j6UDwbwZ024364 for ; Sat, 30 Jul 2005 08:58:37 -0500 Original-Received: from rgmsgw301.us.oracle.com (rgmsgw301.us.oracle.com [138.1.186.50]) by agminet03.oracle.com (Switch-3.1.7/Switch-3.1.7) with ESMTP id j6UDwaCI024334 for ; Sat, 30 Jul 2005 08:58:36 -0500 Original-Received: from rgmsgw301.us.oracle.com (localhost [127.0.0.1]) by rgmsgw301.us.oracle.com (Switch-3.1.4/Switch-3.1.0) with ESMTP id j6UDwZnu014626 for ; Sat, 30 Jul 2005 07:58:35 -0600 Original-Received: from dradamslap (dhcp-amer-whq-csvpn-gw3-141-144-80-33.vpn.oracle.com [141.144.80.33]) by rgmsgw301.us.oracle.com (Switch-3.1.4/Switch-3.1.0) with SMTP id j6UDwZC0014616 (version=TLSv1/SSLv3 cipher=RC4-MD5 bits=128 verify=NO) for ; Sat, 30 Jul 2005 07:58:35 -0600 Original-To: X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.6604 (9.0.2911.0) Importance: Normal X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1506 In-reply-to: <200507300422.j6U4MiB22285@raven.dms.auburn.edu> X-Brightmail-Tracker: AAAAAQAAAAI= X-Whitelist: TRUE 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:41346 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:41346 What if I just document in the Elisp manual what the acceptable situations are for a non-nil :init-value and how it needs to be handled: pre-load the file containing the define-minor-mode before startup.el and call the minor mode function (or custom-reevaluate-setting if the minor mode only has to be enabled conditionally) in startup.el for minor modes included with the Emacs distribution that affect Emacs "globally" and put (if foo-mode (foo-mode 1)) at the end of the file containing the define-minor-mode for minor modes that only affect features defined in that file (and that are in files that are not pre-loaded). FWIW, that's OK by me. In the user doc (Elisp), we should say "this is how you create a minor mode..." and include the bit about (if foo-mode (foo-mode 1)) for non-nil init value. That is apparently an integral part of coding a minor mode with a non-nil init value. If so, this should not be mentioned only as an afterthought in an explanation of one of the examples. And, since this is user doc, I would put the user bit first and the "pre-load..." bit last, or remove the latter altogether. Most users reading this will use define-minor-mode in their own libraries, not in stuff that is part of Emacs. Or, if it is mentioned, perhaps mention it as a note to Emacs maintainers/developers as an alternative for dealing with the issue in internal code. What about my suggestion of including this bit of code automatically, as part of the expansion of define-minor-mode - perhaps by generating an eval-after-load or something? Is that feasible? If so, would there be a problem with such a hack?