GNU bug report logs - #6622
23.2; nxml-mode Indentation Behavior

Previous Next

Package: emacs;

Reported by: Misty Stanley-Jones <misty <at> redhat.com>

Date: Tue, 13 Jul 2010 01:48:01 UTC

Severity: normal

Tags: patch

Found in version 23.2

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 6622 in the body.
You can then email your comments to 6622 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#6622; Package emacs. (Tue, 13 Jul 2010 01:48:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Misty Stanley-Jones <misty <at> redhat.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Tue, 13 Jul 2010 01:48:01 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Misty Stanley-Jones <misty <at> redhat.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 23.2; nxml-mode Indentation Behavior
Date: Mon, 12 Jul 2010 21:45:51 -0400 (EDT)
This bug report will be sent to the Free Software Foundation,
not to your local site managers!
Please write in English if possible, because the Emacs maintainers
usually do not have translators to read other languages for them.

Your bug report will be posted to the bug-gnu-emacs <at> gnu.org mailing list,
and to the gnu.emacs.bug news group.

Please describe exactly what actions triggered the bug
and the precise symptoms of the bug.  If you can, give
a recipe starting from `emacs -Q':

Normally, nxml-mode automatically indents new lines the proper amount,
and re-indents after closing tags.

However, if nxml-slash-auto-complete-flag is set to true, completed tags
on new lines are not re-indented.

For instance, type the following:
<para>
This is a para.
</

The closing tag (</para>) is automatically completed, but the line is
not indented properly.

When the above-mentioned flag is true, / is mapped to
nxml-electric-slash. The following advice works around the problem:

(defadvice nxml-electric-slash (after nxml-electric-slash-indent activate) (funcall indent-line-function))

If Emacs crashed, and you have the Emacs process in the gdb debugger,
please include the output from the following gdb commands:
    `bt full' and `xbacktrace'.
For information about debugging Emacs, please read the file
/usr/share/emacs/23.2/etc/DEBUG.


In GNU Emacs 23.2.1 (x86_64-redhat-linux-gnu, GTK+ Version 2.20.1)
 of 2010-05-13 on x86-07.phx2.fedoraproject.org
Windowing system distributor `Fedora Project', version 11.0.10800000
configured using `configure  '--build=x86_64-redhat-linux-gnu' '--host=x86_64-redhat-linux-gnu' '--program-prefix=' '--disable-dependency-tracking' '--prefix=/usr' '--exec-prefix=/usr' '--bindir=/usr/bin' '--sbindir=/usr/sbin' '--sysconfdir=/etc' '--datadir=/usr/share' '--includedir=/usr/include' '--libdir=/usr/lib64' '--libexecdir=/usr/libexec' '--localstatedir=/var' '--sharedstatedir=/var/lib' '--mandir=/usr/share/man' '--infodir=/usr/share/info' '--with-dbus' '--with-gif' '--with-jpeg' '--with-png' '--with-rsvg' '--with-tiff' '--with-xft' '--with-xpm' '--with-x-toolkit=gtk' 'build_alias=x86_64-redhat-linux-gnu' 'host_alias=x86_64-redhat-linux-gnu' 'CFLAGS=-DMAIL_USE_LOCKF -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic''

Important settings:
  value of $LC_ALL: nil
  value of $LC_COLLATE: nil
  value of $LC_CTYPE: nil
  value of $LC_MESSAGES: nil
  value of $LC_MONETARY: nil
  value of $LC_NUMERIC: nil
  value of $LC_TIME: nil
  value of $LANG: en_US.UTF-8
  value of $XMODIFIERS: @im=none
  locale-coding-system: utf-8-unix
  default enable-multibyte-characters: t

Major mode: Lisp Interaction

Minor modes in effect:
  yas/global-mode: t
  yas/minor-mode: t
  global-linum-mode: t
  linum-mode: t
  tooltip-mode: t
  mouse-wheel-mode: t
  tool-bar-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  line-number-mode: t
  transient-mark-mode: t

Recent input:
C-h e <help-echo> <help-echo> <help-echo> <help-echo> 
<down-mouse-1> <mouse-1> C-x k <return> M-x r e p o 
r t - e m a c s - b u g <return>

Recent messages:

Load-path shadows:
/usr/share/emacs/site-lisp/ruby-mode/ruby-mode hides /usr/share/emacs/23.2/lisp/progmodes/ruby-mode

Features:
(shadow sort mail-extr message idna sendmail regexp-opt ecomplete rfc822
mml mml-sec password-cache mm-decode mm-bodies mm-encode mailcap
mail-parse rfc2231 rfc2047 rfc2045 qp ietf-drums mailabbrev nnheader
gnus-util netrc time-date mm-util mail-prsvr gmm-utils wid-edit
mailheader canlock sha1 hex-util hashcash mail-utils emacsbug yasnippet
dropdown-list derived easy-mmode edmacro kmacro easymenu assoc cl cl-19
advice help-fns advice-preload linum tooltip ediff-hook vc-hooks
lisp-float-type mwheel x-win x-dnd font-setting tool-bar dnd fontset
image fringe lisp-mode register page menu-bar rfn-eshadow timer select
scroll-bar mldrag mouse jit-lock font-lock syntax facemenu font-core
frame cham georgian utf-8-lang misc-lang vietnamese tibetan thai
tai-viet lao korean japanese hebrew greek romanian slovak czech european
ethiopic indian cyrillic chinese case-table epa-hook jka-cmpr-hook help
simple abbrev loaddefs button minibuffer faces cus-face files
text-properties overlay md5 base64 format env code-pages mule custom
widget hashtable-print-readable backquote make-network-process dbusbind
system-font-setting font-render-setting gtk x-toolkit x multi-tty emacs)


-- 
Misty Stanley-Jones
Content Author, ECS
1/193 North Quay, Brisbane QLD 4000
Ph: +61 7 3514 8105
Mobile: +61 429 595 932
Time Zone: GMT+10




Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#6622; Package emacs. (Wed, 14 Jul 2010 03:52:02 GMT) Full text and rfc822 format available.

Message #8 received at 6622 <at> debbugs.gnu.org (full text, mbox):

From: Geoff Gole <geoffgole <at> gmail.com>
To: 6622 <at> debbugs.gnu.org, misty <at> redhat.com
Subject: [PATCH] 23.2; nxml-mode Indentation Behavior
Date: Wed, 14 Jul 2010 11:51:56 +0800
We discussed a workaround on #emacs already. But in case somebody else
has this bug, this might help:

(defadvice nxml-electric-slash (after indentation-bug-workaround activate)
  ;; fixme - workaround for indentation bug, remove once fixed
  (funcall indent-line-function))

And here's a patch:

*** /usr/local/share/emacs/23.2/lisp/nxml/nxml-mode.el.gz
--- /tmp/buffer-content-33187GX
*************** on the line, reindent the line."
*** 1212,1218 ****
                          (eq (point) (1- slash-pos)))))
     (self-insert-command (prefix-numeric-value arg))
     (unless arg
!       (if nxml-slash-auto-complete-flag
         (if end-tag-p
             (condition-case err
                 (let ((start-tag-end
--- 1212,1218 ----
                          (eq (point) (1- slash-pos)))))
     (self-insert-command (prefix-numeric-value arg))
     (unless arg
!       (when nxml-slash-auto-complete-flag
         (if end-tag-p
             (condition-case err
                 (let ((start-tag-end
*************** on the line, reindent the line."
*** 1232,1240 ****
               (nxml-scan-error nil))
           (when (and (eq (nxml-token-before) (point))
                      (eq xmltok-type 'partial-empty-element))
!             (insert ">")))
       (when (and end-tag-p at-indentation)
!         (nxml-indent-line))))))

 (defun nxml-balanced-close-start-tag-block ()
   "Close the start-tag before point with `>' and insert a balancing end-tag.
--- 1232,1240 ----
               (nxml-scan-error nil))
           (when (and (eq (nxml-token-before) (point))
                      (eq xmltok-type 'partial-empty-element))
!             (insert ">"))))
       (when (and end-tag-p at-indentation)
!         (nxml-indent-line)))))

 (defun nxml-balanced-close-start-tag-block ()
   "Close the start-tag before point with `>' and insert a balancing end-tag.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#6622; Package emacs. (Fri, 26 Feb 2016 06:54:01 GMT) Full text and rfc822 format available.

Message #11 received at 6622 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Geoff Gole <geoffgole <at> gmail.com>
Cc: misty <at> redhat.com, 6622 <at> debbugs.gnu.org
Subject: Re: bug#6622: [PATCH] 23.2; nxml-mode Indentation Behavior
Date: Fri, 26 Feb 2016 17:21:58 +1030
Geoff Gole <geoffgole <at> gmail.com> writes:

> We discussed a workaround on #emacs already. But in case somebody else
> has this bug, this might help:
>
> (defadvice nxml-electric-slash (after indentation-bug-workaround activate)
>   ;; fixme - workaround for indentation bug, remove once fixed
>   (funcall indent-line-function))
>
> And here's a patch:

This seems to be working on the Emacs trunk, so I guess somebody already
made this change.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




bug closed, send any further explanations to 6622 <at> debbugs.gnu.org and Misty Stanley-Jones <misty <at> redhat.com> Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Fri, 26 Feb 2016 06:54:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Fri, 25 Mar 2016 11:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 9 years and 148 days ago.

Previous Next


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