From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Drew Adams" Newsgroups: gmane.emacs.devel Subject: RE: Indentation contest nxml vs xml-mode Date: Thu, 6 Mar 2008 14:21:28 -0800 Message-ID: <00da01c87fd8$6c881420$0600a8c0@us.oracle.com> References: <47D03AE7.8070408@gmail.com> <00a601c87fba$febc3150$0600a8c0@us.oracle.com> <47D0679F.5000001@gmail.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1204842194 7124 80.91.229.12 (6 Mar 2008 22:23:14 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 6 Mar 2008 22:23:14 +0000 (UTC) Cc: 'Emacs Devel' To: "'Lennart Borgman \(gmail\)'" Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Mar 06 23:23:42 2008 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1JXOUt-0001mr-Gk for ged-emacs-devel@m.gmane.org; Thu, 06 Mar 2008 23:23:31 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JXOUL-0004bi-KS for ged-emacs-devel@m.gmane.org; Thu, 06 Mar 2008 17:22:57 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JXOUH-0004bc-R0 for emacs-devel@gnu.org; Thu, 06 Mar 2008 17:22:53 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JXOUH-0004b3-5M for emacs-devel@gnu.org; Thu, 06 Mar 2008 17:22:53 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JXOUG-0004an-VZ for emacs-devel@gnu.org; Thu, 06 Mar 2008 17:22:52 -0500 Original-Received: from agminet01.oracle.com ([141.146.126.228]) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1JXOUG-000749-Hn for emacs-devel@gnu.org; Thu, 06 Mar 2008 17:22:52 -0500 Original-Received: from agmgw2.us.oracle.com (agmgw2.us.oracle.com [152.68.180.213]) by agminet01.oracle.com (Switch-3.2.4/Switch-3.1.7) with ESMTP id m26MMcF3003230; Thu, 6 Mar 2008 16:22:38 -0600 Original-Received: from acsmt350.oracle.com (acsmt350.oracle.com [141.146.40.150]) by agmgw2.us.oracle.com (Switch-3.2.0/Switch-3.2.0) with ESMTP id m26FsYVr019989; Thu, 6 Mar 2008 15:22:37 -0700 Original-Received: from inet-141-146-46-1.oracle.com by acsmt351.oracle.com with ESMTP id 3602989591204842084; Thu, 06 Mar 2008 14:21:24 -0800 Original-Received: from dradamslap1 (/141.144.72.2) by bhmail.oracle.com (Oracle Beehive Gateway v4.0) with ESMTP ; Thu, 06 Mar 2008 14:21:24 -0800 X-Mailer: Microsoft Office Outlook 11 In-Reply-To: <47D0679F.5000001@gmail.com> X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3198 Thread-Index: Ach/1JDZvYiPXE9ESPmW07eKeWEMowAAHSQw X-Brightmail-Tracker: AAAAAQAAAAI= X-Brightmail-Tracker: AAAAAQAAAAI= X-Whitelist: TRUE X-Whitelist: TRUE X-detected-kernel: by monty-python.gnu.org: Linux 2.4-2.6 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:91556 Archived-At: > ***** xml-mode > > > Duh > > > > > ***** nxml-mode > > > Duh > > > IMO, neither is great (both are ugly and confusing). I've never seen XML indented like either of those (except when it wasn't formatted at all). FWIW, I use this: Duh IOW: 1. Align opening and closing tags. 2. Indent just enough so that nested tags start after the Duh some more That can also work well in some contexts. I present lots of XML in doc everyday. I haven't found anything more readable than just indenting two spaces and aligning the corresponding element tags. I also align attributes. But I never, ever introduce or change significant whitespace, such as that within a text() node, if I can avoid it. For example, I never indent the text here: some text that is too long for a printed line That should never be changed by automatic indentation to, say, this: some text that is too long for a printed line or this: some text that is too long for a printed line or anything else - it should not be changed at all. If the representation (e.g. HTML or PDF doc) can't reasonably let it wrap naturally (without, e.g., introducing a scroll bar), then a single newline is best, with no indentation. Readers will get the idea that it represents wrapped text and it really isn't split at all. I mention this because there was some question here a while back about it. Indentation (e.g. pretty-printing) should avoid changing significant whitespace. HTH.