Function: kill-backward-up-list

kill-backward-up-list is an interactive and byte-compiled function defined in lisp.el.gz.

Signature

(kill-backward-up-list &optional ARG)

Documentation

Kill the form containing the current sexp, leaving the sexp itself.

A prefix argument ARG causes the relevant number of surrounding forms to be removed. This command assumes point is not in a string or comment.

Key Bindings

Source Code

;; Defined in /usr/src/emacs/lisp/emacs-lisp/lisp.el.gz
;; After Zmacs:
(defun kill-backward-up-list (&optional arg)
  "Kill the form containing the current sexp, leaving the sexp itself.
A prefix argument ARG causes the relevant number of surrounding
forms to be removed.
This command assumes point is not in a string or comment."
  (interactive "*p")
  (let ((current-sexp (thing-at-point 'sexp)))
    (if current-sexp
        (save-excursion
          (backward-up-list arg)
          (kill-sexp)
          (insert current-sexp))
      (user-error "Not at a sexp"))))