From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Stuart D. Herring" Newsgroups: gmane.emacs.devel Subject: Re: Recent documents: Emacs and GNOME integration Date: Wed, 17 May 2006 11:50:33 -0700 (PDT) Message-ID: <49065.128.165.123.132.1147891833.squirrel@webmail.lanl.gov> References: <1147396844.567992.55920@i40g2000cwc.googlegroups.com><7dbe73ed0605170050k53a88da4j81d723f2ea0202da@mail.gmail.com> <3c12eb8d0605170737p4f172fabya587f640eebbbbe6@mail.gmail.com> Reply-To: herring@lanl.gov NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain;charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Trace: sea.gmane.org 1147891877 20246 80.91.229.2 (17 May 2006 18:51:17 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 17 May 2006 18:51:17 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed May 17 20:51:15 2006 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1FgR74-0004iL-Fd for ged-emacs-devel@m.gmane.org; Wed, 17 May 2006 20:51:14 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FgR74-0007CN-3a for ged-emacs-devel@m.gmane.org; Wed, 17 May 2006 14:51:14 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1FgR6a-000746-Jm for emacs-devel@gnu.org; Wed, 17 May 2006 14:50:44 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1FgR6Y-000735-11 for emacs-devel@gnu.org; Wed, 17 May 2006 14:50:44 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FgR6X-000730-T2 for emacs-devel@gnu.org; Wed, 17 May 2006 14:50:41 -0400 Original-Received: from [192.65.95.54] (helo=mailwasher-b.lanl.gov) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA:32) (Exim 4.52) id 1FgR9S-00083q-HT for emacs-devel@gnu.org; Wed, 17 May 2006 14:53:42 -0400 Original-Received: from mailrelay1.lanl.gov (mailrelay1.lanl.gov [128.165.4.101]) by mailwasher-b.lanl.gov (8.12.11.20060308/8.12.11/(ccn-5)) with ESMTP id k4HIoZHa017622 for ; Wed, 17 May 2006 12:50:36 -0600 Original-Received: from webmail1.lanl.gov (webmail1.lanl.gov [128.165.4.106]) by mailrelay1.lanl.gov (8.12.11.20060308/8.12.11/(ccn-5)) with ESMTP id k4HIoX2A028972; Wed, 17 May 2006 12:50:33 -0600 Original-Received: from webmail1.lanl.gov (localhost.localdomain [127.0.0.1]) by webmail1.lanl.gov (8.12.11.20060308/8.12.11) with ESMTP id k4HIoXPe019068; Wed, 17 May 2006 12:50:33 -0600 Original-Received: (from apache@localhost) by webmail1.lanl.gov (8.12.11.20060308/8.12.11/Submit) id k4HIoXfd019065; Wed, 17 May 2006 11:50:33 -0700 X-Authentication-Warning: webmail1.lanl.gov: apache set sender to herring@lanl.gov using -f Original-Received: from 128.165.123.132 (SquirrelMail authenticated user 196434); by webmail.lanl.gov with HTTP; Wed, 17 May 2006 11:50:33 -0700 (PDT) In-Reply-To: <3c12eb8d0605170737p4f172fabya587f640eebbbbe6@mail.gmail.com> Original-To: "Piotr Zielinski" User-Agent: SquirrelMail/1.4.3a-11.EL3 X-Mailer: SquirrelMail/1.4.3a-11.EL3 X-Priority: 3 (Normal) Importance: Normal X-PMX-Version: 4.7.1.128075 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:54640 Archived-At: > That would be sensible, however, we'd need an emacs package for xml > manipulation. As far as I can see, xml.el is only a parser (can't > modify an existing xml tree). xml.el contains the function `xml-debug-print' which inserts the XML represented by the internal list form into a buffer. It's not very robust (for instance, it doesn't attempt to substitute "&" back in for "&"), but it seems to me that as long as retaining original formatting is unnecessary, it could be made into a reasonable "Lisp (form of the data) to XML" converter. Then you'd just use the standard Lisp capacities for modifying/creating lists and you'd have XML modification capacity. I'm not an expert on XML, but I could probably manage this if no one else is any better. For starters, here's a trivial patch to print namespaced tags instead of dying on them. Hoping that the patch doesn't reveal that I shouldn't be touching this at all, Davis *** xml.el.~1.53.~ 2006-02-06 07:33:36.000000000 -0700 --- xml.el 2006-05-17 12:48:39.000000000 -0600 *************** *** 118,123 **** --- 118,129 ---- (car node)) + (defsubst xml-node-name-as-string (node) + "Return the tag associated with NODE as a string." + (setq node (xml-node-name node)) + (if (symbolp node) (symbol-name node) + (concat (car node) (cdr node)))) + (defsubst xml-node-attributes (node) "Return the list of attributes of NODE. The list can be nil." *************** *** 848,854 **** The first line is indented with INDENT-STRING." (let ((tree xml) attlist) ! (insert indent-string ?< (symbol-name (xml-node-name tree))) ;; output the attribute list (setq attlist (xml-node-attributes tree)) --- 854,860 ---- The first line is indented with INDENT-STRING." (let ((tree xml) attlist) ! (insert indent-string ?< (symbol-name (xml-node-name-as-string tree))) ;; output the attribute list (setq attlist (xml-node-attributes tree)) *************** *** 875,881 **** (when (not (and (null (cdr tree)) (stringp (car tree)))) (insert ?\n indent-string)) ! (insert ?< ?/ (symbol-name (xml-node-name xml)) ?>)))) (provide 'xml) --- 881,887 ---- (when (not (and (null (cdr tree)) (stringp (car tree)))) (insert ?\n indent-string)) ! (insert ?< ?/ (symbol-name (xml-node-name-as-string xml)) ?>)))) (provide 'xml) -- This product is sold by volume, not by mass. If it appears too dense or too sparse, it is because mass-energy conversion has occurred during shipping.