* wrapping xml
@ 2006-05-18 14:03 rahed
0 siblings, 0 replies; 5+ messages in thread
From: rahed @ 2006-05-18 14:03 UTC (permalink / raw)
Hi,
I opened an xml file in emacs 22.0. The xml is not formatted being
one-liner. I tried to find something in sgml or nxml mode to pretty wrap
the code but didn't succeed. Is something simple available?
E.g. in a pspad editor which I have at hand I can pretty format through
one button.
Thanks for advice.
--
Radek
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: wrapping xml
[not found] <mailman.2016.1147961097.9609.help-gnu-emacs@gnu.org>
@ 2006-05-19 14:18 ` Mathias Dahl
2006-05-19 17:08 ` Ted Zlatanov
0 siblings, 1 reply; 5+ messages in thread
From: Mathias Dahl @ 2006-05-19 14:18 UTC (permalink / raw)
rahed <rahed@e-last-minute.com> writes:
> I opened an xml file in emacs 22.0. The xml is not formatted being
> one-liner. I tried to find something in sgml or nxml mode to pretty wrap
> the code but didn't succeed. Is something simple available?
I wondered the same thing a while ago and did not bother to find out
how it could be done. Instead I wrote a keyboard macro that did
something like this:
1. Search for "<"
2. Back up one character
3. Press return to move the rest of the line down
4. Press Tab to make Emacs indent the line
Save macro. Execute, execute again...
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: wrapping xml
2006-05-19 14:18 ` wrapping xml Mathias Dahl
@ 2006-05-19 17:08 ` Ted Zlatanov
2006-05-22 6:34 ` Mathias Dahl
2006-05-22 8:38 ` rahed
0 siblings, 2 replies; 5+ messages in thread
From: Ted Zlatanov @ 2006-05-19 17:08 UTC (permalink / raw)
On 19 May 2006, brakjoller@gmail.com wrote:
> rahed <rahed@e-last-minute.com> writes:
>
>> I opened an xml file in emacs 22.0. The xml is not formatted being
>> one-liner. I tried to find something in sgml or nxml mode to pretty wrap
>> the code but didn't succeed. Is something simple available?
>
> I wondered the same thing a while ago and did not bother to find out
> how it could be done. Instead I wrote a keyboard macro that did
> something like this:
>
> 1. Search for "<"
> 2. Back up one character
> 3. Press return to move the rest of the line down
> 4. Press Tab to make Emacs indent the line
>
> Save macro. Execute, execute again...
You can just replace "<" with "^M<" and then reindent the region. The
^M is produced by C-q ENTER.
Ted
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: wrapping xml
2006-05-19 17:08 ` Ted Zlatanov
@ 2006-05-22 6:34 ` Mathias Dahl
2006-05-22 8:38 ` rahed
1 sibling, 0 replies; 5+ messages in thread
From: Mathias Dahl @ 2006-05-22 6:34 UTC (permalink / raw)
Ted Zlatanov <tzz@lifelogs.com> writes:
>> 1. Search for "<"
>> 2. Back up one character
>> 3. Press return to move the rest of the line down
>> 4. Press Tab to make Emacs indent the line
>>
>> Save macro. Execute, execute again...
>
> You can just replace "<" with "^M<" and then reindent the region. The
> ^M is produced by C-q ENTER.
Ah, of course, was just checking that people were awake... :) Also,
this requires the XML mode to support indentation. At least some years
ago that did not work by default (SGML-mode?).
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: wrapping xml
2006-05-19 17:08 ` Ted Zlatanov
2006-05-22 6:34 ` Mathias Dahl
@ 2006-05-22 8:38 ` rahed
1 sibling, 0 replies; 5+ messages in thread
From: rahed @ 2006-05-22 8:38 UTC (permalink / raw)
Ted Zlatanov <tzz@lifelogs.com> writes:
> You can just replace "<" with "^M<" and then reindent the region. The
> ^M is produced by C-q ENTER.
>
> Ted
I replaced '<' with 'C-q C-j <' and aplied M-x indent-region with the
result I expected.
Thanks much.
--
Radek
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2006-05-22 8:38 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <mailman.2016.1147961097.9609.help-gnu-emacs@gnu.org>
2006-05-19 14:18 ` wrapping xml Mathias Dahl
2006-05-19 17:08 ` Ted Zlatanov
2006-05-22 6:34 ` Mathias Dahl
2006-05-22 8:38 ` rahed
2006-05-18 14:03 rahed
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).