Distraction-free EWW surfing

December 1, 2017

Sometimes when I plan to read a longish html text, I fire up EWW, a small web browser that comes with Emacs.

However, reading pages on larger monitor doesn't provide good experience, at least not for me. Here is an example:


Let's fix that with some elisp code:

(defun eww-more-readable ()
  "Makes eww more pleasant to use. Run it after eww buffer is loaded."
  (setq eww-header-line-format nil)               ;; removes page title
  (setq mode-line-format nil)                     ;; removes mode-line
  (set-window-margins (get-buffer-window) 20 20)  ;; increases size of margins
  (redraw-display)                                ;; apply mode-line changes
  (eww-reload 'local))                            ;; apply eww-header changes

EWW already comes with eww-readable function, so I named it eww-more-readable.

Evaluate it and call with:

M-x eww-more-readable

Result is much better now:


EDIT: Chunyang Xu noticed that elisp code had balanced parentheses issue and suggested using (eww-reload 'local) to avoid re-fetching the page. Thanks!