help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: A debugging puzzle with XML


From: Marcin Borkowski
Subject: Re: A debugging puzzle with XML
Date: Thu, 29 Jan 2015 12:07:48 +0100

On 2015-01-29, at 11:46, Nicolas Richard <theonewiththeevillook@yahoo.fr> wrote:

> Marcin Borkowski <mbork@wmi.amu.edu.pl> 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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]