Introduction

This essay was written by me, Brandon Nolet, in the context that I had a whole post already written, in a scratch buffer.

Org-Mode Macros/ Emacs Config

As many of you know, I’ve been creating lots and lots of org-mode macros. I was just working on adding some as I was writing the aforementioned post. While working on those macros, I noticed that matching parenthesis weren’t being highlighted. I recently modified my emacs config, so I figured there was something in there that turned this feature off.

So I opened up my init.el and took a gander at the options that I changed. Looks like I added, as per @emsenn@tenforward.social’s config, show-paren-mode 1. Surprisingly, for some reason, setting show-paren-mode to 1 ended up turning off show-paren-mode. So I removed the entry in my init file and then saved and loaded it.

To my dismay, there was no change in that non-matching-parenthesis behaviour. I tried removing another entry and doing the same loading behaviour and this time there was a change in that setting’s behaviour. But still no change in the () matching.

My Mistake

So I figured that this was something that required a start of emacs. Unfortunately, it didn’t dawn on me that I could just manually turn on and off this feature using M-x show-paren-mode. I didn’t even ponder another way to change the setting while emacs is still running.

So I clicked the little X on the top right corner (to close emacs, yes I use GUI) and clicked save on all the prompts I was given, as one does. What didn’t occur to me until I clicked yes on the last prompt was that my scratch buffer is precisely not something that I would be prompted to save. It’s something that you just write little snippets of text here and there, maybe some working information that you need, whatever you like. You’re…probably…not supposed to write full blog posts in it.

So when I re-opened emacs, I was presented with a blank buffer with no chance of recovering what I had just written. So that’s what the title of this post is about, and it accurately reflects exactly how I felt when I realized I lost the entirety of the writing I had just performed.

Conclusion

I won’t ever write prose in the scratch buffer again. Lesson learned. Maybe there’s a way to get the scratch buffer to auto-save like any other saved-file buffer would.