Emacs: Toggle Line Spacing Command 📜

By Xah Lee. Date: . Last updated: .

Toggle Line Spacing Command

Here's a command that lets you toggle line spacing between 2 values.

This is useful for switching between reading source code and reading novels. [see Emacs: Novel Reading Mode 📜]

put this in your Emacs Init File:

(defun xah-toggle-line-spacing ()
  "Toggle variable `line-spacing' between nil and 0.5.
URL `http://xahlee.info/emacs/emacs/emacs_toggle_line_spacing.html'
Created: 2017-06-02
Version: 2026-02-24"
  (interactive)
  (if line-spacing
      (setq line-spacing nil)
    (setq line-spacing 0.5))
  (redraw-frame (selected-frame)))

Emacs Line Height

Emacs Lines, Column, Cursor Position

Soft-Wrap Lines

Reformat Lines

Show Line Number, Column Number

Highlight Current Line, Screen Line