Subject: bug#17264: closed (Re: bug#17264: 24.4.50; nxml-mode does not apply comment face correctly)

From: [email-masked] (GNU bug Tracking System)
Date: Wed, 16 Apr 2014 15:29:02 +0000

Your bug report

#17264: 24.4.50; nxml-mode does not apply comment face correctly

which was filed against the emacs package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
17264: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=17264
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug#17264: 24.4.50; nxml-mode does not apply comment face correctly
From: Stefan Monnier <[email-masked]>
To: "Jan D." <[email-masked]>
Cc: [email-masked]
Date: Wed, 16 Apr 2014 11:28:43 -0400
List-Id: <debbugs-submit.debbugs.gnu.org>

> The commented section is in comment face (red text color).
> Actual:
> The commented region is not in the comment-face, it is fontified as
> normal XML.

I installed the patch below which seems to help.  It's kind of a mess, tho.

        Stefan

=== modified file 'lisp/nxml/nxml-mode.el'
--- lisp/nxml/nxml-mode.el	2014-03-21 06:56:55 +0000
+++ lisp/nxml/nxml-mode.el	2014-04-16 15:22:57 +0000
@@ -872,7 +872,7 @@
 
 (defun nxml-fontify-matcher (bound)
   "Called as font-lock keyword matcher."
-
+  (syntax-propertize bound)
   (unless nxml-degraded
     (nxml-debug-change "nxml-fontify-matcher" (point) bound)

=== modified file 'lisp/nxml/xmltok.el'
--- lisp/nxml/xmltok.el	2014-03-21 06:56:55 +0000
+++ lisp/nxml/xmltok.el	2014-04-16 15:05:55 +0000
@@ -750,7 +750,8 @@
                  ;; Need do this after the goto-char because
                  ;; marked error should just apply to <!--
                  (xmltok-add-error "First following `--' not followed by `>'")
-                 'not-well-formed)))))
+                 (goto-char (point-max))
+                 'comment)))))
 
 (defun xmltok-scan-attributes ()
   (let ((recovering nil)

Subject: 24.4.50; nxml-mode does not apply comment face correctly
From: "Jan D." <[email-masked]>
To: [email-masked]
Date: Mon, 14 Apr 2014 08:19:26 +0200
List-Id: <debbugs-submit.debbugs.gnu.org>

Hello.

Save this file to xx.xml (the ---... aren't part of the file):
-------------------------------------------------------------
<?xml version="1.0" encoding="UTF-8"?>
<spocosy version="1.0" responsetime="2011-03-15 13:53:12" exec="0.171">
   <query-response requestid="" service="objectquery">
     <sport name="Soccer" enetSportCode="s" del="no" n="1" 
ut="2009-12-29 15:36:24" id="1">
     </sport>
   </query-response>
</spocosy>
-------------------------------------------------------------

Start Emacs:

% emacs -Q xx.xml
Put cursor on the line with <query-response ...

C-a C-o <TAB> <!-- C-a C-k C-k C-o <TAB> <!--

Move cursor to </spocosy>

C-o <TAB> -->

Expected:
The commented section is in comment face (red text color).
Actual:
The commented region is not in the comment-face, it is fontified as 
normal XML.

It appears to be some timing here, because sometimes the comment face is 
applied when entering <!-- for the first time.  That is why the recepie 
removes it and adds it again.  Saving and then doing M-x revert-buffer 
always fixes the issue, i.e. comment face is applied correctly.

	Jan D.

In GNU Emacs 24.4.50.1 (x86_64-apple-darwin13.1.0, NS apple-appkit-1265.19)
  of 2014-04-14 on jdvpro.hq.ismobile.com
Repository revision: 116975 
[email-masked]
Windowing system distributor `Apple', version 10.3.1265
Configured using:
  `configure --with-ns --without-x'

Configured features:
ACL LIBXML2 ZLIB

Important settings:
   value of $LC_COLLATE: C
   value of $LANG: sv_SE.UTF-8
   locale-coding-system: utf-8-unix

Major mode: nXML

Minor modes in effect:
   tooltip-mode: t
   electric-indent-mode: t
   mouse-wheel-mode: t
   tool-bar-mode: t
   menu-bar-mode: t
   file-name-shadow-mode: t
   global-font-lock-mode: t
   font-lock-mode: t
   blink-cursor-mode: t
   auto-composition-mode: t
   auto-encryption-mode: t
   auto-compression-mode: t
   line-number-mode: t
   transient-mark-mode: t

Recent input:
<escape> x r e p o r t - e <tab> <return>

Recent messages:
For information about GNU Emacs and the GNU system, type C-h C-a.
Using vacuous schema

Load-path shadows:
None found.

Features:
(shadow sort gnus-util mail-extr emacsbug message dired format-spec
rfc822 mml mml-sec mm-decode mm-bodies mm-encode mail-parse rfc2231
mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums
mm-util help-fns mail-prsvr mail-utils nxml-uchnm rng-xsd xsd-regexp
rng-cmpct rng-nxml rng-valid rng-loc rng-uri rng-parse nxml-parse
rng-match rng-dt rng-util rng-pttrn nxml-ns easymenu nxml-mode
nxml-outln nxml-rap nxml-util nxml-glyph nxml-enc xmltok time-date
tooltip electric uniquify ediff-hook vc-hooks lisp-float-type mwheel
ns-win tool-bar dnd fontset image regexp-opt fringe tabulated-list
newcomment lisp-mode prog-mode register page menu-bar rfn-eshadow timer
select scroll-bar mouse jit-lock font-lock syntax facemenu font-core
frame cham georgian utf-8-lang misc-lang vietnamese tibetan thai
tai-viet lao korean japanese hebrew greek romanian slovak czech european
ethiopic indian cyrillic chinese case-table epa-hook jka-cmpr-hook help
simple abbrev minibuffer nadvice loaddefs button faces cus-face macroexp
files text-properties overlay sha1 md5 base64 format env code-pages mule
custom widget hashtable-print-readable backquote make-network-process
cocoa ns multi-tty emacs)

Memory information:
((conses 16 88851 8273)
  (symbols 48 19142 0)
  (miscs 40 41 183)
  (strings 32 15355 4578)
  (string-bytes 1 415790)
  (vectors 16 11239)
  (vector-slots 8 381669 4227)
  (floats 8 81 135)
  (intervals 56 299 0)
  (buffers 960 13))