all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#17264: 24.4.50; nxml-mode does not apply comment face correctly
@ 2014-04-14  6:19 Jan D.
  2014-04-16 15:28 ` Stefan Monnier
  0 siblings, 1 reply; 3+ messages in thread
From: Jan D. @ 2014-04-14  6:19 UTC (permalink / raw)
  To: 17264

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 
eggert@cs.ucla.edu-20140414053545-k3pyhn3ylsex57o0
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))





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

* bug#17264: 24.4.50; nxml-mode does not apply comment face correctly
  2014-04-14  6:19 bug#17264: 24.4.50; nxml-mode does not apply comment face correctly Jan D.
@ 2014-04-16 15:28 ` Stefan Monnier
  2014-04-16 16:31   ` Jan D.
  0 siblings, 1 reply; 3+ messages in thread
From: Stefan Monnier @ 2014-04-16 15:28 UTC (permalink / raw)
  To: Jan D.; +Cc: 17264-done

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






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

* bug#17264: 24.4.50; nxml-mode does not apply comment face correctly
  2014-04-16 15:28 ` Stefan Monnier
@ 2014-04-16 16:31   ` Jan D.
  0 siblings, 0 replies; 3+ messages in thread
From: Jan D. @ 2014-04-16 16:31 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: 17264-done

Hello.
Stefan Monnier skrev 2014-04-16 17:28:
>> 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.


It does, thanks.

	Jan D.

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






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

end of thread, other threads:[~2014-04-16 16:31 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-04-14  6:19 bug#17264: 24.4.50; nxml-mode does not apply comment face correctly Jan D.
2014-04-16 15:28 ` Stefan Monnier
2014-04-16 16:31   ` Jan D.

Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.