unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* set sgml-xml-mode to true in some modes derived from sgml-mode
@ 2022-08-04 10:16 Yilkal Argaw
  2022-08-04 10:49 ` Yilkal Argaw
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Yilkal Argaw @ 2022-08-04 10:16 UTC (permalink / raw)
  To: Emacs Devel

Hi All

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. This can be done by setting the variable
in the autoload section for the derived modes.  This makes the default
behaviour of those modes more usable without using hooks. For now I am
using hooks set the variable true for html, mhtml and xml modes but I
think that it should be set by default for it to be more user
friendly.

With Regards
Yilkal



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: set sgml-xml-mode to true in some modes derived from sgml-mode
  2022-08-04 10:16 set sgml-xml-mode to true in some modes derived from sgml-mode Yilkal Argaw
@ 2022-08-04 10:49 ` Yilkal Argaw
  2022-08-04 11:59 ` Stefan Kangas
  2022-08-04 12:55 ` Lars Ingebrigtsen
  2 siblings, 0 replies; 7+ messages in thread
From: Yilkal Argaw @ 2022-08-04 10:49 UTC (permalink / raw)
  To: Emacs Devel

> Hi All
>
> 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. This can be done by setting the variable
> in the autoload section for the derived modes.  This makes the default
> behaviour of those modes more usable without using hooks. For now I am
> using hooks set the variable true for html, mhtml and xml modes but I
> think that it should be set by default for it to be more user
> friendly.
>
> With Regards
> Yilkal


Ammendment I know the differences between html and xml but I thought
when looking at the documentation of sgml-xml-mode It deals closing
tags but looking at the code it might be better to have explicit
variable to define explicit variable that deals with the closing this
skeleton tags


On Thu, Aug 4, 2022 at 1:16 PM Yilkal Argaw
<yilkalargawworkneh@gmail.com> wrote:
>
> Hi All
>
> 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. This can be done by setting the variable
> in the autoload section for the derived modes.  This makes the default
> behaviour of those modes more usable without using hooks. For now I am
> using hooks set the variable true for html, mhtml and xml modes but I
> think that it should be set by default for it to be more user
> friendly.
>
> With Regards
> Yilkal



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: set sgml-xml-mode to true in some modes derived from sgml-mode
  2022-08-04 10:16 set sgml-xml-mode to true in some modes derived from sgml-mode Yilkal Argaw
  2022-08-04 10:49 ` Yilkal Argaw
@ 2022-08-04 11:59 ` Stefan Kangas
  2022-08-04 12:55 ` Lars Ingebrigtsen
  2 siblings, 0 replies; 7+ messages in thread
From: Stefan Kangas @ 2022-08-04 11:59 UTC (permalink / raw)
  To: Yilkal Argaw, Emacs Devel

Hi Yilkal,

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. This can be done by setting the variable
> in the autoload section for the derived modes.  This makes the default
> behaviour of those modes more usable without using hooks. For now I am
> using hooks set the variable true for html, mhtml and xml modes but I
> think that it should be set by default for it to be more user
> friendly.

Thanks for bringing this issue to our attention.  However, this looks
like a bug report/feature request and should probably better go to
bug-gnu-emacs@gnu.org so that we don't lose track of it.

It would also be helpful if you could include a recipe to reproduce
exactly what you see on your screen, starting from "emacs -Q", to make
it easier for those of us not intimately familiar with `sgml-xml-mode'.

Thanks.



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: set sgml-xml-mode to true in some modes derived from sgml-mode
  2022-08-04 10:16 set sgml-xml-mode to true in some modes derived from sgml-mode Yilkal Argaw
  2022-08-04 10:49 ` Yilkal Argaw
  2022-08-04 11:59 ` Stefan Kangas
@ 2022-08-04 12:55 ` Lars Ingebrigtsen
  2022-08-04 16:56   ` Yuri Khan
  2 siblings, 1 reply; 7+ messages in thread
From: Lars Ingebrigtsen @ 2022-08-04 12:55 UTC (permalink / raw)
  To: Yilkal Argaw; +Cc: Emacs Devel

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 --
pretending that HTML is XML isn't recommended.




^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: set sgml-xml-mode to true in some modes derived from sgml-mode
  2022-08-04 12:55 ` Lars Ingebrigtsen
@ 2022-08-04 16:56   ` Yuri Khan
  2022-08-04 19:29     ` Yilkal Argaw
  0 siblings, 1 reply; 7+ messages in thread
From: Yuri Khan @ 2022-08-04 16:56 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: Yilkal Argaw, Emacs Devel

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



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: set sgml-xml-mode to true in some modes derived from sgml-mode
  2022-08-04 16:56   ` Yuri Khan
@ 2022-08-04 19:29     ` Yilkal Argaw
  2022-08-05  4:28       ` tomas
  0 siblings, 1 reply; 7+ messages in thread
From: Yilkal Argaw @ 2022-08-04 19:29 UTC (permalink / raw)
  To: Yuri Khan; +Cc: Lars Ingebrigtsen, Emacs Devel

> 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.)
May be having a variable that contains an list of tags you want to
close in html (i.e. those that are permitted by the HTML syntax and
are enforced by some standards

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

I used yasnippet and emmet but I'm currently experimenting with
vanilla emacs features and I was able to setup my own work flow by
using tempo and expand snippeting features. I'm now trying to
understand skeletons which really are not that bad (not-really optimal
either). I'm trying to understand and work on improving these features
in the future and the best place to  really use them and get annoyed
with them.

On Thu, Aug 4, 2022 at 7:56 PM Yuri Khan <yuri.v.khan@gmail.com> wrote:
>
> 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>.)



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: set sgml-xml-mode to true in some modes derived from sgml-mode
  2022-08-04 19:29     ` Yilkal Argaw
@ 2022-08-05  4:28       ` tomas
  0 siblings, 0 replies; 7+ messages in thread
From: tomas @ 2022-08-05  4:28 UTC (permalink / raw)
  To: emacs-devel

[-- Attachment #1: Type: text/plain, Size: 956 bytes --]

On Thu, Aug 04, 2022 at 10:29:37PM +0300, Yilkal Argaw wrote:
> > 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.)
> May be having a variable that contains an list of tags you want to
> close in html (i.e. those that are permitted by the HTML syntax and
> are enforced by some standards

That would be the HTML "void elements". This [1] is the most current
(2011) reference I can come up with:

    area, base, br, col, command, embed, hr, img, input, keygen, link,
    meta, param, source, track, wbr

HTML being a "living standard" (an euphemism for "we can do what we
please, users be damned") it's not impossible that they get proliferated
since then.

Cheers

[1] https://www.w3.org/TR/2011/WD-html-markup-20110113/syntax.html#syntax-elements
-- 
t

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 195 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2022-08-05  4:28 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-04 10:16 set sgml-xml-mode to true in some modes derived from sgml-mode Yilkal Argaw
2022-08-04 10:49 ` Yilkal Argaw
2022-08-04 11:59 ` Stefan Kangas
2022-08-04 12:55 ` Lars Ingebrigtsen
2022-08-04 16:56   ` Yuri Khan
2022-08-04 19:29     ` Yilkal Argaw
2022-08-05  4:28       ` tomas

Code repositories for project(s) associated with this inbox:

	https://git.savannah.gnu.org/cgit/emacs.git

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