Subject: 23.0.60; nxml-indent-line modifies the buffer

From: "Lennart Borgman (gmail)" <[email-masked]>
Date: Tue, 02 Sep 2008 01:38:21 +0200

nxml-indent-line modifies the buffer even if the current indentation is
the same as the one it will give.

I am not sure what the right fix for this is. It uses indent-to and
perhaps the best would be that indent-to did not modify the buffer.

Otherwise the only change needed in nxml-indent-line is to add a check:

(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))))))

In GNU Emacs 23.0.60.1 (i386-mingw-nt5.1.2600)
 of 2008-08-29
Windowing system distributor `Microsoft Corp.', version 5.1.2600
configured using `configure --with-gcc (3.4) --no-opt --cflags
-Ic:/g/include -fno-crossjumping'