Scrolling read-only buffers with Spacebar in Emacs

A small usability improvement If you are used to scrolling reading material with your spacebar and you dislike Emacs’ unhelpful default (showing Buffer is read-only: #<buffer blah.txt> in the minibuffer) when trying to do so in a read-only buffer, I have a simple solution: Create a function that maps <SPC> to #'scroll-up-command when the current buffer is read-only: (defun set-read-only-spacebar…