From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Kai Grossjohann Newsgroups: gmane.emacs.help Subject: Re: Differencing a major mode from its derived modes Date: Sat, 12 Jun 2004 15:36:32 +0200 Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Message-ID: <864qpgzyn3.fsf@rumba.de.uu.net> References: <86y8mzc7fg.fsf@ifrance.com> <8665a2blop.fsf@rumba.de.uu.net> <86vfhy5xg4.fsf@ifrance.com> <86y8mui705.fsf@rumba.de.uu.net> <86lliu577k.fsf@ifrance.com> NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1087047423 32102 80.91.224.253 (12 Jun 2004 13:37:03 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sat, 12 Jun 2004 13:37:03 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sat Jun 12 15:36:57 2004 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1BZ8gr-0006q2-00 for ; Sat, 12 Jun 2004 15:36:57 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1BZ8he-0001kM-0m for geh-help-gnu-emacs@m.gmane.org; Sat, 12 Jun 2004 09:37:46 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.33) id 1BZ8hV-0001hj-Q0 for help-gnu-emacs@gnu.org; Sat, 12 Jun 2004 09:37:37 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.33) id 1BZ8hT-0001fb-Rv for help-gnu-emacs@gnu.org; Sat, 12 Jun 2004 09:37:37 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1BZ8hT-0001f6-PT for help-gnu-emacs@gnu.org; Sat, 12 Jun 2004 09:37:35 -0400 Original-Received: from [80.91.224.249] (helo=main.gmane.org) by monty-python.gnu.org with esmtp (Exim 4.34) id 1BZ8gX-0004hK-HB for help-gnu-emacs@gnu.org; Sat, 12 Jun 2004 09:36:37 -0400 Original-Received: from list by main.gmane.org with local (Exim 3.35 #1 (Debian)) id 1BZ8gW-0004fg-00 for ; Sat, 12 Jun 2004 15:36:36 +0200 Original-Received: from p50877a47.dip.t-dialin.net ([80.135.122.71]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 12 Jun 2004 15:36:36 +0200 Original-Received: from kai by p50877a47.dip.t-dialin.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 12 Jun 2004 15:36:36 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-To: help-gnu-emacs@gnu.org Original-Lines: 53 Original-X-Complaints-To: usenet@sea.gmane.org X-Gmane-NNTP-Posting-Host: p50877a47.dip.t-dialin.net User-Agent: Gnus/5.110003 (No Gnus v0.3) Emacs/21.3.50 (gnu/linux) Cancel-Lock: sha1:F/vaCPzfJAOHMA8J0pfqaza5Qog= X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.4 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.help:18953 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:18953 chem writes: >> I forget whether testing the variable major-mode was already >> mentioned. You could write a function that checks (eq major-mode >> 'text-mode), and only if this is true, then activate allout mode. > > yes, i tried that, but it only work if the mode is not derived from > text-mode (eg. LaTeX - from aucTeX), but not if it is (eg. message). > In the latter, code like this one : > > (add-hook 'text-mode-hook > '(lambda () > (if (eq major-mode 'text-mode) > (flyspell-mode 1) > (turn-on-auto-fill)))) > > will run the THEN _and_ the ELSE part of the IF expression, while in > the former, only then ELSE part is evaluated. I think that's because text-mode-hook is run twice: once as part of message-mode, and once more because message-mode is derived from text-mode. IMHO this should not happen: text-mode-hook should be run only once in this case. I wonder if this is really a bug, and if so, how to fix it. > Furthermore, something like : > > (derived-mode-p 'text-mode) > > will return true even in text-mode (while it's hardly derived from > text-mode, isn't it?). Hm. > So, I found no easy way to discriminate between parent from derived > children mode. > > Thanks again for the support. > > PS: Could you tell me if receive my reply twice : on the mailing list > (or the newsgroup) and in your mailbox. I'm curious to know if all > (of my gnus and message configurations) is working as intended. I got it twice. I deleted the mail. But note that the mail reply was addressed to help-gnu-emacs, not to a newsgroup. Not sure if that is relevant. Kai