[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: Stefan Monnier
Subject: Re: nxml-mode: Derive from prog-mode instead of text-mode
Date: Wed, 31 May 2017 07:52:01 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux)

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

It would run both hooks, and inherit from both keymaps, yes.

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

Can you give us some examples of conflicts?

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

You can also test (derived-mode-p 'prog-mode) in your text-mode-hook in
order to only run some code for the text-only-mode (and vice-versa).

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

I think that would be over-engineered.


reply via email to

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