On 2026-07-03, Lawrence D’Oliveiro wrote:
On Fri, 3 Jul 2026 01:32:46 -0000 (UTC), John McCue wrote:
A little warning about M-q. In GNU Emacs 30+, the scratch buffer's
M-q is redefined to something else.
I didn’t notice this (running Emacs 30.2, since that’s what was in
Debian Unstable on my last upgrade), because I run with Emacs’ entire
mode system disabled.
FWIW, I tend to use 'fill-paragraph' a lot in scratch.
So do I.
Oh, and I also added a buffer-protection mechanism, because I have a
shortcut (super-W) for closing the current buffer, and I was losing
the scratch buffer too often from this. ;)
After spending way too long dealing with the consequences of *scratch*
not being backed up, I went with this:
(setq initial-buffer-choice "/home/[...]/scratch.org")
The point being that I use the initial buffer more for quick
note-keeping that ought to be transitory until saved in a more
appropriate fashion, but I kept getting bitten by bugs of the following
species - not saying it happened often enough, but still it happening
once an year or so would pose an issue:
* Drosophila Segmentationum Faltum
* Aedes Blackoutitis
Now more seriously, the point here is that, if that buffer is backed by
a file, it does get auto-saved and can be restored to at least a
somewhat recent copy in case of an improper Emacs shutdown.
If you rely on it for Elisp interaction, I suppose you could as well as
make it an Elisp file. I have the following, but I'm not sure the mode
still needs to be set after the buffer is set to open a file matching
.*\.org:
(setq initial-major-mode 'org-mode [...] )
Now I'm not sure this matters at all with a shortcut to close the buffer
- but I suppose that, if it's a buffer with a file, it may prompt you
before killing it? (It'd otherwise not protect as much as your
protection, I guess, because there'd still be a gap between the last
auto-save and it being killed?)
(Meanwhile, I set Emacs on Android the same way, so I can start typing
notes in the buffer it opens when it starts, and just do C-x C-s,
without having to open a file first.)
--
Nuno Silva