Mercurial > emacs
comparison lisp/emacs-lisp/lisp.el @ 15971:9e9c14ecf6e1
(narrow-to-defun): New function.
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Thu, 29 Aug 1996 04:42:40 +0000 |
parents | 83f275dcd93a |
children | 454a13718b1f |
comparison
equal
deleted
inserted
replaced
15970:d54ae2343dff | 15971:9e9c14ecf6e1 |
---|---|
206 (push-mark (point)) | 206 (push-mark (point)) |
207 (end-of-defun) | 207 (end-of-defun) |
208 (push-mark (point) nil t) | 208 (push-mark (point) nil t) |
209 (beginning-of-defun) | 209 (beginning-of-defun) |
210 (re-search-backward "^\n" (- (point) 1) t)) | 210 (re-search-backward "^\n" (- (point) 1) t)) |
211 | |
212 (defun narrow-to-defun (&optional arg) | |
213 "Make text outside current defun invisible. | |
214 The defun visible is the one that contains point or follows point." | |
215 (interactive) | |
216 (save-excursion | |
217 (widen) | |
218 (beginning-of-defun) | |
219 (narrow-to-region (point) (progn (end-of-defun) (point))))) | |
211 | 220 |
212 (defun insert-parentheses (arg) | 221 (defun insert-parentheses (arg) |
213 "Put parentheses around next ARG sexps. Leave point after open-paren. | 222 "Put parentheses around next ARG sexps. Leave point after open-paren. |
214 No argument is equivalent to zero: just insert `()' and leave point between. | 223 No argument is equivalent to zero: just insert `()' and leave point between. |
215 If `parens-require-spaces' is non-nil, this command also inserts a space | 224 If `parens-require-spaces' is non-nil, this command also inserts a space |