changeset 15971:9e9c14ecf6e1

(narrow-to-defun): New function.
author Richard M. Stallman <rms@gnu.org>
date Thu, 29 Aug 1996 04:42:40 +0000
parents d54ae2343dff
children b741b3129c1b
files lisp/emacs-lisp/lisp.el
diffstat 1 files changed, 9 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/emacs-lisp/lisp.el	Thu Aug 29 04:39:47 1996 +0000
+++ b/lisp/emacs-lisp/lisp.el	Thu Aug 29 04:42:40 1996 +0000
@@ -209,6 +209,15 @@
   (beginning-of-defun)
   (re-search-backward "^\n" (- (point) 1) t))
 
+(defun narrow-to-defun (&optional arg)
+  "Make text outside current defun invisible.
+The defun visible is the one that contains point or follows point."
+  (interactive)
+  (save-excursion
+    (widen)
+    (beginning-of-defun)
+    (narrow-to-region (point) (progn (end-of-defun) (point)))))
+
 (defun insert-parentheses (arg)
   "Put parentheses around next ARG sexps.  Leave point after open-paren.
 No argument is equivalent to zero: just insert `()' and leave point between.