Emacs: Set Line Spacing

By Xah Lee. Date: . Last updated: .

How to set line spacing?

You can change line spacing by setting the variable line-spacing.

For example: call eval-expression then type (setq line-spacing 0.5)

the value can be a integer or decimal number.

Toggle Line Spacing Command

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

(defun xah-toggle-line-spacing ()
  "Toggle line spacing between no extra space to extra half line height.
URL `http://ergoemacs.org/emacs/emacs_toggle_line_spacing.html'
Version 2015-12-17"
  (interactive)
  (if (null line-spacing)
      (setq line-spacing 0.5) ; add 0.5 height between lines
    (setq line-spacing nil)   ; no extra heigh between lines
    )
  (redraw-frame (selected-frame)))

This is useful for switching between reading source code and reading novels. 〔➤see Emacs: Novel Reading Mode

Note that the spacing height between lines also depends on font. See: Emacs: Font Configuration.

Like it? Buy Xah Emacs Tutorial. Thanks.

or, buy something from Best Keyboard for Emacs