Function: kill-ring-deindent-mode

kill-ring-deindent-mode is an autoloaded, interactive and byte-compiled function defined in indent-aux.el.gz.

Signature

(kill-ring-deindent-mode &optional ARG)

Documentation

Toggle removal of indentation from text saved to the kill ring.

When this minor mode is enabled, text saved into the kill ring is indented towards the left by the column number at the start of that text.

This is a global minor mode. If called interactively, toggle the Kill-Ring-Deindent mode mode. If the prefix argument is positive, enable the mode, and if it is zero or negative, disable the mode.

If called from Lisp, toggle the mode if ARG is toggle. Enable the mode if ARG is nil, omitted, or is a positive number. Disable the mode if ARG is a negative number.

To check whether the minor mode is enabled in the current buffer, evaluate (default-value \=kill-ring-deindent-mode)'.

The mode's hook is called both when the mode is enabled and when it is disabled.

View in manual

Probably introduced at or before Emacs version 30.1.

Key Bindings

Source Code

;; Defined in /usr/src/emacs/lisp/indent-aux.el.gz
;;;###autoload
(define-minor-mode kill-ring-deindent-mode
  "Toggle removal of indentation from text saved to the kill ring.

When this minor mode is enabled, text saved into the kill ring is
indented towards the left by the column number at the start of
that text."
  :global 't
  :group 'killing
  (if kill-ring-deindent-mode
      (add-function :override filter-buffer-substring-function
                    #'kill-ring-deindent-buffer-substring-function
                    '(:depth 100))
    (remove-function filter-buffer-substring-function
                     #'kill-ring-deindent-buffer-substring-function)))