bug-gnu-emacs
[Top][All Lists]
Advanced

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

bug#26922: 26.0.50; mhtml-mode fontification problem


From: Stephen Berman
Subject: bug#26922: 26.0.50; mhtml-mode fontification problem
Date: Sun, 14 May 2017 14:42:36 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux)

0. Create the file "test.html" with the following content:
--8<---------------cut here---------------start------------->8---
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
          "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd";>
<html xmlns="http://www.w3.org/1999/xhtml";>
  <head>
  </head>
  <body>
    <p>This is a test.</p>
  </body>
</html>
--8<---------------cut here---------------end--------------->8---

1. emacs -Q path/to/test.html
2. Notice that the first three lines are fontified with
   font-lock-string-face and the remaining lines with a mix of faces as
   appropriate for the mode (identified as XHTML+ in the mode line).
3. Put point on line 3 ("http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd";>)
   and press TAB, making the line indent to column 1.
=> Now the entire buffer is fontified with font-lock-string-face.

Undoing the reindentation triggered by TAB in step 3 does not restore
the fontification, nor does `M-x font-lock-fontify-buffer' or disabling
and then re-enabling font-lock-mode in the buffer.  However, altering
the first line (<?xml version="1.0" encoding="iso-8859-1"?>) does
restore the fontification.  A subsequent modification to line 3 again
renders the whole buffer in font-lock-string-face -- but changing line 2
does not have this effect, nor does typing `M-^' on line 3 to join it to
line 2.

The faulty refontification does not happen with the above recipe in
Emacs 25.2, nor does it happen in master if, prior to step 1 above, I
evaluate this line:

(add-to-list 'auto-mode-alist '("\\.[sx]?html?\\(\\.[a-zA-Z_]+\\)?\\'" . 
html-mode))

to make the file get visited in html-mode (with mode line lighter XTHML)
instead of mhtml-mode.


In GNU Emacs 26.0.50 (build 4, x86_64-pc-linux-gnu, GTK+ Version 3.20.10)
 of 2017-05-14 built on rosalinde
Repository revision: 4132bd74e9816ca913f862835cc062e092ab8b79
Windowing system distributor 'The X.Org Foundation', version 11.0.11803000
System Description:     openSUSE Leap 42.2

Configured using:
 'configure --with-xwidgets 'CFLAGS=-Og -g3''

Configured features:
XPM JPEG TIFF GIF PNG RSVG IMAGEMAGICK SOUND DBUS GSETTINGS NOTIFY
GNUTLS LIBXML2 FREETYPE M17N_FLT LIBOTF XFT ZLIB TOOLKIT_SCROLL_BARS
GTK3 X11 XWIDGETS

Important settings:
  value of $LANG: en_US.UTF-8
  value of $XMODIFIERS: @im=local
  locale-coding-system: utf-8-unix





reply via email to

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