Automatically Put Extracted Archive Files Into Read-Only Mode
If you’re editing Clojure code in Emacs a lot, you’re probably using
⌥.. If you’re not, you should be. It’s a fantastic way to navigate around your code.
That being said, Emacs comes with this awesome feature where if you try to ‘edit’ an archive file of some kind, it’ll simply open it and allow you to edit it and then save the file back to the original archive for you. It’s all pretty magical.
Except when you’ve
⌥.ed into a jar file and find yourself editing it by mistake.
So I hacked together this very simple bit of Elisp. All it does is make a buffer produced by archive extraction read-only by default, which I’ll be thanking myself for later.