emacs/emacs-23.1-nxml.patch
Jonathan G. Underwood 7a98d237bc - Add fix for BZ 53346
2010-03-30 21:49:18 +00:00

46 lines
1.3 KiB
Diff

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