emacs-devel
[Top][All Lists]
Advanced

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

Re: set sgml-xml-mode to true in some modes derived from sgml-mode


From: Yuri Khan
Subject: Re: set sgml-xml-mode to true in some modes derived from sgml-mode
Date: Thu, 4 Aug 2022 23:56:26 +0700

On Thu, 4 Aug 2022 at 19:57, Lars Ingebrigtsen <larsi@gnus.org> wrote:
>
> Yilkal Argaw <yilkalargawworkneh@gmail.com> writes:
>
> > While trying to use emacs to edit html files I noticed how the
> > sgml-tag functions which uses skeletons to insert  tags does not
> > insert a closing tag for some tags like "<li>" this behaviour changes
> > by changing the variable "sgml-xml-mode" to a non nil value. Would it
> > not be better to turn this variable to true some of the derived modes
> > like html-mode and xml-mode.
>
> You don't want the skeleton to insert <li></li> in html-mode --

For some values of “you”, you certainly do.

Specifically, you[^*] want in your[^**] HTML all closing tags that are
permitted by the HTML syntax. </p>, </li>, </dd>, but not </input> or
</img>. (You[^*] also want quotes around all your[^**] attribute
values.)

[^*]: I.
[^**]: my.

> pretending that HTML is XML isn't recommended.

Not arguing with that, although XHTML was a good idea and I’m sad it
didn’t play out.


(To OP: You might like a different method of automation. E.g. my
primary way of writing HTML is: I enter a tag name such as “li”, press
Tab, and Yasnippet expands it into <li>|</li>. Or I mark a region,
overwrite it with a tag name like “code”, press Tab, and it gets
yanked back, surrounded with <code>…</code>.)



reply via email to

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