(If you a looking for a more general solution to this problem, hardhat-mode might be all you need.)
Jumping to definitions with
M-. is wonderful. The downside — everything has a downside — is that it is easy to accidentally edit a source file in the Quicklisp distribution.
Here’s what I do. If you create a file named
.dir-locals.el in a directory, Emacs will apply the settings in it to every file in that directory, recursively. You can take advantage of this to make Emacs treat an entire directory as if it were read-only.
~/quicklisp/dists/quicklisp, I create a
.dir-locals.el file containing one line:
((nil . ((buffer-read-only . t))))
I make this part of my setup on any new development machine (with Stow).
(If you do find you’ve accidentally edited a file in the Quicklisp distribution, how to fix it? Just delete the project from
~/quicklisp/dists/quicklisp/software/ and quickload it again.)