From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Xah Lee Newsgroups: gmane.emacs.help Subject: Re: one line big XML to multiline Date: Tue, 3 Jul 2012 16:06:31 -0700 (PDT) Organization: http://groups.google.com Message-ID: <8bd5fa54-ef15-48c7-af03-135cb7db8fb7@n9g2000pbi.googlegroups.com> References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1341357314 1700 80.91.229.3 (3 Jul 2012 23:15:14 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Tue, 3 Jul 2012 23:15:14 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Jul 04 01:15:14 2012 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 1SmCJN-0004aI-V9 for geh-help-gnu-emacs@m.gmane.org; Wed, 04 Jul 2012 01:15:14 +0200 Original-Received: from localhost ([::1]:47944 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SmCJM-0004R3-QU for geh-help-gnu-emacs@m.gmane.org; Tue, 03 Jul 2012 19:15:12 -0400 Original-Path: usenet.stanford.edu!postnews.google.com!n9g2000pbi.googlegroups.com!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 22 Original-NNTP-Posting-Host: 76.126.112.84 Original-X-Trace: posting.google.com 1341357258 20825 127.0.0.1 (3 Jul 2012 23:14:18 GMT) Original-X-Complaints-To: groups-abuse@google.com Original-NNTP-Posting-Date: Tue, 3 Jul 2012 23:14:18 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: n9g2000pbi.googlegroups.com; posting-host=76.126.112.84; posting-account=bRPKjQoAAACxZsR8_VPXCX27T2YcsyMA User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/536.11 (KHTML, like Gecko) Chrome/20.0.1132.47 Safari/536.11,gzip(gfe) Original-Xref: usenet.stanford.edu gnu.emacs.help:193248 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:85637 Archived-At: On Jul 2, 4:16=C2=A0am, Mihamina Rakotomandimby wrote: > Hi all, > > I got a big one line XML file. > I want to break the lines to make it more readable. > > Replacing "><" with "C-j" then indenting is the most obvious solution, > but would you know a more elegant solution? > > I'm using Emacs 23 (FC17) with nXml or sgml-mode usable. you can record a keyboard macro, save it, assign it a key. So, just press one key, and the file is indented and well-formatted. =E3=80=88Emacs: Using Keyboard Macro to Record/Playback Keystrokes=E3=80=89 http://ergoemacs.org/emacs/emacs_macro_example.html to indent, just select all then =E3=80=90Ctrl+Alt+\=E3=80=91. or, this can be easily done by writing a elisp command. Xah