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: define-derived-mode Date: Mon, 9 May 2005 19:07:08 -0500 (CDT) Message-ID: <200505100007.j4A078L07495@raven.dms.auburn.edu> References: <200505080101.j48117N24298@raven.dms.auburn.edu> <200505080315.j483F2l24405@raven.dms.auburn.edu> <200505081748.j48HmHm26026@raven.dms.auburn.edu> <8764xs7kmi.fsf@xs4all.nl> NNTP-Posting-Host: main.gmane.org X-Trace: sea.gmane.org 1115683411 6755 80.91.229.2 (10 May 2005 00:03:31 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 10 May 2005 00:03:31 +0000 (UTC) Cc: rms@gnu.org, emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue May 10 02:03:30 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1DVIDc-0001Kq-82 for ged-emacs-devel@m.gmane.org; Tue, 10 May 2005 02:03:24 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DVIM2-0004uo-MF for ged-emacs-devel@m.gmane.org; Mon, 09 May 2005 20:12:06 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1DVIKo-0004cH-Ir for emacs-devel@gnu.org; Mon, 09 May 2005 20:10:51 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1DVIKl-0004Zj-9U for emacs-devel@gnu.org; Mon, 09 May 2005 20:10:48 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DVIKj-0004Uu-BC for emacs-devel@gnu.org; Mon, 09 May 2005 20:10:45 -0400 Original-Received: from [131.204.53.104] (helo=manatee.dms.auburn.edu) by monty-python.gnu.org with esmtp (Exim 4.34) id 1DVINr-0002ui-SJ; Mon, 09 May 2005 20:14:00 -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 j4A07bog015509; Mon, 9 May 2005 19:07:37 -0500 (CDT) Original-Received: (from teirllm@localhost) by raven.dms.auburn.edu (8.11.7p1+Sun/8.11.7) id j4A078L07495; Mon, 9 May 2005 19:07:08 -0500 (CDT) X-Authentication-Warning: raven.dms.auburn.edu: teirllm set sender to teirllm@dms.auburn.edu using -f Original-To: Lute.Kamstra.lists@xs4all.nl In-reply-to: <8764xs7kmi.fsf@xs4all.nl> (message from Lute Kamstra on Mon, 09 May 2005 12:35:01 +0200) 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:36923 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:36923 Lute Kamstra wrote: > which was an incompatible change. Not compatible with what? With pre-existing defvars or defcustoms for these hooks. (Unless you checked for _all_ uses of `define-generic-mode' that there are none. But how did you get a list of _all_ outside packages that use it?) In the case of `define-minor-mode' two concrete examples of variables with competing defcustoms are auto-revert-mode-hook and global-auto-revert-mode-hook. In this particular case, not too much harm is done, but it is not exactly very clean. I primarily wanted to define the mode hook as a variable so that I could give it docstring. I chose defcustom over defvar because define-minor-mode and quite some other major modes did that. I don't strongly object to making the defcustom a defvar, but I don't understand your problems with the use of defcustom: I have a problem with _both_ defvar and defcustom. Hooks do not need a defvar, most hooks do not have them. The only reason for a defvar is to add a docstring. You use the defvar to give the hook the docstring: "Hook run when entering Mymode mode.". This "generic" docstring contains no info that is not already contained in the hook's name and it could overwrite _real_ info contained in a handwritten defvar or defcustom. If you want to make people aware of the mode hook, it would seem better to put an additional sentence in the default mode doc: "Mymode mode. This a generic mode defined with `define-generic-mode'. As all such modes, it runs `foo-mode-hook' as the very last thing it does." I don't recall the bugs you refer to; could you give me the subject(s) of the relevant thread(s)? It is scattered over several threads. Threads about Custom tend to be superlong and unfocused. `find-file-hook as illustration of Custom problems' is one of the threads, but several other threads about Custom were going on at the same time and they all intertwined. There are several problems, related to the fact that hooks have to be customized using add-hook and remove-hook and not using setq. But Custom does use setq. Here is an example of the type of problems that occur. (By no means the only one.) The user customizes foo-hook using Custom. Then in the next Emacs version, a very essential function badly-needed-fun is added to foo-hook. The user's custom-set-variables form overrides the adding of badly-needed-fun to foo-hook. These kind of problems are supposed to get fixed in 23 or 24, but it is too tricky to still get it done for 22. Sincerely, Luc.