GNU bug report logs -
#6412
23.2; [patch] nXML indentation bug
Previous Next
Reported by: Leo <sdl.web <at> gmail.com>
Date: Sun, 13 Jun 2010 13:57:01 UTC
Severity: normal
Tags: patch
Found in version 23.2
Done: Chong Yidong <cyd <at> stupidchicken.com>
Bug is archived. No further changes may be made.
To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 6412 in the body.
You can then email your comments to 6412 AT debbugs.gnu.org in the normal way.
Toggle the display of automated, internal messages from the tracker.
Report forwarded
to
owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org
:
bug#6412
; Package
emacs
.
(Sun, 13 Jun 2010 13:57:01 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
Leo <sdl.web <at> gmail.com>
:
New bug report received and forwarded. Copy sent to
bug-gnu-emacs <at> gnu.org
.
(Sun, 13 Jun 2010 13:57:01 GMT)
Full text and
rfc822 format available.
Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
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
Information forwarded
to
owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org
:
bug#6412
; Package
emacs
.
(Sun, 13 Jun 2010 14:28:01 GMT)
Full text and
rfc822 format available.
Message #8 received at 6412 <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
Please ignore the patch in previous email (sorry for this). Here is the
correct patch:
[0001-Fix-nxml-indent-line-to-be-consistent-with-other-mod.patch (text/x-patch, attachment)]
[Message part 3 (text/plain, inline)]
Leo
Information forwarded
to
owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org
:
bug#6412
; Package
emacs
.
(Mon, 14 Jun 2010 01:45:02 GMT)
Full text and
rfc822 format available.
Message #11 received at 6412 <at> debbugs.gnu.org (full text, mbox):
> 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
Information forwarded
to
owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org
:
bug#6412
; Package
emacs
.
(Mon, 14 Jun 2010 08:16:02 GMT)
Full text and
rfc822 format available.
Message #14 received at 6412 <at> debbugs.gnu.org (full text, mbox):
On 14 June 2010 02:43, Stefan Monnier <monnier <at> iro.umontreal.ca> wrote:
>> 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.
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.
> Stefan
Leo
bug closed, send any further explanations to Leo <sdl.web <at> gmail.com>
Request was from
Chong Yidong <cyd <at> stupidchicken.com>
to
control <at> debbugs.gnu.org
.
(Mon, 22 Nov 2010 00:26:02 GMT)
Full text and
rfc822 format available.
bug archived.
Request was from
Debbugs Internal Request <help-debbugs <at> gnu.org>
to
internal_control <at> debbugs.gnu.org
.
(Mon, 20 Dec 2010 12:24:04 GMT)
Full text and
rfc822 format available.
This bug report was last modified 14 years and 189 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.