all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#10405: 24.0.92; XML parser -- problem handling comments
@ 2011-12-30  0:44 Alex Harsanyi
  2012-01-09 15:47 ` Michael Albinus
  0 siblings, 1 reply; 5+ messages in thread
From: Alex Harsanyi @ 2011-12-30  0:44 UTC (permalink / raw)
  To: 10405

There seems to be a bug in `xml-parse-tag' when handling comments.  To
reproduce it, create a buffer containing the following text on a single line:

    <!-- hello --><outer><inner></inner></outer>

Trying to parse this using 

   M-: (xml-parse-region (point-min) (point-max)) 

will return:

   ((inner nil))

instead of:

   ((outer nil (inner nil)))

Inserting a space or newline after the end comment tag (-->) seems to
avoid this bug.

The patch below fixes the problem, but I'm not sure if it is the correct
fix (I just copied the code from the part that handles processing
instructions, that start with <?):

=== modified file 'lisp/xml.el'
*** lisp/xml.el	2011-11-20 03:48:53 +0000
--- lisp/xml.el	2011-12-30 00:39:42 +0000
***************
*** 421,427 ****
       ;;  skip comments
       ((looking-at "<!--")
        (search-forward "-->")
!       nil)
       ;;  end tag
       ((looking-at "</")
        '())
--- 421,428 ----
       ;;  skip comments
       ((looking-at "<!--")
        (search-forward "-->")
!       (skip-syntax-forward " ")
!       (xml-parse-tag parse-dtd xml-ns))
       ;;  end tag
       ((looking-at "</")
        '())




In GNU Emacs 24.0.92.1 (x86_64-apple-darwin10.8.0, NS apple-appkit-1038.36)
of 2011-12-30 on karinji-2.local
Windowing system distributor `Apple', version 10.3.1038
configured using `configure  '--with-ns''

Important settings:
  value of $LC_ALL: nil
  value of $LC_COLLATE: nil
  value of $LC_CTYPE: nil
  value of $LC_MESSAGES: nil
  value of $LC_MONETARY: nil
  value of $LC_NUMERIC: nil
  value of $LC_TIME: nil
  value of $LANG: en_AU.UTF-8
  value of $XMODIFIERS: nil
  locale-coding-system: utf-8-unix
  default enable-multibyte-characters: t

Major mode: Fundamental

Minor modes in effect:
  tooltip-mode: t
  mouse-wheel-mode: t
  tool-bar-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-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:
C-x b * x m l * <return> < ! - - SPC h e l l o SPC 
- - > < o u t e r > < i n n e r > < / i n n e r > / 
<backspace> < / o u t e r > <return> <up> s-: s-( s-: 
s-: M-: e <backspace> x <backspace> ( x m o <backspace> 
l - p a s e <backspace> <backspace> r s e - r e g i 
o n SPC ( p o i n t - m i n ) SPC ( p o i n t ) <backspace> 
- m a x ) ) <return> <right> <right> <right> <right> 
<right> <right> <right> <right> <right> <right> <right> 
<right> <right> <right> <return> M-: <up> <return> 
<backspace> SPC M-: <up> <return> <right> <left> <backspace> 
M-: <down> <up> <return> <left> <right> <right> <right> 
<right> <right> <right> <right> <right> M-x r e p o 
<tab> r t <tab> <return>

Recent messages:
For information about GNU Emacs and the GNU system, type C-h C-a.
Starting new Ispell process [default] ...
Spell-checking *xml* using aspell with default dictionary...done
Spell-checking *xml* using aspell with default dictionary...done
Spell-checking *xml* using aspell with default dictionary...done
((inner nil))
((outer nil (inner nil))) [2 times]
goto-history-element: End of history; no default available
((inner nil))
Making completion list...

Load-path shadows:
None found.

Features:
(shadow sort gnus-util mail-extr message format-spec rfc822 mml mml-sec
mm-decode mm-bodies mm-encode mail-parse rfc2231 rfc2047 rfc2045
ietf-drums mm-util mail-prsvr mailabbrev mail-utils gmm-utils mailheader
emacsbug help-mode easymenu view xml regexp-opt ispell time-date tooltip
ediff-hook vc-hooks lisp-float-type mwheel ns-win tool-bar dnd fontset
image fringe lisp-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 loaddefs button faces cus-face files text-properties
overlay sha1 md5 base64 format env code-pages mule custom widget
hashtable-print-readable backquote make-network-process dbusbind ns
multi-tty emacs)





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

end of thread, other threads:[~2012-02-08  8:22 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-12-30  0:44 bug#10405: 24.0.92; XML parser -- problem handling comments Alex Harsanyi
2012-01-09 15:47 ` Michael Albinus
2012-01-27  8:47   ` Chong Yidong
2012-01-27 14:25     ` Mark A. Hershberger
2012-02-08  8:22     ` Michael Albinus

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.