[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: nxml-mode: Derive from prog-mode instead of text-mode

From: Jostein Kjønigsen
Subject: Re: nxml-mode: Derive from prog-mode instead of text-mode
Date: Tue, 30 May 2017 10:05:00 +0200

> I think the best option is to create a new structured-text-mode which
> inherits from both text-mode and prog-mode (and then have nxml-mode
> inherit from that mode).
> Those users who want to enable some functionality in text-mode but not
> in structured-text-mode can always use (derived-mode-p
> 'structured-text-mode) in the hook function.
>         Stefan

Would this mean that structured-text-mode would activate all
customization and hooks which users may have setup for both text-mode
and prog-mode?

I can't speak for the "officially" intended uses of these hooks
ofcourse, but for me these two are in direct conflict.

With this setup, I would have to use structured-text-mode-hook to
explicitly cancel out text-mode hook and potentially re-set
prog-mode-hook settings.

While I'm all OK with structured-text-mode as a concept, I think
deriving it from both text-mode and prog-mode would be an error.

At least not without a "different" text-mode-hook for "regular" text
(literal-text-mode?), so that we can avoid these kinds of conflicts.

So I just tried to sketch out what that would look like in a
inheritance-tree, and it did honestly end up a bit messy. Basically if
we're to go that far, IMO not deriving in the first place might
actually be both simpler and better.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]