Jonathan G. Underwood 7a98d2
=== modified file 'lisp/nxml/nxml-mode.el'
Jonathan G. Underwood 7a98d2
--- lisp/nxml/nxml-mode.el	2009-09-24 23:22:17 +0000
Jonathan G. Underwood 7a98d2
+++ lisp/nxml/nxml-mode.el	2009-10-24 21:32:19 +0000
Jonathan G. Underwood 7a98d2
@@ -1254,29 +1254,31 @@
Jonathan G. Underwood 7a98d2
 
Jonathan G. Underwood 7a98d2
 (defun nxml-balanced-close-start-tag (block-or-inline)
Jonathan G. Underwood 7a98d2
   (let ((token-end (nxml-token-before))
Jonathan G. Underwood 7a98d2
-	(pos (1+ (point))))
Jonathan G. Underwood 7a98d2
+	(pos (1+ (point)))
Jonathan G. Underwood 7a98d2
+	(token-start xmltok-start))
Jonathan G. Underwood 7a98d2
     (unless (or (eq xmltok-type 'partial-start-tag)
Jonathan G. Underwood 7a98d2
 		(and (memq xmltok-type '(start-tag
Jonathan G. Underwood 7a98d2
 					 empty-element
Jonathan G. Underwood 7a98d2
 					 partial-empty-element))
Jonathan G. Underwood 7a98d2
 		     (>= token-end pos)))
Jonathan G. Underwood 7a98d2
       (error "Not in a start-tag"))
Jonathan G. Underwood 7a98d2
+    ;; Note that this insertion changes xmltok-start.
Jonathan G. Underwood 7a98d2
     (insert "></"
Jonathan G. Underwood 7a98d2
 	    (buffer-substring-no-properties (+ xmltok-start 1)
Jonathan G. Underwood 7a98d2
 					    (min xmltok-name-end (point)))
Jonathan G. Underwood 7a98d2
 	    ">")
Jonathan G. Underwood 7a98d2
     (if (eq block-or-inline 'inline)
Jonathan G. Underwood 7a98d2
 	(goto-char pos)
Jonathan G. Underwood 7a98d2
-      (goto-char xmltok-start)
Jonathan G. Underwood 7a98d2
+      (goto-char token-start)
Jonathan G. Underwood 7a98d2
       (back-to-indentation)
Jonathan G. Underwood 7a98d2
-      (if (= (point) xmltok-start)
Jonathan G. Underwood 7a98d2
+      (if (= (point) token-start)
Jonathan G. Underwood 7a98d2
 	  (let ((indent (current-column)))
Jonathan G. Underwood 7a98d2
-	  (goto-char pos)
Jonathan G. Underwood 7a98d2
-	  (insert "\n")
Jonathan G. Underwood 7a98d2
-	  (indent-line-to indent)
Jonathan G. Underwood 7a98d2
-	  (goto-char pos)
Jonathan G. Underwood 7a98d2
-	  (insert "\n")
Jonathan G. Underwood 7a98d2
-	  (indent-line-to (+ nxml-child-indent indent)))
Jonathan G. Underwood 7a98d2
+	    (goto-char pos)
Jonathan G. Underwood 7a98d2
+	    (insert "\n")
Jonathan G. Underwood 7a98d2
+	    (indent-line-to indent)
Jonathan G. Underwood 7a98d2
+	    (goto-char pos)
Jonathan G. Underwood 7a98d2
+	    (insert "\n")
Jonathan G. Underwood 7a98d2
+	    (indent-line-to (+ nxml-child-indent indent)))
Jonathan G. Underwood 7a98d2
 	(goto-char pos)))))
Jonathan G. Underwood 7a98d2
 
Jonathan G. Underwood 7a98d2
 (defun nxml-finish-element ()
Jonathan G. Underwood 7a98d2