aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEli Zaretskii2004-09-04 12:56:54 +0000
committerEli Zaretskii2004-09-04 12:56:54 +0000
commitde6d64b22a279f0f74462bf12c78d429d85a3573 (patch)
tree084251c40700f755c9893bad1309199f0b14a4e2
parent0ad10447917c7c709046b5b0a7d6a4208be3115e (diff)
downloademacs-de6d64b22a279f0f74462bf12c78d429d85a3573.tar.gz
emacs-de6d64b22a279f0f74462bf12c78d429d85a3573.zip
(kill-backward-up-list): New function.
-rw-r--r--lisp/emacs-lisp/lisp.el14
1 files changed, 14 insertions, 0 deletions
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.
149Negative arg -N means kill N sexps after the cursor." 149Negative arg -N means kill N sexps after the cursor."
150 (interactive "p") 150 (interactive "p")
151 (kill-sexp (- (or arg 1)))) 151 (kill-sexp (- (or arg 1))))
152
153;; After Zmacs:
154(defun kill-backward-up-list (&optional arg)
155 "Kill the form containing the current sexp, leaving the sexp itself.
156A prefix argument ARG causes the relevant number of surrounding
157forms to be removed."
158 (interactive "*p")
159 (let ((current-sexp (thing-at-point 'sexp)))
160 (if current-sexp
161 (save-excursion
162 (backward-up-list arg)
163 (kill-sexp)
164 (insert current-sexp))
165 (error "Not at a sexp"))))
152 166
153(defvar beginning-of-defun-function nil 167(defvar beginning-of-defun-function nil
154 "If non-nil, function for `beginning-of-defun-raw' to call. 168 "If non-nil, function for `beginning-of-defun-raw' to call.