Mercurial > emacs
comparison lisp/emacs-lisp/lisp.el @ 56924:bca93997a4d7
(kill-backward-up-list): New function.
author | Eli Zaretskii <eliz@gnu.org> |
---|---|
date | Sat, 04 Sep 2004 12:56:54 +0000 |
parents | 3dcc647295da |
children | 8c6dae33cdc3 cce1c0ee76ee |
comparison
equal
deleted
inserted
replaced
56923:9ae97554f1f0 | 56924:bca93997a4d7 |
---|---|
147 "Kill the sexp (balanced expression) preceding the cursor. | 147 "Kill the sexp (balanced expression) preceding the cursor. |
148 With ARG, kill that many sexps before the cursor. | 148 With ARG, kill that many sexps before the cursor. |
149 Negative arg -N means kill N sexps after the cursor." | 149 Negative 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. | |
156 A prefix argument ARG causes the relevant number of surrounding | |
157 forms 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. |
155 This is used to find the beginning of the defun instead of using the | 169 This is used to find the beginning of the defun instead of using the |
156 normal recipe (see `beginning-of-defun'). Major modes can define this | 170 normal recipe (see `beginning-of-defun'). Major modes can define this |