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".

Heroku

Simplify your DevOps and maximize your time.

Since 2007, Heroku has been the go-to platform for developers as it monitors uptime, performance, and infrastructure concerns, allowing you to focus on writing code.

Learn More

Top comments (0)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs

AWS Security LIVE!

Hosted by security experts, AWS Security LIVE! showcases AWS Partners tackling real-world security challenges. Join live and get your security questions answered.

Tune in to the full event

DEV is partnering to bring live events to the community. Join us or dismiss this billboard if you're not interested. ❤️