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: obsolete comment in tool-bar.el Date: Wed, 13 Jul 2005 21:08:55 -0500 (CDT) Message-ID: <200507140208.j6E28tr08794@raven.dms.auburn.edu> References: <200507071915.j67JFZT29961@raven.dms.auburn.edu> <200507090235.j692ZER04883@raven.dms.auburn.edu> <200507110321.j6B3LgG09526@raven.dms.auburn.edu> <85y88dfcqw.fsf@lola.goethe.zz> <200507130302.j6D32qE05640@raven.dms.auburn.edu> NNTP-Posting-Host: main.gmane.org X-Trace: sea.gmane.org 1121308343 31395 80.91.229.2 (14 Jul 2005 02:32:23 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 14 Jul 2005 02:32:23 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Jul 14 04:32:19 2005 Return-path: Original-Received: from mail-relay.eunet.no ([193.71.71.242]) by ciao.gmane.org with esmtp (Exim 4.43) id 1DstQV-00010z-Tn for ged-emacs-devel@gmane.org; Thu, 14 Jul 2005 04:26:20 +0200 Original-Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) by mail-relay.eunet.no (8.13.1/8.13.1/GN) with ESMTP id j6E2Q9VM014829 for ; Thu, 14 Jul 2005 04:26:10 +0200 (CEST) (envelope-from emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org) Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DstS7-00044y-6M for ged-emacs-devel@m.gmane.org; Wed, 13 Jul 2005 22:27:55 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1DstNn-0003Ii-Qy for emacs-devel@gnu.org; Wed, 13 Jul 2005 22:23:28 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1DstNO-0003Av-KF for emacs-devel@gnu.org; Wed, 13 Jul 2005 22:23:03 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DstNO-00034q-GF for emacs-devel@gnu.org; Wed, 13 Jul 2005 22:23:02 -0400 Original-Received: from [131.204.53.104] (helo=manatee.dms.auburn.edu) by monty-python.gnu.org with esmtp (Exim 4.34) id 1DstHt-0003dk-QA; Wed, 13 Jul 2005 22:17:22 -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 j6E291CK003365; Wed, 13 Jul 2005 21:09:01 -0500 (CDT) Original-Received: (from teirllm@localhost) by raven.dms.auburn.edu (8.11.7p1+Sun/8.11.7) id j6E28tr08794; Wed, 13 Jul 2005 21:08:55 -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:40874 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:40874 I reinstalled my original changes, deleted the autoload for tooltip mode and committed my changes to define-minor-mode. The two last steps should enable Emacs to be built on Mac OS 9, even with my changes, although I can not test that. Unfortunately, I can not reinstate the use of `custom-reevaluate-setting' for tooltip-mode in startup.el. Unless we would be willing to load tooltip.el even on systems where it makes no sense, we just have to live with the code duplication here. How do you reach this conclusion? I do not understand. To allow Emacs to be built on certain operating systems with my reinstalled changes, I had to remove the autoload for tooltip-mode. But that means that `custom-reevaluate-settings' in certain situations (when tooltip is not preloaded, that is, when x-show-tip is not fboundp) "reevaluates" the defcustom before the defcustom has been executed. In the case of tooltip-mode, that actually turns out to be OK, because if the defcustom has not yet been executed, `custom-reevaluate-settings' sets the variable to nil, which in the case of tooltip mode happens to be the correct value in all situations where tooltip is not preloaded. So I readded the `custom-reevaluate-settings' for tooltip-mode. It kind of works by accident rather than by design however, and may not work in other similar cases. Here is the required patch to easy-mmode.el. Stefan opposed a similar patch earlier, but the objections he then stated (that loading a file would have side effects) do not apply to custom-initialize-safe-default. It seems ok to me, but the doc string should mention :initialize and explain that the only legitimate value to use with it is custom-initialize-safe-default, and when that should be used. I committed the non-doc changes to easy-mmode.el. Here are the proposed doc changes which I could install if desired: ===File ~/easy-mmode-diff=================================== *** easy-mmode.el 12 Jul 2005 21:14:49 -0500 1.68 --- easy-mmode.el 13 Jul 2005 20:53:55 -0500 *************** *** 105,112 **** It will be executed after any toggling but before running the hook variable `mode-HOOK'. Before the actual body code, you can write keyword arguments (alternating ! keywords and values). These following keyword arguments are supported (other ! keywords will be passed to `defcustom' if the minor mode is global): :group GROUP Custom group name to use in all generated `defcustom' forms. Defaults to MODE without the possible trailing \"-mode\". Don't use this default group name unless you have written a --- 105,111 ---- It will be executed after any toggling but before running the hook variable `mode-HOOK'. Before the actual body code, you can write keyword arguments (alternating ! keywords and values). The following keyword arguments are supported: :group GROUP Custom group name to use in all generated `defcustom' forms. Defaults to MODE without the possible trailing \"-mode\". Don't use this default group name unless you have written a *************** *** 122,128 **** For example, you could write (define-minor-mode foo-mode \"If enabled, foo on you!\" :lighter \" Foo\" :require 'foo :global t :group 'hassle :version \"27.5\" ! ...BODY CODE...)" (declare (debug (&define name stringp [&optional [¬ keywordp] sexp &optional [¬ keywordp] sexp --- 121,136 ---- For example, you could write (define-minor-mode foo-mode \"If enabled, foo on you!\" :lighter \" Foo\" :require 'foo :global t :group 'hassle :version \"27.5\" ! ...BODY CODE...) ! ! If the minor mode is global other keywords are passed to `defcustom'. ! However, the value of the :set keyword is hard coded to ! `custom-set-minor-mode' and the value of the :type keyword is hard coded ! to `boolean'. The value of the :initialize keyword defaults to ! `custom-initialize-default'. This default can be overridden using ! an explicit :initialize keyword. However, the only known situation ! in which such an override is acceptable is for some preloaded global ! minor modes which need to use `custom-initialize-safe-default'." (declare (debug (&define name stringp [&optional [¬ keywordp] sexp &optional [¬ keywordp] sexp ============================================================