DEV Community

Mika Feiler
Mika Feiler

Posted on

Once again I wanted to have Emacs be my XML Notepad 2006

XML Notepad from Microsoft, popular since as XML Notepad 2006, and since 2016~2020 having kicked off well as an active MIT-licensed open-source project, is a tool amazing in the simplicity of its basic premise.

Since I switched back from Windows altogether, I have been seeking to use it again. There is a Wikipedia article titled "Comparison of XML Editors", where Emacs' psgml and xml-mode are mentioned as having Tree editing, and the row mentioning nxml-mode has a question mark.

Yet nxml-mode has replaced xml-mode in Emacs as a default and not just that, but using the old xml-mode seems hard to do. I had to package-install "psgml" to get that "sgml-show-structure" to be available and it still didn't work.

I am now trying to write my small XML files with C-c C-i|TAB (nxml-balanced-close-start-tag-inline) and C-c /|C-f (nxml-finish-element), but I got very puzzled as to that C-c C-d bound to nxml-dynamic-markup-word, which doesn't seem to work for me. And M-f keeps moving me just onto the closing tag right angle bracket, from where I have to move with C-M-f or C-f.

I should probably muscle-memorize the selecting a whole entry, duplicating it before, and removing the content of the content tag. And set nxml-sexp-element-flag to nil.

A friend has suggested that I use imenu, but it turned out an nxml-mode buffer "cannot use imenu-default-create-index-function".

Top comments (0)