# HG changeset patch # User Eric S. Raymond # Date 733299882 0 # Node ID 0d9cbf4b25c8d068a3f4d1d628ba1316fb3e7080 # Parent 2b34a2ef4d63e90891a97a2f0fcb6710f4e9c218 (shrink-window-if-larger-than-buffer) Added doc string. Made argument optional, because window-buffer does the right thing with nil. diff -r 2b34a2ef4d63 -r 0d9cbf4b25c8 lisp/electric.el --- a/lisp/electric.el Sun Mar 28 06:24:33 1993 +0000 +++ b/lisp/electric.el Sun Mar 28 06:24:42 1993 +0000 @@ -29,7 +29,10 @@ ;;; Code: ;; perhaps this should be in subr.el... -(defun shrink-window-if-larger-than-buffer (window) +(defun shrink-window-if-larger-than-buffer (&optional window) + "Shrink the WINDOW to be as small as possible to display its contents. Do +nothing if only one window is displayed or if the buffer contains more lines +than the present window height." (save-excursion (set-buffer (window-buffer window)) (let ((w (selected-window)) ;save-window-excursion can't win