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 14:56:01 +0100 Message-ID: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: dough.gmane.org 1276437520 30845 80.91.229.12 (13 Jun 2010 13:58:40 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sun, 13 Jun 2010 13:58:40 +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 15:58:36 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 1ONnho-00020W-OR for geb-bug-gnu-emacs@m.gmane.org; Sun, 13 Jun 2010 15:58:33 +0200 Original-Received: from localhost ([127.0.0.1]:37064 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1ONnho-0001oB-A5 for geb-bug-gnu-emacs@m.gmane.org; Sun, 13 Jun 2010 09:58:32 -0400 Original-Received: from [140.186.70.92] (port=57580 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1ONnhj-0001nG-Jy for bug-gnu-emacs@gnu.org; Sun, 13 Jun 2010 09:58:28 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1ONnhi-00005a-9C for bug-gnu-emacs@gnu.org; Sun, 13 Jun 2010 09:58:27 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:36155) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1ONnhi-00005W-6c for bug-gnu-emacs@gnu.org; Sun, 13 Jun 2010 09:58:26 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1ONngL-0004es-S4; Sun, 13 Jun 2010 09:57:01 -0400 X-Loop: help-debbugs@gnu.org 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 13:57:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 6412 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.127643737817894 (code B ref -1); Sun, 13 Jun 2010 13:57:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 13 Jun 2010 13:56:18 +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 1ONnfd-0004eY-5A for submit@debbugs.gnu.org; Sun, 13 Jun 2010 09:56:17 -0400 Original-Received: from mail.gnu.org ([199.232.76.166] helo=mx10.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1ONnfb-0004eS-9J for submit@debbugs.gnu.org; Sun, 13 Jun 2010 09:56:15 -0400 Original-Received: from lists.gnu.org ([199.232.76.165]:41959) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1ONnfW-00039p-4X for submit@debbugs.gnu.org; Sun, 13 Jun 2010 09:56:10 -0400 Original-Received: from [140.186.70.92] (port=57018 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1ONnfT-0001au-UV for bug-gnu-emacs@gnu.org; Sun, 13 Jun 2010 09:56:09 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1ONnfS-0008B3-OM for bug-gnu-emacs@gnu.org; Sun, 13 Jun 2010 09:56:07 -0400 Original-Received: from ppsw-32.csi.cam.ac.uk ([131.111.8.132]:42384) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1ONnfS-0008An-K4 for bug-gnu-emacs@gnu.org; Sun, 13 Jun 2010 09:56:06 -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]:60704 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 1ONnfP-000383-2a (Exim 4.72) for bug-gnu-emacs@gnu.org (return-path ); Sun, 13 Jun 2010 14:56:04 +0100 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list Resent-Date: Sun, 13 Jun 2010 09:57: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:37739 Archived-At: The indentation behaviour in nxml is different from most of other modes in that when current line has correct indentation the point stay still instead of moving to the first non-blank char. The attached patch fixes this problem with minor simplification. diff --git a/lisp/nxml/nxml-mode.el b/lisp/nxml/nxml-mode.el index 8919d92..36b5fe7 100644 --- a/lisp/nxml/nxml-mode.el +++ b/lisp/nxml/nxml-mode.el @@ -1372,12 +1372,9 @@ of the inserted start-tag or nil if none was inserted." "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))) + (skip-chars-forward " \t") + (when (and indent (/= indent (current-indentation))) + (delete-region (line-beginning-position) (point)) (indent-to indent) (when (> (- (point-max) from-end) (point)) (goto-char (- (point-max) from-end)))))) Best wishes, Leo GNU Emacs 23.2.7 (x86_64-apple-darwin10.3.0, Carbon Version 1.6.0 AppKit 1038.29) of 2010-06-11 on Victoria.local