diff options
| author | Dan Nicolaescu | 2009-09-20 19:55:36 +0000 |
|---|---|---|
| committer | Dan Nicolaescu | 2009-09-20 19:55:36 +0000 |
| commit | 4096c5f2f0db164bbaf7c39129047df6c2592bcb (patch) | |
| tree | 6e579d6fca7cc645192e52d8c401570f3a0679fc | |
| parent | 0e172cc2c1a026d3a0afc58558cf177ee4687b25 (diff) | |
| download | emacs-4096c5f2f0db164bbaf7c39129047df6c2592bcb.tar.gz emacs-4096c5f2f0db164bbaf7c39129047df6c2592bcb.zip | |
(vc-do-command): Return the process object in
the asynchronous case. Use when instead of if. Do not run
vc-exec-after to display a message if not enabled.
| -rw-r--r-- | lisp/ChangeLog | 4 | ||||
| -rw-r--r-- | lisp/vc-dispatcher.el | 27 |
2 files changed, 18 insertions, 13 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 2cbd183b9a5..11a5f69e452 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,5 +1,9 @@ | |||
| 1 | 2009-09-20 Dan Nicolaescu <dann@ics.uci.edu> | 1 | 2009-09-20 Dan Nicolaescu <dann@ics.uci.edu> |
| 2 | 2 | ||
| 3 | * vc-dispatcher.el (vc-do-command): Return the process object in | ||
| 4 | the asynchronous case. Use when instead of if. Do not run | ||
| 5 | vc-exec-after to display a message if not enabled. | ||
| 6 | |||
| 3 | * vc-git.el (vc-git-dir-extra-headers): Add keymap and mouse-face | 7 | * vc-git.el (vc-git-dir-extra-headers): Add keymap and mouse-face |
| 4 | properties to the stash strings. | 8 | properties to the stash strings. |
| 5 | (vc-git-stash-list): Return a list of strings. | 9 | (vc-git-stash-list): Return a list of strings. |
diff --git a/lisp/vc-dispatcher.el b/lisp/vc-dispatcher.el index a209e139bc2..07cf4a1ad28 100644 --- a/lisp/vc-dispatcher.el +++ b/lisp/vc-dispatcher.el | |||
| @@ -87,7 +87,7 @@ | |||
| 87 | ;; | 87 | ;; |
| 88 | ;; The main interface to the lower level is vc-do-command. This launches a | 88 | ;; The main interface to the lower level is vc-do-command. This launches a |
| 89 | ;; command, synchronously or asynchronously, making the output available | 89 | ;; command, synchronously or asynchronously, making the output available |
| 90 | ;; in a command log buffer. Two other functions, (vc-start-annotation) and | 90 | ;; in a command log buffer. Two other functions, (vc-start-logentry) and |
| 91 | ;; (vc-finish-logentry), allow you to associate a command closure with an | 91 | ;; (vc-finish-logentry), allow you to associate a command closure with an |
| 92 | ;; annotation buffer so that when the user confirms the comment the closure | 92 | ;; annotation buffer so that when the user confirms the comment the closure |
| 93 | ;; is run (with the comment as part of its context). | 93 | ;; is run (with the comment as part of its context). |
| @@ -280,7 +280,9 @@ subprocess; if it is t it means to ignore all execution errors). | |||
| 280 | FILE-OR-LIST is the name of a working file; it may be a list of | 280 | FILE-OR-LIST is the name of a working file; it may be a list of |
| 281 | files or be nil (to execute commands that don't expect a file | 281 | files or be nil (to execute commands that don't expect a file |
| 282 | name or set of files). If an optional list of FLAGS is present, | 282 | name or set of files). If an optional list of FLAGS is present, |
| 283 | that is inserted into the command line before the filename." | 283 | that is inserted into the command line before the filename. |
| 284 | Return the return value of the slave command in the synchronous | ||
| 285 | case, and the process object in the asynchronous case." | ||
| 284 | ;; FIXME: file-relative-name can return a bogus result because | 286 | ;; FIXME: file-relative-name can return a bogus result because |
| 285 | ;; it doesn't look at the actual file-system to see if symlinks | 287 | ;; it doesn't look at the actual file-system to see if symlinks |
| 286 | ;; come into play. | 288 | ;; come into play. |
| @@ -310,7 +312,7 @@ that is inserted into the command line before the filename." | |||
| 310 | ;; something, we'd have used vc-eval-after. | 312 | ;; something, we'd have used vc-eval-after. |
| 311 | ;; Use `delete-process' rather than `kill-process' because we don't | 313 | ;; Use `delete-process' rather than `kill-process' because we don't |
| 312 | ;; want any of its output to appear from now on. | 314 | ;; want any of its output to appear from now on. |
| 313 | (if oldproc (delete-process oldproc))) | 315 | (when oldproc (delete-process oldproc))) |
| 314 | (let ((squeezed (remq nil flags)) | 316 | (let ((squeezed (remq nil flags)) |
| 315 | (inhibit-read-only t) | 317 | (inhibit-read-only t) |
| 316 | (status 0)) | 318 | (status 0)) |
| @@ -330,13 +332,14 @@ that is inserted into the command line before the filename." | |||
| 330 | (let ((process-connection-type nil)) | 332 | (let ((process-connection-type nil)) |
| 331 | (apply 'start-file-process command (current-buffer) | 333 | (apply 'start-file-process command (current-buffer) |
| 332 | command squeezed)))) | 334 | command squeezed)))) |
| 333 | (if vc-command-messages | 335 | (when vc-command-messages |
| 334 | (message "Running %s in background..." full-command)) | 336 | (message "Running %s in background..." full-command)) |
| 335 | ;;(set-process-sentinel proc (lambda (p msg) (delete-process p))) | 337 | ;;(set-process-sentinel proc (lambda (p msg) (delete-process p))) |
| 336 | (set-process-filter proc 'vc-process-filter) | 338 | (set-process-filter proc 'vc-process-filter) |
| 337 | (vc-exec-after | 339 | (setq status proc) |
| 338 | `(if vc-command-messages | 340 | (when vc-command-messages |
| 339 | (message "Running %s in background... done" ',full-command)))) | 341 | (vc-exec-after |
| 342 | `(message "Running %s in background... done" ',full-command)))) | ||
| 340 | ;; Run synchronously | 343 | ;; Run synchronously |
| 341 | (when vc-command-messages | 344 | (when vc-command-messages |
| 342 | (message "Running %s in foreground..." full-command)) | 345 | (message "Running %s in foreground..." full-command)) |
| @@ -350,11 +353,9 @@ that is inserted into the command line before the filename." | |||
| 350 | (goto-char (point-min)) | 353 | (goto-char (point-min)) |
| 351 | (shrink-window-if-larger-than-buffer)) | 354 | (shrink-window-if-larger-than-buffer)) |
| 352 | (error "Running %s...FAILED (%s)" full-command | 355 | (error "Running %s...FAILED (%s)" full-command |
| 353 | (if (integerp status) (format "status %d" status) status)))) | 356 | (if (integerp status) (format "status %d" status) status))) |
| 354 | ;; We're done. But don't emit a status message if running | 357 | (when vc-command-messages |
| 355 | ;; asynchronously, it would just mislead. | 358 | (message "Running %s...OK = %d" full-command status)))) |
| 356 | (if (and vc-command-messages (not (eq okstatus 'async))) | ||
| 357 | (message "Running %s...OK = %d" full-command status))) | ||
| 358 | (vc-exec-after | 359 | (vc-exec-after |
| 359 | `(run-hook-with-args 'vc-post-command-functions | 360 | `(run-hook-with-args 'vc-post-command-functions |
| 360 | ',command ',file-or-list ',flags)) | 361 | ',command ',file-or-list ',flags)) |