bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#8704: 23.2; nxml-mode function nxml-electric-slash not indenting whe


From: Stefan Monnier
Subject: bug#8704: 23.2; nxml-mode function nxml-electric-slash not indenting when completing
Date: Fri, 20 May 2011 10:15:45 -0300
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux)

Version: 24.1

> In older versions of emacs/nxml-mode the nxml-electric-slash function
> would both complete the close tag and auto-indent the close tag.  in the
> latest emacs version, it seems to do one or the other.  i *think* this
> is an oversight, and the old functionality can be easily fixed by moving
> the final (when ...) block outside of the (if
> nxml-slash-auto-complete-flag ...) block (so that the indenting is done
> regardless of whether or not completion is enabled).

Indeed, this looks like an odd choice (if anything, I'd have expected
the reindent to be disabled when nxml-slash-auto-complete-flag is
disabled rather than when it's enabled).  So I've applied the change you
suggest to the trunk.  Thank you,


        Stefan


=== modified file 'lisp/ChangeLog'
--- lisp/ChangeLog      2011-05-20 00:51:46 +0000
+++ lisp/ChangeLog      2011-05-20 13:12:51 +0000
@@ -1,3 +1,8 @@
+2011-05-20  Stefan Monnier  <address@hidden>
+
+       * nxml/nxml-mode.el (nxml-electric-slash): Reindent when completion is
+       enabled.  Suggested by James Ahlborn <address@hidden> (bug#8704).
+
 2011-05-20  Nix  <address@hidden>
 
        * files.el (basic-save-buffer-2):

=== modified file 'lisp/nxml/nxml-mode.el'
--- lisp/nxml/nxml-mode.el      2011-01-26 08:36:39 +0000
+++ lisp/nxml/nxml-mode.el      2011-05-20 13:10:18 +0000
@@ -1263,9 +1263,9 @@
                (nxml-scan-error nil))
            (when (and (eq (nxml-token-before) (point))
                       (eq xmltok-type 'partial-empty-element))
-             (insert ">")))
+             (insert ">"))))
        (when (and end-tag-p at-indentation)
-         (nxml-indent-line))))))
+        (nxml-indent-line)))))
 
 (defun nxml-balanced-close-start-tag-block ()
   "Close the start-tag before point with `>' and insert a balancing end-tag.






reply via email to

[Prev in Thread] Current Thread [Next in Thread]