Variable: normal-erase-is-backspace

normal-erase-is-backspace is a customizable variable defined in simple.el.gz.

Value

maybe

Documentation

Set the default behavior of the Delete and Backspace keys.

If set to t, Delete key deletes forward and Backspace key deletes backward.

If set to nil, both Delete and Backspace keys delete backward.

If set to maybe (which is the default), Emacs automatically selects a behavior. On window systems, the behavior depends on the keyboard used. If the keyboard has both a Backspace key and a Delete key, and both are mapped to their usual meanings, the option's default value is set to t, so that Backspace can be used to delete backward, and Delete can be used to delete forward.

If not running under a window system, customizing this option accomplishes a similar effect by mapping \C-h, which is usually generated by the Backspace key, to \DEL, and by mapping \DEL to
\C-d via keyboard-translate. The former functionality of \C-h
is available on the F1 key. You should probably not use this setting if you don't have both Backspace, Delete and F1 keys.

Setting this variable with setq doesn't take effect. Programmatically, call normal-erase-is-backspace-mode (which see) instead.

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

View in manual

Probably introduced at or before Emacs version 21.1.

Source Code

;; Defined in /usr/src/emacs/lisp/simple.el.gz
;;; Handling of Backspace and Delete keys.

(defcustom normal-erase-is-backspace 'maybe
  "Set the default behavior of the Delete and Backspace keys.

If set to t, Delete key deletes forward and Backspace key deletes
backward.

If set to nil, both Delete and Backspace keys delete backward.

If set to `maybe' (which is the default), Emacs automatically
selects a behavior.  On window systems, the behavior depends on
the keyboard used.  If the keyboard has both a Backspace key and
a Delete key, and both are mapped to their usual meanings, the
option's default value is set to t, so that Backspace can be used
to delete backward, and Delete can be used to delete forward.

If not running under a window system, customizing this option
accomplishes a similar effect by mapping \\`C-h', which is usually
generated by the Backspace key, to \\`DEL', and by mapping \\`DEL' to
\\`C-d' via `keyboard-translate'.  The former functionality of \\`C-h'
is available on the F1 key.  You should probably not use this
setting if you don't have both Backspace, Delete and F1 keys.

Setting this variable with setq doesn't take effect.  Programmatically,
call `normal-erase-is-backspace-mode' (which see) instead."
  :type '(choice (const :tag "Off" nil)
		 (const :tag "Maybe" maybe)
		 (other :tag "On" t))
  :group 'editing-basics
  :version "21.1"
  :set (lambda (symbol value)
	 ;; The fboundp is because of a problem with :set when
	 ;; dumping Emacs.  It doesn't really matter.
	 (when (fboundp 'normal-erase-is-backspace-mode)
	   (normal-erase-is-backspace-mode (or value 0)))
	 (set-default symbol value)))