unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: chem <chemtov@ifrance.com>
Cc: help-gnu-emacs@gnu.org
Subject: Re: Differencing a major mode from its derived modes
Date: Fri, 11 Jun 2004 19:34:55 +0200	[thread overview]
Message-ID: <86lliu577k.fsf@ifrance.com> (raw)
In-Reply-To: <86y8mui705.fsf@rumba.de.uu.net> (Kai Grossjohann's message of "Fri, 11 Jun 2004 15:00:58 +0200")


> 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.

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?).

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.

-- 
Chemtov

  reply	other threads:[~2004-06-11 17:34 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-06-07 22:46 Differencing a major mode from its derived modes chem
2004-06-08  6:36 ` Kai Grossjohann
2004-06-08  9:36   ` chem
2004-06-11 13:00     ` Kai Grossjohann
2004-06-11 17:34       ` chem [this message]
2004-06-12 13:36         ` Kai Grossjohann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=86lliu577k.fsf@ifrance.com \
    --to=chemtov@ifrance.com \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).