Function: keyboard-quit

keyboard-quit is an interactive and byte-compiled function defined in simple.el.gz.

Signature

(keyboard-quit)

Documentation

Signal a quit condition.

During execution of Lisp code, this character causes a quit directly. At top-level, as an editor command, this simply beeps.

This function has :before advice: evil-repeat-abort.

View in manual

Key Bindings

Source Code

;; Defined in /usr/src/emacs/lisp/simple.el.gz
;; This executes C-g typed while Emacs is waiting for a command.
;; Quitting out of a program does not go through here;
;; that happens in the maybe_quit function at the C code level.
(defun keyboard-quit ()
  "Signal a `quit' condition.
During execution of Lisp code, this character causes a quit directly.
At top-level, as an editor command, this simply beeps."
  (interactive)
  ;; Avoid adding the region to the window selection.
  (setq saved-region-selection nil)
  (let (select-active-regions)
    (deactivate-mark))
  (if (fboundp 'kmacro-keyboard-quit)
      (kmacro-keyboard-quit))
  (when completion-in-region-mode
    (completion-in-region-mode -1))
  ;; Force the next redisplay cycle to remove the "Def" indicator from
  ;; all the mode lines.
  (if defining-kbd-macro
      (force-mode-line-update t))
  (setq defining-kbd-macro nil)
  (let ((debug-on-quit nil))
    (signal 'quit nil)))