From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.pretest.bugs,gmane.emacs.devel Subject: Re: Refactoring xml.el namespace handling Date: 04 Mar 2004 12:50:18 -0500 Sender: emacs-pretest-bug-bounces+gebp-emacs-pretest-bug=gmane.org@gnu.org Message-ID: References: <87u117ew6g.fsf@weblog.localhost> <878yiimo8x.fsf@weblog.localhost> NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1078705263 30079 80.91.224.253 (8 Mar 2004 00:21:03 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 8 Mar 2004 00:21:03 +0000 (UTC) Cc: emacs-pretest-bug@gnu.org, emacs-devel@gnu.org Original-X-From: emacs-pretest-bug-bounces+gebp-emacs-pretest-bug=gmane.org@gnu.org Mon Mar 08 01:20:57 2004 Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1B08Vt-0003sq-00 for ; Mon, 08 Mar 2004 01:20:57 +0100 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.30) id 1B08V8-0002ns-SS for gebp-emacs-pretest-bug@gmane.org; Sun, 07 Mar 2004 19:20:10 -0500 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.30) id 1Ayx0W-0007sC-QE for emacs-pretest-bug@gnu.org; Thu, 04 Mar 2004 12:51:40 -0500 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.30) id 1Aywzy-0007ia-HK for emacs-pretest-bug@gnu.org; Thu, 04 Mar 2004 12:51:37 -0500 Original-Received: from [132.204.24.67] (helo=mercure.iro.umontreal.ca) by monty-python.gnu.org with esmtp (Exim 4.30) id 1AywzQ-0007ZM-6Z; Thu, 04 Mar 2004 12:50:32 -0500 Original-Received: from asado.iro.umontreal.ca (asado.iro.umontreal.ca [132.204.24.84]) by mercure.iro.umontreal.ca (Postfix) with ESMTP id 53FA020CFA; Thu, 4 Mar 2004 12:50:21 -0500 (EST) Original-Received: by asado.iro.umontreal.ca (Postfix, from userid 20848) id 292178C8E4; Thu, 4 Mar 2004 12:50:19 -0500 (EST) Original-To: mah@everybody.org (Mark A. Hershberger) In-Reply-To: <878yiimo8x.fsf@weblog.localhost> Original-Lines: 43 User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3.50 X-DIRO-MailScanner-Information: Please contact the ISP for more information X-DIRO-MailScanner: Found to be clean X-DIRO-MailScanner-SpamCheck: n'est pas un polluriel, SpamAssassin (score=-1.524, requis 5, BAYES_01 -1.52) X-BeenThere: emacs-pretest-bug@gnu.org X-Mailman-Version: 2.1.2 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-pretest-bug-bounces+gebp-emacs-pretest-bug=gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.pretest.bugs:2337 gmane.emacs.devel:20260 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:20260 > Now that I've gotten a good HEAD, here is a fresh diff. Thank you. Here is a counter patch. The main difference is that it uses 'http://foo/bar rather than :http://foo/bar so as to avoid an unnecessary (concat ":" foo) and also so that (symbol-name foo) immediately returns a usable URL. It also cleans up a few elisp things (like replace mapcar->mapc->dolist, and (append (list x) y) -> (cons x y), ...). Things left: - it seems that the new code returns either a TAG (a symbol) or (NS . TAG) where TAG is a string rather than a symbol. Do I understand this right? Is that done on purpose? It looks like a bad idea. - in xml-parse-tag, you do (let (.. (children (list A B)) ...) ... (car children) ... (setcdr children ...) ... it would be better to do something slightly different so you don't need to extract the car of what you just built and you don't need to setcdr. Maybe something like (let (... (a A) (b B) ...) ... a ... (let ((children (list a (.. b ..)))) ...)) > 2004-03-03 Mark A. Hershberger > > * xml.el (xml-maybe-do-ns): new function to handle namespace > parsing of both attribute and element names. > (xml-ns-parse-ns-attrs, xml-ns-expand-el, xml-ns-expand-attr, > xml-intern-attrlist): Removed in favor of xml-maybe-do-ns to avoid > un-necessary intern-ing. > (xml-parse-tag): Updated assumed namespaces. Cleaned up namespace > parsing. > (xml-parse-attlist): Now does its own namespace parsing work. > (xml-parse-dtd): Updated hyphens. Now skips ENTITY, ATTLIST, and NOTATION instead of > barfing. ChangeLog text should use the present tense: it makes it easier to write/read. Stefan