View-mode makes for great read-only reading

The built-in view-mode turns the current buffer into a read-only pager, with SPACE and DEL to scroll up and down by page. This is a nice way to comfortably read files. Simply toggle on or off with M-x view-mode (or use e to exit view-mode). You can also tell Emacs to always open read-only files in view-mode with:

(setq view-read-only t)
  • Thanks for this tip. Please go into more details of dealing with read-only situations in emacs. For example, which keymap do i add to if I want to bind `n` and `p` in the Help or Info modes? Those are kind of read-only.

    • Good question. I’m not sure what the maps are – I end up having to guess in some cases. While in help mode, I run C-h m to get the help for the current mode which confirms the mode is called “help-mode” so I then use C-h v to look for a variable called help-mode-map and indeed there is a map by that name, so that should be where you want to add your bindings. This usually finds you the maps you need.