all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Leo <sdl.web@gmail.com>
To: 6412@debbugs.gnu.org
Subject: bug#6412: 23.2; [patch] nXML indentation bug
Date: Sun, 13 Jun 2010 14:56:01 +0100	[thread overview]
Message-ID: <m1y6ejujda.fsf@cam.ac.uk> (raw)

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





             reply	other threads:[~2010-06-13 13:56 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-06-13 13:56 Leo [this message]
2010-06-13 14:27 ` bug#6412: 23.2; [patch] nXML indentation bug Leo
2010-06-14  1:43   ` Stefan Monnier
2010-06-14  8:15     ` Leo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m1y6ejujda.fsf@cam.ac.uk \
    --to=sdl.web@gmail.com \
    --cc=6412@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.