From a04adb2a9c834b7957aa4129f46d1317cfc5022f Mon Sep 17 00:00:00 2001 From: "Eric S. Raymond" Date: Sun, 28 Mar 1993 06:24:42 +0000 Subject: [PATCH] (shrink-window-if-larger-than-buffer) Added doc string. Made argument optional, because window-buffer does the right thing with nil. --- lisp/electric.el | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lisp/electric.el b/lisp/electric.el index 5272d70684..dbb19946d6 100644 --- a/lisp/electric.el +++ b/lisp/electric.el @@ -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 -- GitLab