From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Leo Newsgroups: gmane.emacs.bugs Subject: bug#6412: 23.2; [patch] nXML indentation bug Date: Sun, 13 Jun 2010 15:27:27 +0100 Message-ID: References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: dough.gmane.org 1276439315 5123 80.91.229.12 (13 Jun 2010 14:28:35 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sun, 13 Jun 2010 14:28:35 +0000 (UTC) To: 6412@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Jun 13 16:28:33 2010 connect(): No such file or directory Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1ONoAq-0001K7-Jn for geb-bug-gnu-emacs@m.gmane.org; Sun, 13 Jun 2010 16:28:32 +0200 Original-Received: from localhost ([127.0.0.1]:54073 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1ONoAq-0004oQ-1O for geb-bug-gnu-emacs@m.gmane.org; Sun, 13 Jun 2010 10:28:32 -0400 Original-Received: from [140.186.70.92] (port=51235 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1ONoAl-0004nM-MS for bug-gnu-emacs@gnu.org; Sun, 13 Jun 2010 10:28:28 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1ONoAj-0003wq-O8 for bug-gnu-emacs@gnu.org; Sun, 13 Jun 2010 10:28:27 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:44819) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1ONoAj-0003wg-Mm for bug-gnu-emacs@gnu.org; Sun, 13 Jun 2010 10:28:25 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1ONoAL-00051N-Lj; Sun, 13 Jun 2010 10:28:01 -0400 X-Loop: help-debbugs@gnu.org In-Reply-To: Resent-From: Leo Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 13 Jun 2010 14:28:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 6412 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 6412-submit@debbugs.gnu.org id=B6412.127643925719281 (code B ref 6412); Sun, 13 Jun 2010 14:28:01 +0000 Original-Received: (at 6412) by debbugs.gnu.org; 13 Jun 2010 14:27:37 +0000 Original-Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1ONo9w-00050w-MI for submit@debbugs.gnu.org; Sun, 13 Jun 2010 10:27:36 -0400 Original-Received: from ppsw-32.csi.cam.ac.uk ([131.111.8.132]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1ONo9u-00050j-9B for 6412@debbugs.gnu.org; Sun, 13 Jun 2010 10:27:35 -0400 X-Cam-AntiVirus: no malware found X-Cam-SpamDetails: not scanned X-Cam-ScannerInfo: http://www.cam.ac.uk/cs/email/scanner/ Original-Received: from cpc1-cmbg13-0-0-cust596.cmbg.cable.ntl.com ([86.9.122.85]:60748 helo=Victoria.local) by ppsw-32.csi.cam.ac.uk (smtp.hermes.cam.ac.uk [131.111.8.158]:587) with esmtpsa (PLAIN:sl392) (TLSv1:DHE-RSA-AES128-SHA:128) id 1ONo9o-0002rZ-2J (Exim 4.72) for 6412@debbugs.gnu.org (return-path ); Sun, 13 Jun 2010 15:27:28 +0100 User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (Mac OS X 10.6.3) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list Resent-Date: Sun, 13 Jun 2010 10:28:01 -0400 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:37740 Archived-At: --=-=-= Please ignore the patch in previous email (sorry for this). Here is the correct patch: --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-Fix-nxml-indent-line-to-be-consistent-with-other-mod.patch >From 3d8a976a0edad1b8e099a108320f60622d168ffb Mon Sep 17 00:00:00 2001 From: Leo Date: Sun, 13 Jun 2010 14:58:47 +0100 Subject: [PATCH] Fix nxml-indent-line to be consistent with other modes (#6412) Patch sent to http://debbugs.gnu.org/cgi/bugreport.cgi?bug=6412. --- lisp/nxml/nxml-mode.el | 18 ++++++++---------- 1 files changed, 8 insertions(+), 10 deletions(-) diff --git a/lisp/nxml/nxml-mode.el b/lisp/nxml/nxml-mode.el index 8919d92..5e9fd8c 100644 --- a/lisp/nxml/nxml-mode.el +++ b/lisp/nxml/nxml-mode.el @@ -1371,16 +1371,14 @@ of the inserted start-tag or nil if none was inserted." (defun nxml-indent-line () "Indent current line as XML." (let ((indent (nxml-compute-indent)) - (from-end (- (point-max) (point)))) - (when (and indent - (/= indent (current-indentation))) - (beginning-of-line) - (let ((bol (point))) - (skip-chars-forward " \t") - (delete-region bol (point))) - (indent-to indent) - (when (> (- (point-max) from-end) (point)) - (goto-char (- (point-max) from-end)))))) + (from-end (- (point-max) (point))) + (beg (progn (forward-line 0) (point)))) + (skip-chars-forward " \t") + (when (and indent (/= indent (current-indentation))) + (delete-region beg (point)) + (indent-to indent)) + (when (> (- (point-max) from-end) (point)) + (goto-char (- (point-max) from-end))))) (defun nxml-compute-indent () "Return the indent for the line containing point." -- 1.7.0.4 --=-=-= Leo --=-=-=--