]> code.delx.au - gnu-emacs/commitdiff
(shrink-window-if-larger-than-buffer) Added doc string. Made argument
authorEric S. Raymond <esr@snark.thyrsus.com>
Sun, 28 Mar 1993 06:24:42 +0000 (06:24 +0000)
committerEric S. Raymond <esr@snark.thyrsus.com>
Sun, 28 Mar 1993 06:24:42 +0000 (06:24 +0000)
optional, because window-buffer does the right thing with nil.

lisp/electric.el

index 5272d7068451cbf580a5b864fd0b046f1837eb46..dbb19946d6bf650817e9eee7477334d25e391c4c 100644 (file)
 ;;; 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