From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Richard Stallman Newsgroups: gmane.emacs.devel Subject: Re: define-derived-mode runs parent mode hook after evaluating body Date: Sun, 22 Jul 2007 14:37:22 -0400 Message-ID: References: <46A079C2.4000802@gmx.at> Reply-To: rms@gnu.org NNTP-Posting-Host: lo.gmane.org Content-Type: text/plain; charset=ISO-8859-15 X-Trace: sea.gmane.org 1185129573 25583 80.91.229.12 (22 Jul 2007 18:39:33 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sun, 22 Jul 2007 18:39:33 +0000 (UTC) Cc: rudalics@gmx.at, emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Jul 22 20:39:32 2007 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1ICgL0-0002L9-AV for ged-emacs-devel@m.gmane.org; Sun, 22 Jul 2007 20:39:26 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1ICgKz-0006Mf-TP for ged-emacs-devel@m.gmane.org; Sun, 22 Jul 2007 14:39:25 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1ICgHc-0004M0-Fg for emacs-devel@gnu.org; Sun, 22 Jul 2007 14:35:56 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1ICgHb-0004LX-L7 for emacs-devel@gnu.org; Sun, 22 Jul 2007 14:35:56 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1ICgHb-0004LQ-GT for emacs-devel@gnu.org; Sun, 22 Jul 2007 14:35:55 -0400 Original-Received: from fencepost.gnu.org ([140.186.70.10]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1ICgHb-0004cq-65 for emacs-devel@gnu.org; Sun, 22 Jul 2007 14:35:55 -0400 Original-Received: from rms by fencepost.gnu.org with local (Exim 4.60) (envelope-from ) id 1ICgJ0-0005jy-8V; Sun, 22 Jul 2007 14:37:22 -0400 In-reply-to: (message from Stefan Monnier on Sat, 21 Jul 2007 23:08:33 -0400) X-detected-kernel: Linux 2.6, seldom 2.4 (older, 4) 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:75313 Archived-At: > Do you remember the sort of problems which we solved with this? Customizations that need to modify variable settings based on the major-mode's value (e.g. add an element to a list). Or customizations that depend on the major mode's variable settings Ah, yes. Those cases have not disappeared, and we do still need to delay the mode hooks. Although delaying mode hook would give the desired results in this case, we can't solve the problem that way. So what should we recommend in a case like this? One possible recommendation is that the hook function should test major-mode and do nothing if it is not `text-mode'. That way it won't affect the derived modes at all. Or it could test (memq major-mode LIST-OF-OK-MODES) or (memq major-mode LIST-OF-EXCEPTIONS).