GNU bug report logs - #8704
23.2; nxml-mode function nxml-electric-slash not indenting when completing

Previous Next

Package: emacs;

Reported by: James Ahlborn <jahlborn <at> gmail.com>

Date: Thu, 19 May 2011 20:46:03 UTC

Severity: normal

Found in version 23.2

Fixed in version 24.1

Done: Stefan Monnier <monnier <at> iro.umontreal.ca>

Bug is archived. No further changes may be made.

Full log


Message #10 received at 8704-done <at> debbugs.gnu.org (full text, mbox):

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: James Ahlborn <jahlborn <at> gmail.com>
Cc: 8704-done <at> debbugs.gnu.org
Subject: Re: bug#8704: 23.2;
	nxml-mode function nxml-electric-slash not indenting when completing
Date: Fri, 20 May 2011 10:15:45 -0300
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  <monnier <at> iro.umontreal.ca>
+
+	* nxml/nxml-mode.el (nxml-electric-slash): Reindent when completion is
+	enabled.  Suggested by James Ahlborn <jahlborn <at> gmail.com> (bug#8704).
+
 2011-05-20  Nix  <nix <at> esperi.org.uk>
 
 	* 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.





This bug report was last modified 14 years and 8 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.