(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)
(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)
)
(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))
))
(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)
)
;;; 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."