GNU bug report logs - #47877
[PATCH] Respect sgml-xml-mode

Previous Next

Package: emacs;

Reported by: Philip Kaludercic <philipk <at> posteo.net>

Date: Sun, 18 Apr 2021 18:57:02 UTC

Severity: normal

Tags: fixed, patch

Fixed in version 28.1

Done: Stefan Kangas <stefan <at> marxist.se>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Stefan Kangas <stefan <at> marxist.se>
To: Philip Kaludercic <philipk <at> posteo.net>
Cc: 47877 <at> debbugs.gnu.org
Subject: bug#47877: [PATCH] Respect sgml-xml-mode
Date: Wed, 21 Apr 2021 08:41:45 -0500
tags 47877 fixed
close 47877 28.1
thanks

Philip Kaludercic <philipk <at> posteo.net> writes:

> Stefan Kangas <stefan <at> marxist.se> writes:
>
>> Philip Kaludercic <philipk <at> 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.




This bug report was last modified 4 years and 26 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.