changeset 4362:2c0ac46d5d5b

(vc-shrink-to-fit): Deleted. All callers changed to use the new, fixed `shrink-window-if-larger-than-buffer' instead. In some places move it after a (goto-char (point-min)).
author Richard M. Stallman <rms@gnu.org>
date Sat, 31 Jul 1993 01:05:33 +0000
parents 81016e10e279
children f593b231193f
files lisp/vc.el
diffstat 1 files changed, 6 insertions(+), 14 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/vc.el	Sat Jul 31 00:55:39 1993 +0000
+++ b/lisp/vc.el	Sat Jul 31 01:05:33 1993 +0000
@@ -214,8 +214,8 @@
 	  (print (cons command squeezed))
 	  (next-line 1)
 	  (pop-to-buffer "*vc*")
-	  (vc-shrink-to-fit)
 	  (goto-char (point-min))
+	  (shrink-window-if-larger-than-buffer)
 	  (error "Running %s...FAILED (%s)" command
 		 (if (integerp status)
 		     (format "status %d" status)
@@ -762,9 +762,8 @@
 	    (progn
 	      (setq unchanged t)
 	      (message "No changes to %s since latest version." file))
-	  (vc-shrink-to-fit)
-	  (goto-char (point-min)))
-
+	  (goto-char (point-min))
+	  (shrink-window-if-larger-than-buffer)
 	)
       (not unchanged)
       )
@@ -951,8 +950,8 @@
     (if nonempty
 	(progn
 	  (pop-to-buffer "*vc-status*" t)
-	  (vc-shrink-to-fit)
-	  (goto-char (point-min)))
+	  (goto-char (point-min))
+	  (shrink-window-if-larger-than-buffer)))
       (message "No files are currently %s under %s"
 	       (if verbose "registered" "locked") default-directory))
     ))
@@ -1052,8 +1051,8 @@
       (progn
 	(vc-backend-print-log buffer-file-name)
 	(pop-to-buffer (get-buffer-create "*vc*"))
-	(vc-shrink-to-fit)
 	(goto-char (point-min))
+	(shrink-window-if-larger-than-buffer)
 	)
     (vc-registration-error buffer-file-name)
     )
@@ -1644,13 +1643,6 @@
 
 ;;; These things should probably be generally available
 
-(defun vc-shrink-to-fit ()
-  "Shrink window vertically until it's just large enough to contain its text."
-  (let ((minsize (1+ (count-lines (point-min) (point-max)))))
-    (if (< minsize (window-height))
-	(let ((window-min-height 2))
-	  (shrink-window (- (window-height) minsize))))))
-
 (defun vc-file-tree-walk (func &rest args)
   "Walk recursively through default directory.
 Invoke FUNC f ARGS on each non-directory file f underneath it."