Commit a04adb2a authored by Eric S. Raymond's avatar Eric S. Raymond

(shrink-window-if-larger-than-buffer) Added doc string. Made argument

optional, because window-buffer does the right thing with nil.
parent f536481d
......@@ -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
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment