all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: David Carlisle <davidc@nag.co.uk>
To: 32897@debbugs.gnu.org
Subject: bug#32897: 26.1; nxml-mode indentation
Date: Mon, 1 Oct 2018 10:44:37 +0100	[thread overview]
Message-ID: <f7d5ea73-ab25-a9f4-31a7-e75311b7a7b9@nag.co.uk> (raw)

[-- Attachment #1: Type: text/plain, Size: 5519 bytes --]



loading the following xml into emacs -q

<x>
   <abc xx="x/x/x/x/x/x/x/
	   y/y/y/y/y/y/
	   ">
	   <zzz/>
   </abc>
   <nl>&#10;</nl>
</x>

and using indent-region on the whole file produces the layout shown
with <zzz/> indented to the level of the wrapped attribute.

Also unless nxml-char-ref-display-glyph-flag is set to nil, the #10
displays a newline so the display appears as

   <nl>&#10;
</nl>


so spoiling the visual indentation.
(In the actual use case in XSLT, the newlines are only entered as &#10;
rather than a literal newline to improve the indentation layout of the
stylesheet so having the newline displayed defeats this completely.)


Previous versions of nxml-mode (I had not updated emacs for a year, so I
am unsure of when exactly it changed) would indent the file as

<x>
   <abc xx="x/x/x/x/x/x/x/
	   y/y/y/y/y/y/
	   ">
     <zzz/>
   </abc>
   <nl>&#10;</nl>
</x>


With the indentation of <zzz/> correctly indicating the element nesting
and not being affected by the attribute wrapping in <abc..

Also it does not show a visual newline for #10, even when other numeric
references to printable characters do display the character, which was 
the desired behaviour.






In GNU Emacs 26.1 (build 1, x86_64-unknown-cygwin, GTK+ Version 3.22.28)
  of 2018-05-28 built on DESKTOP
Repository revision: d802fa4a0642157d7aff9a9d599785df7604e4d1
Windowing system distributor 'The Cygwin/X Project', version 11.0.12001000
Recent messages:
For information about GNU Emacs and the GNU system, type C-h C-a.
Using vacuous schema
Mark set
Indenting region...done
You can run the command ‘indent-region’ with C-M-\
Indenting region...done
Saving file /c/tmp/zz.xml...
Wrote /c/tmp/zz.xml
Making completion list... [2 times]

Configured using:
  'configure
  --srcdir=/home/kbrown/src/cygemacs/emacs-26.1-1.x86_64/src/emacs-26.1
  --prefix=/usr --exec-prefix=/usr --localstatedir=/var --sysconfdir=/etc
  --docdir=/usr/share/doc/emacs --htmldir=/usr/share/doc/emacs/html -C
  'CFLAGS=-ggdb -O2 -pipe -Wall -Werror=format-security
  -Wp,-D_FORTIFY_SOURCE=2 -fstack-protector-strong
  --param=ssp-buffer-size=4
 
-fdebug-prefix-map=/home/kbrown/src/cygemacs/emacs-26.1-1.x86_64/build=/usr/src/debug/emacs-26.1-1
 
-fdebug-prefix-map=/home/kbrown/src/cygemacs/emacs-26.1-1.x86_64/src/emacs-26.1=/usr/src/debug/emacs-26.1-1'
  CPPFLAGS= LDFLAGS='

Configured features:
XPM JPEG TIFF GIF PNG RSVG IMAGEMAGICK SOUND DBUS GSETTINGS NOTIFY ACL
GNUTLS LIBXML2 FREETYPE M17N_FLT LIBOTF XFT ZLIB TOOLKIT_SCROLL_BARS
GTK3 X11 THREADS LCMS2

Important settings:
   value of $LANG: en_US.UTF-8
   locale-coding-system: utf-8-unix

Major mode: nXML

Minor modes in effect:
   tooltip-mode: t
   global-eldoc-mode: t
   electric-indent-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-composition-mode: t
   auto-encryption-mode: t
   auto-compression-mode: t
   line-number-mode: t
   transient-mark-mode: t

Load-path shadows:
None found.

Features:
(shadow sort mail-extr emacsbug message rmc puny dired dired-loaddefs
format-spec rfc822 mml mml-sec password-cache epa derived epg epg-config
gnus-util rmail rmail-loaddefs mm-decode mm-bodies mm-encode mail-parse
rfc2231 mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045
ietf-drums mm-util mail-prsvr mail-utils rng-xsd xsd-regexp rng-cmpct
rng-nxml rng-valid rng-loc rng-uri rng-parse nxml-parse rng-match rng-dt
rng-util rng-pttrn nxml-ns easymenu nxml-mode nxml-outln nxml-rap
sgml-mode seq byte-opt gv bytecomp byte-compile cconv dom cl-loaddefs
cl-lib nxml-util nxml-enc xmltok elec-pair time-date mule-util tooltip
eldoc electric uniquify ediff-hook vc-hooks lisp-float-type mwheel
term/x-win x-win term/common-win x-dnd tool-bar dnd fontset image
regexp-opt fringe tabulated-list replace newcomment text-mode elisp-mode
lisp-mode prog-mode register page menu-bar rfn-eshadow isearch timer
select scroll-bar mouse jit-lock font-lock syntax facemenu font-core
term/tty-colors frame cl-generic cham georgian utf-8-lang misc-lang
vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms cp51932
hebrew greek romanian slovak czech european ethiopic indian cyrillic
chinese composite charscript charprop case-table epa-hook jka-cmpr-hook
help simple abbrev obarray minibuffer cl-preloaded nadvice loaddefs
button faces cus-face macroexp files text-properties overlay sha1 md5
base64 format env code-pages mule custom widget hashtable-print-readable
backquote dbusbind gfilenotify lcms2 dynamic-setting system-font-setting
font-render-setting move-toolbar gtk x-toolkit x multi-tty
make-network-process emacs)

Memory information:
((conses 16 113057 8213)
  (symbols 48 33275 2)
  (miscs 40 98 126)
  (strings 32 46130 1331)
  (string-bytes 1 1078054)
  (vectors 16 17170)
  (vector-slots 8 535364 10330)
  (floats 8 62 253)
  (intervals 56 351 0)
  (buffers 992 15))

Disclaimer

The Numerical Algorithms Group Ltd is a company registered in England and Wales with company number 1249803. The registered office is:
Wilkinson House, Jordan Hill Road, Oxford OX2 8DR, United Kingdom.

This e-mail has been scanned for all viruses and malware, and may have been automatically archived by Mimecast Ltd, an innovator in Software as a Service (SaaS) for business. 

[-- Attachment #2: Type: text/html, Size: 6744 bytes --]

             reply	other threads:[~2018-10-01  9:44 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-01  9:44 David Carlisle [this message]
2019-04-19 17:42 ` bug#32897: 26.1; nxml-mode indentation Noam Postavsky
2019-05-09 11:45   ` Noam Postavsky

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=f7d5ea73-ab25-a9f4-31a7-e75311b7a7b9@nag.co.uk \
    --to=davidc@nag.co.uk \
    --cc=32897@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.