Mercurial > emacs
comparison lisp/vc.el @ 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 | 8407cf00af85 |
children | 208145c77950 |
comparison
equal
deleted
inserted
replaced
4361:81016e10e279 | 4362:2c0ac46d5d5b |
---|---|
212 (progn | 212 (progn |
213 (previous-line 1) | 213 (previous-line 1) |
214 (print (cons command squeezed)) | 214 (print (cons command squeezed)) |
215 (next-line 1) | 215 (next-line 1) |
216 (pop-to-buffer "*vc*") | 216 (pop-to-buffer "*vc*") |
217 (vc-shrink-to-fit) | |
218 (goto-char (point-min)) | 217 (goto-char (point-min)) |
218 (shrink-window-if-larger-than-buffer) | |
219 (error "Running %s...FAILED (%s)" command | 219 (error "Running %s...FAILED (%s)" command |
220 (if (integerp status) | 220 (if (integerp status) |
221 (format "status %d" status) | 221 (format "status %d" status) |
222 status)) | 222 status)) |
223 ) | 223 ) |
760 (pop-to-buffer "*vc*") | 760 (pop-to-buffer "*vc*") |
761 (if (= 0 (buffer-size)) | 761 (if (= 0 (buffer-size)) |
762 (progn | 762 (progn |
763 (setq unchanged t) | 763 (setq unchanged t) |
764 (message "No changes to %s since latest version." file)) | 764 (message "No changes to %s since latest version." file)) |
765 (vc-shrink-to-fit) | 765 (goto-char (point-min)) |
766 (goto-char (point-min))) | 766 (shrink-window-if-larger-than-buffer) |
767 | |
768 ) | 767 ) |
769 (not unchanged) | 768 (not unchanged) |
770 ) | 769 ) |
771 ) | 770 ) |
772 ) | 771 ) |
949 (concat user) f)))))))) | 948 (concat user) f)))))))) |
950 (setq nonempty (not (zerop (buffer-size))))) | 949 (setq nonempty (not (zerop (buffer-size))))) |
951 (if nonempty | 950 (if nonempty |
952 (progn | 951 (progn |
953 (pop-to-buffer "*vc-status*" t) | 952 (pop-to-buffer "*vc-status*" t) |
954 (vc-shrink-to-fit) | 953 (goto-char (point-min)) |
955 (goto-char (point-min))) | 954 (shrink-window-if-larger-than-buffer))) |
956 (message "No files are currently %s under %s" | 955 (message "No files are currently %s under %s" |
957 (if verbose "registered" "locked") default-directory)) | 956 (if verbose "registered" "locked") default-directory)) |
958 )) | 957 )) |
959 | 958 |
960 (or (boundp 'minor-mode-map-alist) | 959 (or (boundp 'minor-mode-map-alist) |
1050 (pop-to-buffer vc-parent-buffer)) | 1049 (pop-to-buffer vc-parent-buffer)) |
1051 (if (and buffer-file-name (vc-name buffer-file-name)) | 1050 (if (and buffer-file-name (vc-name buffer-file-name)) |
1052 (progn | 1051 (progn |
1053 (vc-backend-print-log buffer-file-name) | 1052 (vc-backend-print-log buffer-file-name) |
1054 (pop-to-buffer (get-buffer-create "*vc*")) | 1053 (pop-to-buffer (get-buffer-create "*vc*")) |
1055 (vc-shrink-to-fit) | |
1056 (goto-char (point-min)) | 1054 (goto-char (point-min)) |
1055 (shrink-window-if-larger-than-buffer) | |
1057 ) | 1056 ) |
1058 (vc-registration-error buffer-file-name) | 1057 (vc-registration-error buffer-file-name) |
1059 ) | 1058 ) |
1060 ) | 1059 ) |
1061 | 1060 |
1642 (define-key vc-log-entry-mode "\C-c\C-c" 'vc-finish-logentry) | 1641 (define-key vc-log-entry-mode "\C-c\C-c" 'vc-finish-logentry) |
1643 ) | 1642 ) |
1644 | 1643 |
1645 ;;; These things should probably be generally available | 1644 ;;; These things should probably be generally available |
1646 | 1645 |
1647 (defun vc-shrink-to-fit () | |
1648 "Shrink window vertically until it's just large enough to contain its text." | |
1649 (let ((minsize (1+ (count-lines (point-min) (point-max))))) | |
1650 (if (< minsize (window-height)) | |
1651 (let ((window-min-height 2)) | |
1652 (shrink-window (- (window-height) minsize)))))) | |
1653 | |
1654 (defun vc-file-tree-walk (func &rest args) | 1646 (defun vc-file-tree-walk (func &rest args) |
1655 "Walk recursively through default directory. | 1647 "Walk recursively through default directory. |
1656 Invoke FUNC f ARGS on each non-directory file f underneath it." | 1648 Invoke FUNC f ARGS on each non-directory file f underneath it." |
1657 (vc-file-tree-walk-internal default-directory func args) | 1649 (vc-file-tree-walk-internal default-directory func args) |
1658 (message "Traversing directory %s...done" default-directory)) | 1650 (message "Traversing directory %s...done" default-directory)) |