diff options
| author | Dan Nicolaescu | 2008-02-22 07:44:08 +0000 |
|---|---|---|
| committer | Dan Nicolaescu | 2008-02-22 07:44:08 +0000 |
| commit | 751c9f0042f71142f727c53008faf1a8ea80822b (patch) | |
| tree | 0e9078776fc03b0a858773b4cf40ef183ddf9142 | |
| parent | 4dd7de9aafca38477a68c735065fb7018411d139 (diff) | |
| download | emacs-751c9f0042f71142f727c53008faf1a8ea80822b.tar.gz emacs-751c9f0042f71142f727c53008faf1a8ea80822b.zip | |
* vc.el (vc-exec-after): Move setting mode-line-process in the
busy case ...
(vc-set-mode-line-busy-indicator): ... in this new function.
(vc-status-refresh): Call vc-set-mode-line-busy-indicator.
(vc-update-vc-status-buffer): Reset mode-line-process.
(vc-status-mark-all-files, vc-status-unmark-all-files): Change to
mark/unmark all the files with the same state as the current one.
With a prefix argument mark/unmark all files.
(vc-status-mode-menu): Adjust strings.
(vc-update-vc-status-buffer): Only do something when the argument
is not nil.
(vc-status-kill-dir-status-process): New function.
(vc-status-mode-map): Bind it.
(vc-status-process-buffer): New variable.
(vc-status-mode): Make it local.
(vc-status-refresh): Set it.
* vc-hg.el (vc-hg-dir-status):
* vc-git.el (vc-git-dir-status):
* vc-svn.el (vc-svn-dir-status): Return the buffer in which the
command is run.
| -rw-r--r-- | lisp/ChangeLog | 12 | ||||
| -rw-r--r-- | lisp/vc-git.el | 3 | ||||
| -rw-r--r-- | lisp/vc-hg.el | 3 | ||||
| -rw-r--r-- | lisp/vc-svn.el | 3 | ||||
| -rw-r--r-- | lisp/vc.el | 32 |
5 files changed, 43 insertions, 10 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 61ba0356e8c..33298beba9b 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -9,6 +9,18 @@ | |||
| 9 | mark/unmark all the files with the same state as the current one. | 9 | mark/unmark all the files with the same state as the current one. |
| 10 | With a prefix argument mark/unmark all files. | 10 | With a prefix argument mark/unmark all files. |
| 11 | (vc-status-mode-menu): Adjust strings. | 11 | (vc-status-mode-menu): Adjust strings. |
| 12 | (vc-update-vc-status-buffer): Only do something when the argument | ||
| 13 | is not nil. | ||
| 14 | (vc-status-kill-dir-status-process): New function. | ||
| 15 | (vc-status-mode-map): Bind it. | ||
| 16 | (vc-status-process-buffer): New variable. | ||
| 17 | (vc-status-mode): Make it local. | ||
| 18 | (vc-status-refresh): Set it. | ||
| 19 | |||
| 20 | * vc-hg.el (vc-hg-dir-status): | ||
| 21 | * vc-git.el (vc-git-dir-status): | ||
| 22 | * vc-svn.el (vc-svn-dir-status): Return the buffer in which the | ||
| 23 | command is run. | ||
| 12 | 24 | ||
| 13 | 2008-02-22 Glenn Morris <rgm@gnu.org> | 25 | 2008-02-22 Glenn Morris <rgm@gnu.org> |
| 14 | 26 | ||
diff --git a/lisp/vc-git.el b/lisp/vc-git.el index c8c63a22181..c2295ddaddc 100644 --- a/lisp/vc-git.el +++ b/lisp/vc-git.el | |||
| @@ -252,7 +252,8 @@ | |||
| 252 | "--directory" | 252 | "--directory" |
| 253 | "--exclude-per-directory=.gitignore") | 253 | "--exclude-per-directory=.gitignore") |
| 254 | (vc-exec-after | 254 | (vc-exec-after |
| 255 | `(vc-git-after-dir-status (quote ,update-function) ,status-buffer)))) | 255 | `(vc-git-after-dir-status (quote ,update-function) ,status-buffer)) |
| 256 | (current-buffer))) | ||
| 256 | 257 | ||
| 257 | ;;; STATE-CHANGING FUNCTIONS | 258 | ;;; STATE-CHANGING FUNCTIONS |
| 258 | 259 | ||
diff --git a/lisp/vc-hg.el b/lisp/vc-hg.el index 86a9b34f08e..e73537a4bb8 100644 --- a/lisp/vc-hg.el +++ b/lisp/vc-hg.el | |||
| @@ -518,7 +518,8 @@ REV is the revision to check out into WORKFILE." | |||
| 518 | (erase-buffer) | 518 | (erase-buffer) |
| 519 | (vc-hg-command (current-buffer) 'async dir "status") | 519 | (vc-hg-command (current-buffer) 'async dir "status") |
| 520 | (vc-exec-after | 520 | (vc-exec-after |
| 521 | `(vc-hg-after-dir-status (quote ,update-function) ,status-buffer)))) | 521 | `(vc-hg-after-dir-status (quote ,update-function) ,status-buffer)) |
| 522 | (current-buffer))) | ||
| 522 | 523 | ||
| 523 | ;; XXX this adds another top level menu, instead figure out how to | 524 | ;; XXX this adds another top level menu, instead figure out how to |
| 524 | ;; replace the Log-View menu. | 525 | ;; replace the Log-View menu. |
diff --git a/lisp/vc-svn.el b/lisp/vc-svn.el index 52fb1a515e1..37a5dfb1d3e 100644 --- a/lisp/vc-svn.el +++ b/lisp/vc-svn.el | |||
| @@ -185,7 +185,8 @@ RESULT is a list of conses (FILE . STATE) for directory DIR." | |||
| 185 | (generate-new-buffer-name " *vc svn status*")) | 185 | (generate-new-buffer-name " *vc svn status*")) |
| 186 | (vc-svn-command (current-buffer) 'async nil "status") | 186 | (vc-svn-command (current-buffer) 'async nil "status") |
| 187 | (vc-exec-after | 187 | (vc-exec-after |
| 188 | `(vc-svn-after-dir-status (quote ,callback) ,buffer)))) | 188 | `(vc-svn-after-dir-status (quote ,callback) ,buffer)) |
| 189 | (current-buffer))) | ||
| 189 | 190 | ||
| 190 | (defun vc-svn-working-revision (file) | 191 | (defun vc-svn-working-revision (file) |
| 191 | "SVN-specific version of `vc-working-revision'." | 192 | "SVN-specific version of `vc-working-revision'." |
diff --git a/lisp/vc.el b/lisp/vc.el index a12211b7c21..c8321e816ca 100644 --- a/lisp/vc.el +++ b/lisp/vc.el | |||
| @@ -174,6 +174,8 @@ | |||
| 174 | ;; this list, it should be run asynchronously. When RESULT is | 174 | ;; this list, it should be run asynchronously. When RESULT is |
| 175 | ;; computed, it should be passed back by doing: | 175 | ;; computed, it should be passed back by doing: |
| 176 | ;; (funcall UPDATE-FUNCTION RESULT STATUS-BUFFER) | 176 | ;; (funcall UPDATE-FUNCTION RESULT STATUS-BUFFER) |
| 177 | ;; Return the buffer used for the asynchronous call. This buffer | ||
| 178 | ;; is used to kill the status update process on demand. | ||
| 177 | ;; This function is used by vc-status, a replacement for vc-dired. | 179 | ;; This function is used by vc-status, a replacement for vc-dired. |
| 178 | ;; vc-status is still under development, and is NOT feature | 180 | ;; vc-status is still under development, and is NOT feature |
| 179 | ;; complete. As such, the requirements for this function might | 181 | ;; complete. As such, the requirements for this function might |
| @@ -2715,6 +2717,7 @@ With prefix arg READ-SWITCHES, specify a value to override | |||
| 2715 | (define-key map "o" 'vc-status-find-file-other-window) | 2717 | (define-key map "o" 'vc-status-find-file-other-window) |
| 2716 | (define-key map "q" 'bury-buffer) | 2718 | (define-key map "q" 'bury-buffer) |
| 2717 | (define-key map "g" 'vc-status-refresh) | 2719 | (define-key map "g" 'vc-status-refresh) |
| 2720 | (define-key map "\C-c\C-c" 'vc-status-kill-dir-status-process) | ||
| 2718 | ;; Not working yet. Functions like vc-status-find-file need to | 2721 | ;; Not working yet. Functions like vc-status-find-file need to |
| 2719 | ;; find the file from the mouse position, not `point'. | 2722 | ;; find the file from the mouse position, not `point'. |
| 2720 | ;; (define-key map [(down-mouse-3)] 'vc-status-menu) | 2723 | ;; (define-key map [(down-mouse-3)] 'vc-status-menu) |
| @@ -2785,6 +2788,9 @@ With prefix arg READ-SWITCHES, specify a value to override | |||
| 2785 | (interactive "e") | 2788 | (interactive "e") |
| 2786 | (popup-menu vc-status-mode-menu e)) | 2789 | (popup-menu vc-status-mode-menu e)) |
| 2787 | 2790 | ||
| 2791 | (defvar vc-status-process-buffer nil | ||
| 2792 | "The buffer used for the asynchronous call that computes the VC status.") | ||
| 2793 | |||
| 2788 | (defun vc-status-mode () | 2794 | (defun vc-status-mode () |
| 2789 | "Major mode for VC status. | 2795 | "Major mode for VC status. |
| 2790 | \\{vc-status-mode-map}" | 2796 | \\{vc-status-mode-map}" |
| @@ -2796,6 +2802,7 @@ With prefix arg READ-SWITCHES, specify a value to override | |||
| 2796 | (backend (vc-responsible-backend default-directory)) | 2802 | (backend (vc-responsible-backend default-directory)) |
| 2797 | entries) | 2803 | entries) |
| 2798 | (erase-buffer) | 2804 | (erase-buffer) |
| 2805 | (set (make-local-variable 'vc-status-process-buffer) nil) | ||
| 2799 | (set (make-local-variable 'vc-status) | 2806 | (set (make-local-variable 'vc-status) |
| 2800 | (ewoc-create #'vc-status-printer | 2807 | (ewoc-create #'vc-status-printer |
| 2801 | (vc-status-headers backend default-directory))) | 2808 | (vc-status-headers backend default-directory))) |
| @@ -2805,10 +2812,11 @@ With prefix arg READ-SWITCHES, specify a value to override | |||
| 2805 | 2812 | ||
| 2806 | (defun vc-update-vc-status-buffer (entries buffer) | 2813 | (defun vc-update-vc-status-buffer (entries buffer) |
| 2807 | (with-current-buffer buffer | 2814 | (with-current-buffer buffer |
| 2808 | (dolist (entry entries) | 2815 | (when entries |
| 2809 | (ewoc-enter-last vc-status | 2816 | (dolist (entry entries) |
| 2810 | (vc-status-create-fileinfo (cdr entry) (car entry)))) | 2817 | (ewoc-enter-last vc-status |
| 2811 | (ewoc-goto-node vc-status (ewoc-nth vc-status 0)) | 2818 | (vc-status-create-fileinfo (cdr entry) (car entry)))) |
| 2819 | (ewoc-goto-node vc-status (ewoc-nth vc-status 0))) | ||
| 2812 | (setq mode-line-process nil))) | 2820 | (setq mode-line-process nil))) |
| 2813 | 2821 | ||
| 2814 | (defun vc-status-refresh () | 2822 | (defun vc-status-refresh () |
| @@ -2822,9 +2830,19 @@ With prefix arg READ-SWITCHES, specify a value to override | |||
| 2822 | ;; be asynchronous. It should compute the results and call the | 2830 | ;; be asynchronous. It should compute the results and call the |
| 2823 | ;; function passed as a an arg to update the vc-status buffer with | 2831 | ;; function passed as a an arg to update the vc-status buffer with |
| 2824 | ;; the results. | 2832 | ;; the results. |
| 2825 | (vc-call-backend | 2833 | (setq vc-status-process-buffer |
| 2826 | backend 'dir-status default-directory | 2834 | (vc-call-backend |
| 2827 | #'vc-update-vc-status-buffer (current-buffer)))) | 2835 | backend 'dir-status default-directory |
| 2836 | #'vc-update-vc-status-buffer (current-buffer))))) | ||
| 2837 | |||
| 2838 | (defun vc-status-kill-dir-status-process () | ||
| 2839 | "Kill the temporary buffer and associated process." | ||
| 2840 | (interactive) | ||
| 2841 | (when (and (bufferp vc-status-process-buffer) | ||
| 2842 | (buffer-live-p vc-status-process-buffer)) | ||
| 2843 | (let ((proc (get-buffer-process vc-status-process-buffer))) | ||
| 2844 | (when proc (delete-process proc)) | ||
| 2845 | (setq mode-line-process nil)))) | ||
| 2828 | 2846 | ||
| 2829 | (defun vc-status-next-line (arg) | 2847 | (defun vc-status-next-line (arg) |
| 2830 | "Go to the next line. | 2848 | "Go to the next line. |