aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric S. Raymond2008-05-06 19:12:34 +0000
committerEric S. Raymond2008-05-06 19:12:34 +0000
commitee5d572fa1207a9f57a59705a597765b9bbb3ff4 (patch)
tree0762501d09bb8add4675eac7a3ce2c4a421b2748
parent6d77fa953afa438787d700474c7d1349cb452ffb (diff)
downloademacs-ee5d572fa1207a9f57a59705a597765b9bbb3ff4.tar.gz
emacs-ee5d572fa1207a9f57a59705a597765b9bbb3ff4.zip
More refactoring.
-rw-r--r--lisp/ChangeLog1
-rw-r--r--lisp/vc-dispatcher.el50
-rw-r--r--lisp/vc.el47
3 files changed, 49 insertions, 49 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 69ce6939018..6da44486f50 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -3,6 +3,7 @@
3 * vc-hooks.el (vc-find-file-hook), 3 * vc-hooks.el (vc-find-file-hook),
4 vc-dispatcher.el (vc-resynch-window): Decouple vc-dispatcher 4 vc-dispatcher.el (vc-resynch-window): Decouple vc-dispatcher
5 further from vc.el. 5 further from vc.el.
6 * vc.el (vc-dir-mode): Move VC-specific context menu entries here.
6 7
72008-05-06 Wilson Snyder <wsnyder@wsnyder.org> 82008-05-06 Wilson Snyder <wsnyder@wsnyder.org>
8 9
diff --git a/lisp/vc-dispatcher.el b/lisp/vc-dispatcher.el
index 3bfa65f915b..2dc3c8b41bd 100644
--- a/lisp/vc-dispatcher.el
+++ b/lisp/vc-dispatcher.el
@@ -852,7 +852,6 @@ This code, like dired, assumes UNIX -l format."
852 852
853(defun vc-directory-resynch-file (file) 853(defun vc-directory-resynch-file (file)
854 "Update the entries for FILE in any VC Dired buffers that list it." 854 "Update the entries for FILE in any VC Dired buffers that list it."
855 ;;FIXME This needs to be implemented so it works for vc-dir
856 (let ((buffers (vc-dired-buffers-for-dir (file-name-directory file)))) 855 (let ((buffers (vc-dired-buffers-for-dir (file-name-directory file))))
857 (when buffers 856 (when buffers
858 (mapcar (lambda (buffer) 857 (mapcar (lambda (buffer)
@@ -1013,42 +1012,6 @@ See `run-hooks'."
1013 (define-key map [open] 1012 (define-key map [open]
1014 '(menu-item "Open file" vc-dir-find-file 1013 '(menu-item "Open file" vc-dir-find-file
1015 :help "Find the file on the current line")) 1014 :help "Find the file on the current line"))
1016 ;; FIXME: Stuff starting here should be appended by vc
1017 ;; VC info details
1018 (define-key map [sepvcdet] '("--"))
1019 (define-key map [remup]
1020 '(menu-item "Hide up-to-date" vc-dir-hide-up-to-date
1021 :help "Hide up-to-date items from display"))
1022 ;; FIXME: This needs a key binding. And maybe a better name
1023 ;; ("Insert" like PCL-CVS uses does not sound that great either)...
1024 (define-key map [ins]
1025 '(menu-item "Show File" vc-dir-show-fileentry
1026 :help "Show a file in the VC status listing even though it might be up to date"))
1027 (define-key map [annotate]
1028 '(menu-item "Annotate" vc-annotate
1029 :help "Display the edit history of the current file using colors"))
1030 (define-key map [diff]
1031 '(menu-item "Compare with Base Version" vc-diff
1032 :help "Compare file set with the base version"))
1033 (define-key map [log]
1034 '(menu-item "Show history" vc-print-log
1035 :help "List the change log of the current file set in a window"))
1036 ;; VC commands.
1037 (define-key map [sepvccmd] '("--"))
1038 (define-key map [update]
1039 '(menu-item "Update to latest version" vc-update
1040 :help "Update the current fileset's files to their tip revisions"))
1041 (define-key map [revert]
1042 '(menu-item "Revert to base version" vc-revert
1043 :help "Revert working copies of the selected fileset to their repository contents."))
1044 (define-key map [next-action]
1045 ;; FIXME: This really really really needs a better name!
1046 ;; And a key binding too.
1047 '(menu-item "Check In/Out" vc-next-action
1048 :help "Do the next logical version control operation on the current fileset"))
1049 (define-key map [register]
1050 '(menu-item "Register" vc-dir-register
1051 :help "Register file set into the version control system"))
1052 map) 1015 map)
1053 "Menu for VC status") 1016 "Menu for VC status")
1054 1017
@@ -1079,16 +1042,8 @@ See `run-hooks'."
1079 (define-key map "\C-c\C-c" 'vc-dir-kill-dir-status-process) 1042 (define-key map "\C-c\C-c" 'vc-dir-kill-dir-status-process)
1080 (define-key map [(down-mouse-3)] 'vc-dir-menu) 1043 (define-key map [(down-mouse-3)] 'vc-dir-menu)
1081 (define-key map [(mouse-2)] 'vc-dir-toggle-mark) 1044 (define-key map [(mouse-2)] 'vc-dir-toggle-mark)
1082
1083 ;; FIXME: Calls back into vc.el
1084 ;; Hook up the menu.
1085 (define-key map [menu-bar vc-dir-mode]
1086 '(menu-item
1087 ;; This is used so that client modes can add mode-specific
1088 ;; menu items to vc-dir-menu-map.
1089 "VC Status" vc-dir-menu-map :filter vc-dir-menu-map-filter))
1090 map) 1045 map)
1091 "Keymap for VC status") 1046 "Keymap for VC dispatcher commands")
1092 1047
1093(defmacro vc-at-event (event &rest body) 1048(defmacro vc-at-event (event &rest body)
1094 "Evaluate `body' wich point located at event-start of `event'. 1049 "Evaluate `body' wich point located at event-start of `event'.
@@ -1104,7 +1059,7 @@ If `body' uses `event', it should be a variable,
1104(defun vc-dir-menu (e) 1059(defun vc-dir-menu (e)
1105 "Popup the VC status menu." 1060 "Popup the VC status menu."
1106 (interactive "e") 1061 (interactive "e")
1107 (vc-at-event e (popup-menu vc-dir-menu-map e))) 1062 (vc-at-event e (popup-menu right-menu-map e)))
1108 1063
1109(defvar vc-dir-tool-bar-map 1064(defvar vc-dir-tool-bar-map
1110 (let ((map (make-sparse-keymap))) 1065 (let ((map (make-sparse-keymap)))
@@ -1612,6 +1567,7 @@ U - if the cursor is on a file: unmark all the files with the same VC state
1612 (setq buffer-read-only t) 1567 (setq buffer-read-only t)
1613 (use-local-map vc-dir-mode-map) 1568 (use-local-map vc-dir-mode-map)
1614 (set (make-local-variable 'tool-bar-map) vc-dir-tool-bar-map) 1569 (set (make-local-variable 'tool-bar-map) vc-dir-tool-bar-map)
1570 (set (make-local-variable 'right-menu-map) vc-dir-menu-map)
1615 (set (make-local-variable 'vc-client-mode) client-object) 1571 (set (make-local-variable 'vc-client-mode) client-object)
1616 (let ((buffer-read-only nil)) 1572 (let ((buffer-read-only nil))
1617 (erase-buffer) 1573 (erase-buffer)
diff --git a/lisp/vc.el b/lisp/vc.el
index 884e679663e..d47e5713ce2 100644
--- a/lisp/vc.el
+++ b/lisp/vc.el
@@ -2134,8 +2134,51 @@ outside of VC) and one wants to do some operation on it."
2134 (define-key map "R" 'vc-revert) ;; u is taken by dispatcher unmark. 2134 (define-key map "R" 'vc-revert) ;; u is taken by dispatcher unmark.
2135 (define-key map "A" 'vc-annotate) ;; g is taken by dispatcher referesh 2135 (define-key map "A" 'vc-annotate) ;; g is taken by dispatcher referesh
2136 (define-key map "l" 'vc-print-log) ;; C-x v l 2136 (define-key map "l" 'vc-print-log) ;; C-x v l
2137 (define-key map "x" 'vc-dir-hide-up-to-date) 2137 (define-key map "x" 'vc-dir-hide-up-to-date))
2138 )))) 2138 ;; Add VC-specific context menu items
2139 (let ((map right-menu-map))
2140 ;; VC info details
2141 (define-key map [sepvcdet] '("--"))
2142 (define-key map [remup]
2143 '(menu-item "Hide up-to-date" vc-dir-hide-up-to-date
2144 :help "Hide up-to-date items from display"))
2145 ;; FIXME: This needs a key binding. And maybe a better name
2146 ;; ("Insert" like PCL-CVS uses does not sound that great either)...
2147 (define-key map [ins]
2148 '(menu-item "Show File" vc-dir-show-fileentry
2149 :help "Show a file in the VC status listing even though it might be up to date"))
2150 (define-key map [annotate]
2151 '(menu-item "Annotate" vc-annotate
2152 :help "Display the edit history of the current file using colors"))
2153 (define-key map [diff]
2154 '(menu-item "Compare with Base Version" vc-diff
2155 :help "Compare file set with the base version"))
2156 (define-key map [log]
2157 '(menu-item "Show history" vc-print-log
2158 :help "List the change log of the current file set in a window"))
2159 ;; VC commands.
2160 (define-key map [sepvccmd] '("--"))
2161 (define-key map [update]
2162 '(menu-item "Update to latest version" vc-update
2163 :help "Update the current fileset's files to their tip revisions"))
2164 (define-key map [revert]
2165 '(menu-item "Revert to base version" vc-revert
2166 :help "Revert working copies of the selected fileset to their repository contents."))
2167 (define-key map [next-action]
2168 ;; FIXME: This really really really needs a better name!
2169 ;; And a key binding too.
2170 '(menu-item "Check In/Out" vc-next-action
2171 :help "Do the next logical version control operation on the current fileset"))
2172 (define-key map [register]
2173 '(menu-item "Register" vc-dir-register
2174 :help "Register file set into the version control system")))
2175 ;; Hook up the menu.
2176 (define-key (current-local-map) [menu-bar vc-dir-mode]
2177 '(menu-item
2178 ;; This is used so that back ends can add mode-specific
2179 ;; menu items to vc-dir-menu-map.
2180 "VC Status" vc-dir-menu-map :filter vc-dir-menu-map-filter))
2181 )))
2139 2182
2140;; Named-configuration entry points 2183;; Named-configuration entry points
2141 2184