aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Nicolaescu2008-04-14 08:59:41 +0000
committerDan Nicolaescu2008-04-14 08:59:41 +0000
commit9eef6650a59cd8b62a4546aecdb121b3c22ba159 (patch)
tree27786cc05dde4d8bee783e10e0d35c24f8ea4a94
parentbf87d5fcf42aec2ef865c0051671b0b6f38071f4 (diff)
downloademacs-9eef6650a59cd8b62a4546aecdb121b3c22ba159.tar.gz
emacs-9eef6650a59cd8b62a4546aecdb121b3c22ba159.zip
(vc-status-kill-query): New function.
(vc-status-mode): Add it to kill-buffer-query-functions. (vc-status-show-fileentry): New function. (vc-status-menu-map): Bind it. Bind vc-next-action.
-rw-r--r--lisp/ChangeLog7
-rw-r--r--lisp/vc.el81
2 files changed, 59 insertions, 29 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 7c9712bb7d0..c9348ba7924 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,10 @@
12008-04-14 Dan Nicolaescu <dann@ics.uci.edu>
2
3 * vc.el (vc-status-kill-query): New function.
4 (vc-status-mode): Add it to kill-buffer-query-functions.
5 (vc-status-show-fileentry): New function.
6 (vc-status-menu-map): Bind it. Bind vc-next-action.
7
12008-04-14 Stefan Monnier <monnier@iro.umontreal.ca> 82008-04-14 Stefan Monnier <monnier@iro.umontreal.ca>
2 9
3 * minibuffer.el (minibuffer-message): Put cursor at the right place. 10 * minibuffer.el (minibuffer-message): Put cursor at the right place.
diff --git a/lisp/vc.el b/lisp/vc.el
index 1abc1207e51..5435c53e621 100644
--- a/lisp/vc.el
+++ b/lisp/vc.el
@@ -625,7 +625,7 @@
625;; nil for unregistered files, then update vc-next-action. 625;; nil for unregistered files, then update vc-next-action.
626;; 626;;
627;; - vc-register should register a fileset at a time. The backends 627;; - vc-register should register a fileset at a time. The backends
628;; already support this, only the front-end needs to be change to 628;; already support this, only the front-end needs to be changed to
629;; handle multiple files at a time. 629;; handle multiple files at a time.
630;; 630;;
631;; - add a mechanism for ignoring files. 631;; - add a mechanism for ignoring files.
@@ -648,12 +648,6 @@
648;; 648;;
649;; - vc-status toolbar needs more icons. 649;; - vc-status toolbar needs more icons.
650;; 650;;
651;; - vc-status needs a command to insert a file entry in the status
652;; display, similar to `cvs-mode-insert'.
653;;
654;; - vc-status: refresh should not completely wipe out the current
655;; contents of the vc-status buffer.
656;;
657;; - vc-diff, vc-annotate, etc. need to deal better with unregistered 651;; - vc-diff, vc-annotate, etc. need to deal better with unregistered
658;; files. Now that unregistered and ignored files are shown in 652;; files. Now that unregistered and ignored files are shown in
659;; vc-dired/vc-status, it is possible that these commands are called 653;; vc-dired/vc-status, it is possible that these commands are called
@@ -1574,7 +1568,7 @@ merge in the changes into your working copy."
1574 (state (vc-state (car files))) 1568 (state (vc-state (car files)))
1575 (model (vc-checkout-model (car files))) 1569 (model (vc-checkout-model (car files)))
1576 revision) 1570 revision)
1577 ;; Verify that the fileset is homogenous 1571 ;; Verify that the fileset is homogeneous
1578 (dolist (file (cdr files)) 1572 (dolist (file (cdr files))
1579 (unless (vc-compatible-state (vc-state file) state) 1573 (unless (vc-compatible-state (vc-state file) state)
1580 (error "Fileset is in a mixed-up state")) 1574 (error "Fileset is in a mixed-up state"))
@@ -2821,27 +2815,6 @@ specific headers."
2821 (define-key map [remup] 2815 (define-key map [remup]
2822 '(menu-item "Hide up-to-date" vc-status-hide-up-to-date 2816 '(menu-item "Hide up-to-date" vc-status-hide-up-to-date
2823 :help "Hide up-to-date items from display")) 2817 :help "Hide up-to-date items from display"))
2824 ;; VC commands.
2825 (define-key map [sepvccmd] '("--"))
2826 (define-key map [annotate]
2827 '(menu-item "Annotate" vc-annotate
2828 :help "Display the edit history of the current file using colors"))
2829 (define-key map [diff]
2830 '(menu-item "Compare with Base Version" vc-diff
2831 :help "Compare file set with the base version"))
2832 (define-key map [register]
2833 '(menu-item "Register" vc-status-register
2834 :help "Register file set into the version control system"))
2835 (define-key map [update]
2836 '(menu-item "Update to latest version" vc-update
2837 :help "Update the current fileset's files to their tip revisions"))
2838 (define-key map [revert]
2839 '(menu-item "Revert to base version" vc-revert
2840 :help "Revert working copies of the selected fileset to their repository contents."))
2841 (define-key map [log]
2842 '(menu-item "Show history" vc-print-log
2843 :help "List the change log of the current file set in a window"))
2844
2845 ;; Movement. 2818 ;; Movement.
2846 (define-key map [sepmv] '("--")) 2819 (define-key map [sepmv] '("--"))
2847 (define-key map [next-line] 2820 (define-key map [next-line]
@@ -2879,6 +2852,38 @@ specific headers."
2879 (define-key map [open] 2852 (define-key map [open]
2880 '(menu-item "Open file" vc-status-find-file 2853 '(menu-item "Open file" vc-status-find-file
2881 :help "Find the file on the current line")) 2854 :help "Find the file on the current line"))
2855 ;; VC info details
2856 (define-key map [sepvcdet] '("--"))
2857 ;; FIXME: This needs a key binding. And maybe a better name
2858 ;; ("Insert" like PCL-CVS uses does not sound that great either)...
2859 (define-key map [ins]
2860 '(menu-item "Show File" vc-status-show-fileentry
2861 :help "Show a file in the VC status listing even though it might be up to date"))
2862 (define-key map [annotate]
2863 '(menu-item "Annotate" vc-annotate
2864 :help "Display the edit history of the current file using colors"))
2865 (define-key map [diff]
2866 '(menu-item "Compare with Base Version" vc-diff
2867 :help "Compare file set with the base version"))
2868 (define-key map [log]
2869 '(menu-item "Show history" vc-print-log
2870 :help "List the change log of the current file set in a window"))
2871 ;; VC commands.
2872 (define-key map [sepvccmd] '("--"))
2873 (define-key map [update]
2874 '(menu-item "Update to latest version" vc-update
2875 :help "Update the current fileset's files to their tip revisions"))
2876 (define-key map [revert]
2877 '(menu-item "Revert to base version" vc-revert
2878 :help "Revert working copies of the selected fileset to their repository contents."))
2879 (define-key map [next-action]
2880 ;; FIXME: This really really really needs a better name!
2881 ;; And a key binding too.
2882 '(menu-item "Check In/Out" vc-next-action
2883 :help "Do the next logical version control operation on the current fileset"))
2884 (define-key map [register]
2885 '(menu-item "Register" vc-status-register
2886 :help "Register file set into the version control system"))
2882 map) 2887 map)
2883 "Menu for VC status") 2888 "Menu for VC status")
2884 2889
@@ -2999,6 +3004,9 @@ specific headers."
2999 (ewoc-create #'vc-status-printer 3004 (ewoc-create #'vc-status-printer
3000 (vc-status-headers backend default-directory))) 3005 (vc-status-headers backend default-directory)))
3001 (add-hook 'after-save-hook 'vc-status-mark-buffer-changed) 3006 (add-hook 'after-save-hook 'vc-status-mark-buffer-changed)
3007 ;; Make sure that if the VC status buffer is killed, the update
3008 ;; process running in the background is also killed.
3009 (add-hook 'kill-buffer-query-functions 'vc-status-kill-query nil t)
3002 (vc-status-refresh))) 3010 (vc-status-refresh)))
3003 3011
3004(put 'vc-status-mode 'mode-class 'special) 3012(put 'vc-status-mode 'mode-class 'special)
@@ -3128,6 +3136,14 @@ Throw an error if another update process is in progress."
3128 (setq vc-status-process-buffer nil) 3136 (setq vc-status-process-buffer nil)
3129 (setq mode-line-process nil)))) 3137 (setq mode-line-process nil))))
3130 3138
3139(defun vc-status-kill-query ()
3140 ;; Make sure that when the VC status buffer is killed the update
3141 ;; process running in background is also killed.
3142 (when (vc-status-busy)
3143 (when (y-or-n-p "Status update process running, really kill status buffer?")
3144 (vc-status-kill-dir-status-process)
3145 t)))
3146
3131(defun vc-status-next-line (arg) 3147(defun vc-status-next-line (arg)
3132 "Go to the next line. 3148 "Go to the next line.
3133If a prefix argument is given, move by that many lines." 3149If a prefix argument is given, move by that many lines."
@@ -3266,6 +3282,13 @@ that share the same state."
3266 (mapc 'vc-register (or (vc-status-marked-files) 3282 (mapc 'vc-register (or (vc-status-marked-files)
3267 (list (vc-status-current-file))))) 3283 (list (vc-status-current-file)))))
3268 3284
3285(defun vc-status-show-fileentry (file)
3286 "Insert an entry for a specific file into the current VC status listing.
3287This is typically used if the file is up-to-date (or has been added
3288outside of VC) and one wants to do some operation on it."
3289 (interactive "fShow file: ")
3290 (vc-status-update (list (list (file-relative-name file) (vc-state file))) (current-buffer)))
3291
3269(defun vc-status-find-file () 3292(defun vc-status-find-file ()
3270 "Find the file on the current line." 3293 "Find the file on the current line."
3271 (interactive) 3294 (interactive)