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 2019-01-30 xrp4v
before calling novel reading mode 2019-01-30
emacs novel reading mode after 2019-01-30 snc93
after calling emacs novel reading mode 2019-01-30

Here's the code:

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

• Set frame width to 70
• Line wrap at word boundaries.
• Line spacing is increased.
• Proportional width font is used.

Call again to toggle back.
URL `http://ergoemacs.org/emacs/emacs_novel_reading_mode.html'
Version 2019-01-30"
  (interactive)
  (let ()
    (if (eq (frame-parameter (selected-frame) 'width) 70)
        (progn
          (set-frame-parameter (selected-frame) 'width 106)
          (variable-pitch-mode 0)
          (setq line-spacing nil)
          (setq word-wrap nil)
          ;;
          )
      (progn
        (set-frame-parameter (selected-frame) 'width 70)
        (variable-pitch-mode 1)
        (setq line-spacing 0.4)
        (setq word-wrap t)
        ;;
        ))
    ;;
    )
  (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

If you have a question, put $5 at patreon and message me.
Or Buy Xah Emacs Tutorial
Or buy a nice keyboard: Best Keyboards for Emacs

Emacs

Emacs Lisp

Misc