From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Alex Harsanyi Newsgroups: gmane.emacs.bugs Subject: bug#10405: 24.0.92; XML parser -- problem handling comments Date: Fri, 30 Dec 2011 08:44:13 +0800 Message-ID: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1325205920 25302 80.91.229.12 (30 Dec 2011 00:45:20 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Fri, 30 Dec 2011 00:45:20 +0000 (UTC) To: 10405@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Dec 30 01:45:16 2011 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1RgQax-0007zz-12 for geb-bug-gnu-emacs@m.gmane.org; Fri, 30 Dec 2011 01:45:15 +0100 Original-Received: from localhost ([::1]:35376 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RgQaw-0003jB-9w for geb-bug-gnu-emacs@m.gmane.org; Thu, 29 Dec 2011 19:45:14 -0500 Original-Received: from eggs.gnu.org ([140.186.70.92]:33731) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RgQat-0003j2-Lc for bug-gnu-emacs@gnu.org; Thu, 29 Dec 2011 19:45:12 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RgQas-0008KD-H2 for bug-gnu-emacs@gnu.org; Thu, 29 Dec 2011 19:45:11 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:58133) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RgQas-0008K9-E2 for bug-gnu-emacs@gnu.org; Thu, 29 Dec 2011 19:45:10 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1RgQde-000192-Eo for bug-gnu-emacs@gnu.org; Thu, 29 Dec 2011 19:48:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Alex Harsanyi Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 30 Dec 2011 00:48:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 10405 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.13252060414337 (code B ref -1); Fri, 30 Dec 2011 00:48:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 30 Dec 2011 00:47:21 +0000 Original-Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RgQcy-00017t-Ro for submit@debbugs.gnu.org; Thu, 29 Dec 2011 19:47:21 -0500 Original-Received: from eggs.gnu.org ([140.186.70.92]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RgQcv-00017j-7A for submit@debbugs.gnu.org; Thu, 29 Dec 2011 19:47:19 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RgQa7-0008As-3X for submit@debbugs.gnu.org; Thu, 29 Dec 2011 19:44:24 -0500 Original-Received: from lists.gnu.org ([140.186.70.17]:40743) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RgQa7-0008Am-22 for submit@debbugs.gnu.org; Thu, 29 Dec 2011 19:44:23 -0500 Original-Received: from eggs.gnu.org ([140.186.70.92]:54217) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RgQa5-0003dQ-HL for bug-gnu-emacs@gnu.org; Thu, 29 Dec 2011 19:44:22 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RgQa4-0008AZ-8Y for bug-gnu-emacs@gnu.org; Thu, 29 Dec 2011 19:44:21 -0500 Original-Received: from outbound-mail03.westnet.com.au ([203.10.1.244]:27999) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RgQa3-0008AK-RV for bug-gnu-emacs@gnu.org; Thu, 29 Dec 2011 19:44:20 -0500 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApIBAHcI/U7LziPj/2dsb2JhbAAMN6oOhgUTLwGBfr1JiyxjBIg1nw4 X-IronPort-AV: E=Sophos;i="4.71,430,1320595200"; d="scan'208";a="189029328" Original-Received: from 203-206-35-227.dyn.iinet.net.au (HELO [10.0.1.3]) ([203.206.35.227]) by outbound-mail03.westnet.com.au with ESMTP/TLS/AES128-SHA; 30 Dec 2011 08:44:56 +0800 X-Mailer: Apple Mail (2.1084) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list Resent-Date: Thu, 29 Dec 2011 19:48:02 -0500 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:55291 Archived-At: 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: 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 ") ! nil) ;; end tag ((looking-at "") ! (skip-syntax-forward " ") ! (xml-parse-tag parse-dtd xml-ns)) ;; end tag ((looking-at " < ! - - SPC h e l l o SPC - - > < o u t e r > < i n n e r > < / i n n e r > / < / o u t e r > s-: s-( s-: s-: M-: e x ( x m o l - p a s e r s e - r e g i o n SPC ( p o i n t - m i n ) SPC ( p o i n t ) - m a x ) ) M-: SPC M-: M-: M-x r e p o r t 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)