From debbugs-submit-bounces@debbugs.gnu.org Sun Jun 13 09:56:18 2010 Received: (at submit) by debbugs.gnu.org; 13 Jun 2010 13:56:18 +0000 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 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 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 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 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_MED,T_RP_MATCHES_RCVD,T_TO_NO_BRKTS_FREEMAIL autolearn=unavailable version=3.3.1 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 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/ 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 From: Leo To: bug-gnu-emacs@gnu.org Subject: 23.2; [patch] nXML indentation bug Date: Sun, 13 Jun 2010 14:56:01 +0100 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii 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-Spam-Score: -6.4 (------) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.4 (------) 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 From debbugs-submit-bounces@debbugs.gnu.org Sun Jun 13 10:27:37 2010 Received: (at 6412) by debbugs.gnu.org; 13 Jun 2010 14:27:37 +0000 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 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/ 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 From: Leo To: 6412@debbugs.gnu.org Subject: Re: 23.2; [patch] nXML indentation bug Date: Sun, 13 Jun 2010 15:27:27 +0100 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (Mac OS X 10.6.3) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: -5.4 (-----) X-Debbugs-Envelope-To: 6412 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -5.4 (-----) --=-=-= 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 --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Sun Jun 13 21:44:06 2010 Received: (at 6412) by debbugs.gnu.org; 14 Jun 2010 01:44:06 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1ONyic-0001Tq-0w for submit@debbugs.gnu.org; Sun, 13 Jun 2010 21:44:06 -0400 Received: from ironport2-out.teksavvy.com ([206.248.154.183] helo=ironport2-out.pppoe.ca) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1ONyia-0001TU-Eu for 6412@debbugs.gnu.org; Sun, 13 Jun 2010 21:44:04 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AvsEAAMmFUxMCoQR/2dsb2JhbACed3K9f4UaBI0C X-IronPort-AV: E=Sophos;i="4.53,412,1272859200"; d="scan'208";a="67967089" Received: from 76-10-132-17.dsl.teksavvy.com (HELO pastel.home) ([76.10.132.17]) by ironport2-out.pppoe.ca with ESMTP; 13 Jun 2010 21:43:59 -0400 Received: by pastel.home (Postfix, from userid 20848) id 7483C80BC; Sun, 13 Jun 2010 21:43:59 -0400 (EDT) From: Stefan Monnier To: Leo Subject: Re: bug#6412: 23.2; [patch] nXML indentation bug Message-ID: References: Date: Sun, 13 Jun 2010 21:43:59 -0400 In-Reply-To: (Leo's message of "Sun, 13 Jun 2010 15:27:27 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Spam-Score: -2.2 (--) X-Debbugs-Envelope-To: 6412 Cc: 6412@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.2 (--) > Please ignore the patch in previous email (sorry for this). Here is the > correct patch: Thanks, and sorry to let you wait. I just installed a copy of that same functionality from some other mode. This should really be moved to prog-mode so it can be shared by all major-modes. Stefan From debbugs-submit-bounces@debbugs.gnu.org Mon Jun 14 04:15:21 2010 Received: (at 6412) by debbugs.gnu.org; 14 Jun 2010 08:15:21 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OO4pF-0004PU-Be for submit@debbugs.gnu.org; Mon, 14 Jun 2010 04:15:21 -0400 Received: from mail-wy0-f172.google.com ([74.125.82.172]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OO4pD-0004PP-7R for 6412@debbugs.gnu.org; Mon, 14 Jun 2010 04:15:19 -0400 Received: by wyi11 with SMTP id 11so2807293wyi.3 for <6412@debbugs.gnu.org>; Mon, 14 Jun 2010 01:15:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=7hSQwlVE7UsYz9GQcmUEowM0jg3gXITTQ3K+GYsr7TI=; b=IQpDpFfOiHUAL3BAQYFP22aUF+fUH61vgTH5YgbFMS2ARVihq86BNJ5MJNx5z1RhPb l34IImegWsaaF3pfnaN/TY825ifCpk8dxeWAvqym7Z96GXdEfCLrLpeyjv2XroHscKW7 /Rc9HJUkvAHA5Au5eP6IpuZ3v5WIMkmwVW0GA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=prejxS7N5SpkCp1E9iFMYcZ8fUEXX/DvuG1VZ5/vtkHbdhZ4XP+TTtF19DhoMxIwlk krZuRV1SZCqdmSmWpdPQEQHciTC+DIlxKWIv+5XxxhZEApS31baqi4a9/sApGSOJ7qR/ kcuE4wkcwN8+2pn90nl8WLHAWuJWXE2x057sU= MIME-Version: 1.0 Received: by 10.227.142.71 with SMTP id p7mr5236784wbu.201.1276503314557; Mon, 14 Jun 2010 01:15:14 -0700 (PDT) Received: by 10.216.171.211 with HTTP; Mon, 14 Jun 2010 01:15:14 -0700 (PDT) In-Reply-To: References: Date: Mon, 14 Jun 2010 09:15:14 +0100 Message-ID: Subject: Re: bug#6412: 23.2; [patch] nXML indentation bug From: Leo To: Stefan Monnier Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -2.6 (--) X-Debbugs-Envelope-To: 6412 Cc: 6412@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.6 (--) On 14 June 2010 02:43, Stefan Monnier wrote: >> Please ignore the patch in previous email (sorry for this). Here is the >> correct patch: > > Thanks, and sorry to let you wait. =A0I just installed a copy of that sam= e > functionality from some other mode. =A0This should really be moved to > prog-mode so it can be shared by all major-modes. No wait at all. I think that's pretty quick. I tested the patch with Emacs 23.2 and it worked. Please close this bug. Thanks. > =A0 =A0 =A0 =A0Stefan Leo From debbugs-submit-bounces@debbugs.gnu.org Sun Nov 21 19:25:32 2010 Received: (at control) by debbugs.gnu.org; 22 Nov 2010 00:25:33 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PKKDs-0006Qq-MB for submit@debbugs.gnu.org; Sun, 21 Nov 2010 19:25:32 -0500 Received: from pantheon-po42.its.yale.edu ([130.132.50.101]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PKKDq-0006Qk-Ag for control@debbugs.gnu.org; Sun, 21 Nov 2010 19:25:30 -0500 Received: from furball (dhcp128036014014.central.yale.edu [128.36.14.14]) (authenticated bits=0) by pantheon-po42.its.yale.edu (8.12.11.20060308/8.12.11) with ESMTP id oAM0UhKw015093 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT) for ; Sun, 21 Nov 2010 19:30:44 -0500 Received: by furball (Postfix, from userid 1000) id D334B1610A5; Sun, 21 Nov 2010 19:30:42 -0500 (EST) From: Chong Yidong To: control@debbugs.gnu.org Subject: close 6412 Date: Sun, 21 Nov 2010 19:30:42 -0500 Message-ID: <87lj4mp5cd.fsf@stupidchicken.com> MIME-Version: 1.0 Content-Type: text/plain X-YaleITSMailFilter: Version 1.2c (attachment(s) not renamed) X-Spam-Score: -2.7 (--) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.7 (--) close 6412 thanks From unknown Tue Jun 24 05:11:35 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Mon, 20 Dec 2010 12:24:04 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator