From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Marcin Borkowski Newsgroups: gmane.emacs.help Subject: A debugging puzzle with XML Date: Wed, 28 Jan 2015 18:33:52 +0100 Message-ID: <87a912ernj.fsf@wmi.amu.edu.pl> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1422466465 14601 80.91.229.3 (28 Jan 2015 17:34:25 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 28 Jan 2015 17:34:25 +0000 (UTC) To: Help Gnu Emacs mailing list Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Jan 28 18:34:24 2015 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1YGWVR-00038S-QD for geh-help-gnu-emacs@m.gmane.org; Wed, 28 Jan 2015 18:34:21 +0100 Original-Received: from localhost ([::1]:55143 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YGWVR-0005wA-8C for geh-help-gnu-emacs@m.gmane.org; Wed, 28 Jan 2015 12:34:21 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:46900) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YGWVG-0005vf-0d for help-gnu-emacs@gnu.org; Wed, 28 Jan 2015 12:34:10 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YGWVA-0000GL-IQ for help-gnu-emacs@gnu.org; Wed, 28 Jan 2015 12:34:09 -0500 Original-Received: from msg.wmi.amu.edu.pl ([2001:808:114:2::50]:51557) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YGWVA-0000FJ-CD for help-gnu-emacs@gnu.org; Wed, 28 Jan 2015 12:34:04 -0500 Original-Received: from localhost (localhost [127.0.0.1]) by msg.wmi.amu.edu.pl (Postfix) with ESMTP id 8A2DE4AD70 for ; Wed, 28 Jan 2015 18:34:01 +0100 (CET) Original-Received: from msg.wmi.amu.edu.pl ([127.0.0.1]) by localhost (msg.wmi.amu.edu.pl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id cAPoA+OqPpyT for ; Wed, 28 Jan 2015 18:34:01 +0100 (CET) Original-Received: from localhost (117-116.echostar.pl [213.156.117.116]) by msg.wmi.amu.edu.pl (Postfix) with ESMTPSA id 4D89F4AD6F for ; Wed, 28 Jan 2015 18:34:01 +0100 (CET) X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:808:114:2::50 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:102339 Archived-At: Hi there, as we all know, everything is better with XML, so here's a puzzle for all interested (I call it a puzzle and not a bug because I finally solved it). Download the xmlgen library (https://github.com/philjackson/xmlgen) and execute this code: (require 'xmlgen) (with-temp-file "foo.xml" (insert (xmlgen '(hello (world (of (xml) "!")))))). Visit file foo.xml, do this: C-x h M-x sgml-pretty-print and enjoy your beautifully formatted (and indented!) XML code. Now rinse and repeat, but with one change: (require 'xmlgen) (with-temp-file "foo.xml" (insert (xmlgen '(hello (world (of (xml) "!"))))) (sgml-pretty-print (point-min) (point-max))) and answer this question: where have all the indents go? ;-D Best, -- Marcin Borkowski http://octd.wmi.amu.edu.pl/en/Marcin_Borkowski Faculty of Mathematics and Computer Science Adam Mickiewicz University