From: Eli Zaretskii Date: Sat, 4 Sep 2004 12:56:54 +0000 (+0000) Subject: (kill-backward-up-list): New function. X-Git-Tag: ttn-vms-21-2-B4~5070 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=de6d64b22a279f0f74462bf12c78d429d85a3573;p=emacs.git (kill-backward-up-list): New function. --- diff --git a/lisp/emacs-lisp/lisp.el b/lisp/emacs-lisp/lisp.el index 46d3d2625a1..63d9f759ceb 100644 --- a/lisp/emacs-lisp/lisp.el +++ b/lisp/emacs-lisp/lisp.el @@ -149,6 +149,20 @@ With ARG, kill that many sexps before the cursor. Negative arg -N means kill N sexps after the cursor." (interactive "p") (kill-sexp (- (or arg 1)))) + +;; 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." + (interactive "*p") + (let ((current-sexp (thing-at-point 'sexp))) + (if current-sexp + (save-excursion + (backward-up-list arg) + (kill-sexp) + (insert current-sexp)) + (error "Not at a sexp")))) (defvar beginning-of-defun-function nil "If non-nil, function for `beginning-of-defun-raw' to call.