diff options
| author | Eric S. Raymond | 1993-03-28 06:24:42 +0000 |
|---|---|---|
| committer | Eric S. Raymond | 1993-03-28 06:24:42 +0000 |
| commit | a04adb2a9c834b7957aa4129f46d1317cfc5022f (patch) | |
| tree | fc7d3d58341f9291340a99a1cb9202ff09653b77 | |
| parent | f536481dfa361b606743b6c1ff11cdfd203e42cc (diff) | |
| download | emacs-a04adb2a9c834b7957aa4129f46d1317cfc5022f.tar.gz emacs-a04adb2a9c834b7957aa4129f46d1317cfc5022f.zip | |
(shrink-window-if-larger-than-buffer) Added doc string. Made argument
optional, because window-buffer does the right thing with nil.
| -rw-r--r-- | lisp/electric.el | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lisp/electric.el b/lisp/electric.el index 5272d706845..dbb19946d6b 100644 --- a/lisp/electric.el +++ b/lisp/electric.el | |||
| @@ -29,7 +29,10 @@ | |||
| 29 | ;;; Code: | 29 | ;;; Code: |
| 30 | 30 | ||
| 31 | ;; perhaps this should be in subr.el... | 31 | ;; perhaps this should be in subr.el... |
| 32 | (defun shrink-window-if-larger-than-buffer (window) | 32 | (defun shrink-window-if-larger-than-buffer (&optional window) |
| 33 | "Shrink the WINDOW to be as small as possible to display its contents. Do | ||
| 34 | nothing if only one window is displayed or if the buffer contains more lines | ||
| 35 | than the present window height." | ||
| 33 | (save-excursion | 36 | (save-excursion |
| 34 | (set-buffer (window-buffer window)) | 37 | (set-buffer (window-buffer window)) |
| 35 | (let ((w (selected-window)) ;save-window-excursion can't win | 38 | (let ((w (selected-window)) ;save-window-excursion can't win |