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: Re: A debugging puzzle with XML Date: Thu, 29 Jan 2015 12:07:48 +0100 Message-ID: <87zj91deuz.fsf@wmi.amu.edu.pl> References: <87a912ernj.fsf@wmi.amu.edu.pl> <87h9v9ampc.fsf@yahoo.fr> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1422529697 19382 80.91.229.3 (29 Jan 2015 11:08:17 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 29 Jan 2015 11:08:17 +0000 (UTC) To: Help Gnu Emacs mailing list Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Jan 29 12:08:13 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 1YGmxH-0000Y9-R6 for geh-help-gnu-emacs@m.gmane.org; Thu, 29 Jan 2015 12:08:11 +0100 Original-Received: from localhost ([::1]:58934 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YGmxG-0000cb-Lv for geh-help-gnu-emacs@m.gmane.org; Thu, 29 Jan 2015 06:08:10 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:35606) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YGmx4-0000cW-6x for help-gnu-emacs@gnu.org; Thu, 29 Jan 2015 06:07:59 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YGmx0-0003HK-5P for help-gnu-emacs@gnu.org; Thu, 29 Jan 2015 06:07:58 -0500 Original-Received: from msg.wmi.amu.edu.pl ([2001:808:114:2::50]:47298) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YGmwz-0003H4-Tw for help-gnu-emacs@gnu.org; Thu, 29 Jan 2015 06:07:54 -0500 Original-Received: from localhost (localhost [127.0.0.1]) by msg.wmi.amu.edu.pl (Postfix) with ESMTP id EC8934AD70 for ; Thu, 29 Jan 2015 12:07:50 +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 rQ4zzs5+Vtpt for ; Thu, 29 Jan 2015 12:07:50 +0100 (CET) Original-Received: from localhost (unknown [150.254.81.143]) by msg.wmi.amu.edu.pl (Postfix) with ESMTPSA id C7C2E4AD6D for ; Thu, 29 Jan 2015 12:07:50 +0100 (CET) In-reply-to: <87h9v9ampc.fsf@yahoo.fr> 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:102357 Archived-At: On 2015-01-29, at 11:46, Nicolas Richard wrote: > Marcin Borkowski writes: >> (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? > > Ok let's play the game (i.e. I didn't try) : My guess is that since > `with-temp-file' doesn't set the major mode (i.e. it will be > fundamental-mode), there are local variables which are not set as > sgml-pretty-print would expect. Good catch! To be more precise: sgml-pretty-print calls reindent-then-newline-and-indent, which depends on the mode. It took me almost half an hour of frustration... I guess this is just another step on the path to real Emacs expertise, which I hope to finish within a two-digit number of years... (That assuming that "finishing" it is at all possible.) Best, -- Marcin Borkowski http://octd.wmi.amu.edu.pl/en/Marcin_Borkowski Faculty of Mathematics and Computer Science Adam Mickiewicz University