emacs-devel
[Top][All Lists]
Advanced

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

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


From: Eli Zaretskii
Subject: Re: nxml-mode: Derive from prog-mode instead of text-mode
Date: Wed, 10 May 2017 21:59:57 +0300

> From: Jostein Kjønigsen <address@hidden>
> Cc: address@hidden
> Date: Wed, 10 May 2017 19:59:13 +0200
> 
> In prog-mode I have F5 bound to the recompile-command, and the compile 
> command set via .dir-locals.el.
> That means in any "project" I work with, I can always press F5 to build and 
> see that everything works. It's a
> good workflow.
> 
> I also rely on projectile for file-navigation, which is also enabled in the 
> prog-mode-hook.
> 
> Now consider I press F5 to start building and see that something fails to due 
> invalid data in a XML-file. I'll need
> to edit XML.
> 
> I use projectile to switch to the "bad" XML-file, and correct the settings. I 
> have spell-checking everywhere
> telling me my XML-elements are not valid English words. I disable flyspell 
> (which I have for text-mode).
> 
> By reflex I press F5 to build. It doesn't. Because my prog-mode hook was not 
> run.
> 
> A little bit annoyed, I try to switch back to a source-file to build from (by 
> reflex using projectile). I press "C-c p
> f". But there is no projectile. Because my prog-mode hook never ran, thus 
> projectile is not on.

These seem all to stem from your personal setup, not from inherent
features of prog-mode that are absent from text-mode.  In fact,
prog-mode is exceedingly minimal: it only sets 3 variables, none of
them related to what you describe.

> I just honestly think it makes infinitely more sense to have nxml-mode just 
> invoke prog-mode directly.
> 
> To put it the other way way: What's the argument for nxml-mode predominantly 
> invoking text-mode-hooks?

History, I guess.  In the beginning there were SGML and HTML, the
latter is (or was back then) mostly text with markup.  XML just
naturally inherited from HTML.

I could understand an argument that nowadays XML and even HTML deviate
a lot from text with markup, but I don't see how prog-mode would be
more appropriate.  I tend to think that we should come up with a new
family of modes, which specifically caters to the likes of XML-based
coding.



reply via email to

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