Emacs: Novel Reading Mode

By Xah Lee. Date: . Last updated: .

Here's a command to make current window suitable for reading long text.

emacs novel-reading-mode 2015-11-28

Here's the code:

(defun xah-toggle-read-novel-mode ()
  "Setup current buffer to be suitable for reading long novel/article text.

• Line wrap at word boundaries.
• Set a right margin.
• line spacing is increased.
• variable width font is used.

Call again to toggle back.
URL `http://ergoemacs.org/emacs/emacs_novel_reading_mode.html'
Version 2017-02-27"
  (if (null (get this-command 'state-on-p))
        (set-window-margins nil 0 9)
        (variable-pitch-mode 1)
        (setq line-spacing 0.4)
        (setq word-wrap t)
        (put this-command 'state-on-p t))
      (set-window-margins nil 0 0)
      (variable-pitch-mode 0)
      (setq line-spacing nil)
      (setq word-wrap nil)
      (put this-command 'state-on-p nil)))
  (redraw-frame (selected-frame)))

Line Wrap Topic

  1. Hard Wrap Lines
  2. Toggle Line Wrap
  3. Reformat Lines for Source Code
  4. Visual Line Mode, Wrap Lines
  5. Novel Reading Mode
  6. toggle-word-wrap
Patreon me $5 patreon

Or Buy Xah Emacs Tutorial

Or buy a nice keyboard: Best Keyboard for Emacs

If you have a question, put $5 at patreon and message me.