Whenever I open an SVG file, emacs renders the image in the buffer. I want it to let me edit the text (in nXML mode).

Of course I can exit image mode with C-c C-c, but I'd prefer that my text editor start me off with the text.

M-x auto-image-mode reports that it is toggling the Auto-Image-File mode to disabled, but the file still opens as an image (though smaller, curiously).

GNU Emacs 27.1 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.30, cairo version 1.16.0) of 2022-01-24, modified by Debian

1 Answer 1


Well this seems to drive a stake through its heart:

(auto-image-file-mode 0)
(setq auto-mode-alist (delete '(#1="\\.svgz?\\'" . image-mode) auto-mode-alist))

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.