Variable: visual-wrap-extra-indent

visual-wrap-extra-indent is a customizable variable defined in visual-wrap.el.gz.

Value

0

Documentation

Number of extra columns to indent in visual-wrap-prefix-mode(var)/visual-wrap-prefix-mode(fun).

visual-wrap-prefix-mode(var)/visual-wrap-prefix-mode(fun) indents the visual lines to the level of the actual line plus visual-wrap-extra-indent. A negative value will do a relative de-indent.

When the prefix is a repeated string (e.g. > or ;;; ), the extra
indent is applied by appending or trimming space characters. When the prefix is whitespace-only indentation, the extra indent is measured in canonical character widths (the default font's average character width), which may differ from the width of a space character in some fonts; the canonical width is used because variable-pitch fonts often have particularly narrow spaces, and the average character width produces more predictable indentation.

Examples:

actual indent = 2 extra indent = -1

  Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed
 do eiusmod tempor incididunt ut labore et dolore magna
 aliqua. Ut enim ad minim veniam, quis nostrud exercitation
 ullamco laboris nisi ut aliquip ex ea commodo consequat.

actual indent = 2 extra indent = 2

  Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed
    do eiusmod tempor incididunt ut labore et dolore magna
    aliqua. Ut enim ad minim veniam, quis nostrud exercitation
    ullamco laboris nisi ut aliquip ex ea commodo consequat.

This variable was added, or its default value changed, in Emacs 30.1.

Source Code

;; Defined in /usr/src/emacs/lisp/visual-wrap.el.gz
;;; visual-wrap.el --- Smart line-wrapping with wrap-prefix -*- lexical-binding: t -*-

;; Copyright (C) 2011-2021, 2024-2026 Free Software Foundation, Inc.

;; Author: Stephen Berman <stephen.berman@gmx.net>
;;         Stefan Monnier <monnier@iro.umontreal.ca>
;; Maintainer: emacs-devel@gnu.org
;; Keywords: convenience
;; Package: emacs

;; This file is part of GNU Emacs.

;; This program is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation, either version 3 of the License, or
;; (at your option) any later version.

;; This program is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
;; GNU General Public License for more details.

;; You should have received a copy of the GNU General Public License
;; along with this program.  If not, see <http://www.gnu.org/licenses/>.

;;; Commentary:

;; This package provides the `visual-wrap-prefix-mode' minor mode
;; which sets the wrap-prefix property on the fly so that
;; single-long-line paragraphs get word-wrapped in a way similar to
;; what you'd get with M-q using adaptive-fill-mode, but without
;; actually changing the buffer's text.

;;; Code:

(defcustom visual-wrap-extra-indent 0
  "Number of extra columns to indent in `visual-wrap-prefix-mode'.

`visual-wrap-prefix-mode' indents the visual lines to the level
of the actual line plus `visual-wrap-extra-indent'.  A negative
value will do a relative de-indent.

When the prefix is a repeated string (e.g. `> ' or `;;; '), the extra
indent is applied by appending or trimming space characters.  When the
prefix is whitespace-only indentation, the extra indent is measured in
canonical character widths (the default font's average character width),
which may differ from the width of a space character in some fonts; the
canonical width is used because variable-pitch fonts often have
particularly narrow spaces, and the average character width produces
more predictable indentation.

Examples:

actual indent = 2
extra indent = -1

  Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed
 do eiusmod tempor incididunt ut labore et dolore magna
 aliqua.  Ut enim ad minim veniam, quis nostrud exercitation
 ullamco laboris nisi ut aliquip ex ea commodo consequat.

actual indent = 2
extra indent = 2

  Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed
    do eiusmod tempor incididunt ut labore et dolore magna
    aliqua.  Ut enim ad minim veniam, quis nostrud exercitation
    ullamco laboris nisi ut aliquip ex ea commodo consequat."
  :type 'integer
  :safe #'integerp
  :version "30.1"
  :group 'visual-line)