unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Stefan Kangas <stefan@marxist.se>
To: Philip Kaludercic <philipk@posteo.net>
Cc: 47877@debbugs.gnu.org
Subject: bug#47877: [PATCH] Respect sgml-xml-mode
Date: Wed, 21 Apr 2021 08:41:45 -0500	[thread overview]
Message-ID: <CADwFkmkTr6HL1aq9W3p2ozeWZVge1==2wNoM6+mhOLMznqcEDg@mail.gmail.com> (raw)
In-Reply-To: <87lf9ccd2j.fsf@posteo.net> (Philip Kaludercic's message of "Wed,  21 Apr 2021 07:27:16 +0000")

tags 47877 fixed
close 47877 28.1
thanks

Philip Kaludercic <philipk@posteo.net> writes:

> Stefan Kangas <stefan@marxist.se> writes:
>
>> Philip Kaludercic <philipk@posteo.net> writes:
>>
>>> sgml-xml-mode is a user option that is over-riden by smgl-mode. When I
>>> customize sgml-xml-mode to be enabled for every sgml-mode derived mode
>>> (specifically html-mode), it is disabled because a HTML file does not
>>> have to be a valid XML file -- even if I would want it to be.
>>>
>>> This patch only sets sgml-xml-mode if we know that the current file is
>>> an XML file, but leaves the default value if it cannot be said for sure.
>>
>> Thanks for the patch.
>>
>> Your explanation sounds reasonable, but could you perhaps provide a
>> recipe for how to reproduce this problem (preferably starting from emacs
>> -Q)?
>
> 1. Customize sgml-xml-mode to t
> 2. Open a HTML file
> 3. Insert a tag using C-c C-o, eg. <p>
>
> Compare this to
>
>
> 1. Open a HTML file
> 2. Manually set sgml-xml-mode to t
> 3. Insert a tag using C-c C-o, eg. <p>
>
> and in this time you will also have a </p> tag generated, as intended.

Thanks, I can now see that your patch indeed fixes that problem.

So I fixed your commit message to follow our preferred format:

    sgml-mode: Only set sgml-xml-mode if guessed to be an XML file

    * lisp/textmodes/sgml-mode.el (sgml-mode): Don't override
    sgml-xml-mode if the result of the guess is used as the buffer local
    value.  (Bug#47877)

It is now pushed to master (3e727cf20b); closing this bug.





      reply	other threads:[~2021-04-21 13:41 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-18 18:56 bug#47877: [PATCH] Respect sgml-xml-mode Philip Kaludercic
2021-04-20 23:45 ` Stefan Kangas
2021-04-21  7:27   ` Philip Kaludercic
2021-04-21 13:41     ` Stefan Kangas [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CADwFkmkTr6HL1aq9W3p2ozeWZVge1==2wNoM6+mhOLMznqcEDg@mail.gmail.com' \
    --to=stefan@marxist.se \
    --cc=47877@debbugs.gnu.org \
    --cc=philipk@posteo.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public 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).