comparison lisp/vc-dir.el @ 99159:b0dce7f34dda

* vc.el: Rename VC methods that were missed when vc-status was renamed to vc-dir. * vc-svn.el (vc-svn-dir-extra-headers): Rename from vc-svn-status-extra-headers. * vc-hg.el (vc-hg-dir-printer): Rename from vc-hg-status-printer. (vc-hg-dir-extra-header): Rename from vc-hg-status-extra-headers. * vc-git.el (vc-git-dir-printer): Rename from vc-dir-status-printer. (vc-git-dir-extra-headers): Rename from vc-git-status-extra-headers. * vc-dir.el (vc-dir-mode): Use vc-dir-printer instead of vc-dir-status-printer. (vc-dir-headers): Use `dir-extra-headers' instead of `status-extra-headers' (vc-dir-printer): Rename from vc-dir-status-printer. (vc-default-dir-extra-headers): Rename from vc-default-status-extra-headers. * vc-cvs.el (vc-cvs-dir-extra-headers): Rename from vc-cvs-status-extra-headers.
author Dan Nicolaescu <dann@ics.uci.edu>
date Mon, 27 Oct 2008 07:21:43 +0000
parents be46fd14df8a
children 4203ba748ebb
comparison
equal deleted inserted replaced
99158:d1d986962044 99159:b0dce7f34dda
81 81
82 (defun vc-dir-move-to-goal-column () 82 (defun vc-dir-move-to-goal-column ()
83 ;; Used to keep the cursor on the file name column. 83 ;; Used to keep the cursor on the file name column.
84 (beginning-of-line) 84 (beginning-of-line)
85 (unless (eolp) 85 (unless (eolp)
86 ;; Must be in sync with vc-default-status-printer. 86 ;; Must be in sync with vc-default-dir-printer.
87 (forward-char 25))) 87 (forward-char 25)))
88 88
89 (defun vc-dir-prepare-status-buffer (bname dir backend &optional create-new) 89 (defun vc-dir-prepare-status-buffer (bname dir backend &optional create-new)
90 "Find a buffer named BNAME showing DIR, or create a new one." 90 "Find a buffer named BNAME showing DIR, or create a new one."
91 (setq dir (file-name-as-directory (expand-file-name dir))) 91 (setq dir (file-name-as-directory (expand-file-name dir)))
911 (when (boundp 'tool-bar-map) 911 (when (boundp 'tool-bar-map)
912 (set (make-local-variable 'tool-bar-map) vc-dir-tool-bar-map)) 912 (set (make-local-variable 'tool-bar-map) vc-dir-tool-bar-map))
913 (let ((buffer-read-only nil)) 913 (let ((buffer-read-only nil))
914 (erase-buffer) 914 (erase-buffer)
915 (set (make-local-variable 'vc-dir-process-buffer) nil) 915 (set (make-local-variable 'vc-dir-process-buffer) nil)
916 (set (make-local-variable 'vc-ewoc) (ewoc-create #'vc-dir-status-printer)) 916 (set (make-local-variable 'vc-ewoc) (ewoc-create #'vc-dir-printer))
917 (set (make-local-variable 'revert-buffer-function) 917 (set (make-local-variable 'revert-buffer-function)
918 'vc-dir-revert-buffer-function) 918 'vc-dir-revert-buffer-function)
919 (set (make-local-variable 'list-buffers-directory) 919 (set (make-local-variable 'list-buffers-directory)
920 (expand-file-name default-directory)) 920 (expand-file-name default-directory))
921 (add-hook 'after-save-hook 'vc-dir-resynch-file) 921 (add-hook 'after-save-hook 'vc-dir-resynch-file)
924 (add-hook 'kill-buffer-query-functions 'vc-dir-kill-query nil t) 924 (add-hook 'kill-buffer-query-functions 'vc-dir-kill-query nil t)
925 (vc-dir-refresh))) 925 (vc-dir-refresh)))
926 926
927 (defun vc-dir-headers (backend dir) 927 (defun vc-dir-headers (backend dir)
928 "Display the headers in the *VC dir* buffer. 928 "Display the headers in the *VC dir* buffer.
929 It calls the `status-extra-headers' backend method to display backend 929 It calls the `dir-extra-headers' backend method to display backend
930 specific headers." 930 specific headers."
931 (concat 931 (concat
932 (propertize "VC backend : " 'face 'font-lock-type-face) 932 (propertize "VC backend : " 'face 'font-lock-type-face)
933 (propertize (format "%s\n" backend) 'face 'font-lock-variable-name-face) 933 (propertize (format "%s\n" backend) 'face 'font-lock-variable-name-face)
934 (propertize "Working dir: " 'face 'font-lock-type-face) 934 (propertize "Working dir: " 'face 'font-lock-type-face)
935 (propertize (format "%s\n" dir) 'face 'font-lock-variable-name-face) 935 (propertize (format "%s\n" dir) 'face 'font-lock-variable-name-face)
936 (vc-call-backend backend 'status-extra-headers dir) 936 (vc-call-backend backend 'dir-extra-headers dir)
937 "\n")) 937 "\n"))
938 938
939 (defun vc-dir-refresh-files (files default-state) 939 (defun vc-dir-refresh-files (files default-state)
940 "Refresh some files in the *VC-dir* buffer." 940 "Refresh some files in the *VC-dir* buffer."
941 (let ((def-dir default-directory) 941 (let ((def-dir default-directory)
1066 ;; Remove files in the up-to-date state. 1066 ;; Remove files in the up-to-date state.
1067 (eq (vc-dir-fileinfo->state data) 'up-to-date)) 1067 (eq (vc-dir-fileinfo->state data) 'up-to-date))
1068 (ewoc-delete vc-ewoc crt)) 1068 (ewoc-delete vc-ewoc crt))
1069 (setq crt prev))))) 1069 (setq crt prev)))))
1070 1070
1071 (defun vc-dir-status-printer (fileentry) 1071 (defun vc-dir-printer (fileentry)
1072 (vc-call-backend vc-dir-backend 'status-printer fileentry)) 1072 (vc-call-backend vc-dir-backend 'dir-printer fileentry))
1073 1073
1074 (defun vc-dir-deduce-fileset (&optional state-model-only-files) 1074 (defun vc-dir-deduce-fileset (&optional state-model-only-files)
1075 (let ((marked (vc-dir-marked-files)) 1075 (let ((marked (vc-dir-marked-files))
1076 files 1076 files
1077 only-files-list 1077 only-files-list
1129 (vc-dir-refresh) 1129 (vc-dir-refresh)
1130 ;; FIXME: find a better way to pass the backend to `vc-dir-mode'. 1130 ;; FIXME: find a better way to pass the backend to `vc-dir-mode'.
1131 (let ((use-vc-backend backend)) 1131 (let ((use-vc-backend backend))
1132 (vc-dir-mode)))) 1132 (vc-dir-mode))))
1133 1133
1134 (defun vc-default-status-extra-headers (backend dir) 1134 (defun vc-default-dir-extra-headers (backend dir)
1135 ;; Be loud by default to remind people to add code to display 1135 ;; Be loud by default to remind people to add code to display
1136 ;; backend specific headers. 1136 ;; backend specific headers.
1137 ;; XXX: change this to return nil before the release. 1137 ;; XXX: change this to return nil before the release.
1138 (concat 1138 (concat
1139 (propertize "Extra : " 'face 'font-lock-type-face) 1139 (propertize "Extra : " 'face 'font-lock-type-face)
1140 (propertize "Please add backend specific headers here. It's easy!" 1140 (propertize "Please add backend specific headers here. It's easy!"
1141 'face 'font-lock-warning-face))) 1141 'face 'font-lock-warning-face)))
1142 1142
1143 (defun vc-default-status-printer (backend fileentry) 1143 (defun vc-default-dir-printer (backend fileentry)
1144 "Pretty print FILEENTRY." 1144 "Pretty print FILEENTRY."
1145 ;; If you change the layout here, change vc-dir-move-to-goal-column. 1145 ;; If you change the layout here, change vc-dir-move-to-goal-column.
1146 (let* ((isdir (vc-dir-fileinfo->directory fileentry)) 1146 (let* ((isdir (vc-dir-fileinfo->directory fileentry))
1147 (state (if isdir "" (vc-dir-fileinfo->state fileentry))) 1147 (state (if isdir "" (vc-dir-fileinfo->state fileentry)))
1148 (filename (vc-dir-fileinfo->name fileentry))) 1148 (filename (vc-dir-fileinfo->name fileentry)))