Variable: kill-region-dwim

kill-region-dwim is a customizable variable defined in simple.el.gz.

Value

nil

Documentation

Behavior when kill-region is invoked without an active region.

If set to nil (default), kill the region even if it is inactive, signaling an error if there is no region. If set to emacs-word, kill the last word as defined by the current major mode. If set to unix-word, kill the last word in the style of a shell like Bash. This ignores the major mode like unix-word-rubout (which see).

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

Probably introduced at or before Emacs version 31.1.

Source Code

;; Defined in /usr/src/emacs/lisp/simple.el.gz
(defcustom kill-region-dwim nil
  "Behavior when `kill-region' is invoked without an active region.
If set to nil (default), kill the region even if it is inactive,
signaling an error if there is no region.
If set to `emacs-word', kill the last word as defined by the
current major mode.
If set to `unix-word', kill the last word in the style of a shell like
Bash.  This ignores the major mode like `unix-word-rubout' (which see)."
  :type '(choice (const :tag "Kill region even when inactive" nil)
                 (const :tag "Kill a word like `backward-kill-word'" emacs-word)
                 (const :tag "Kill a word like Bash would" unix-word))
  :group 'killing
  :version "31.1")