* bug#4463: vc-do-command return value when using 'async
@ 2009-09-17 15:43 Dan Nicolaescu
2009-09-17 18:05 ` Stefan Monnier
0 siblings, 1 reply; 2+ messages in thread
From: Dan Nicolaescu @ 2009-09-17 15:43 UTC (permalink / raw
To: bug-gnu-emacs
When passing 'async to vc-do-command there's no reliable way to
determine the exit status for the command.
When using (vc-do-command 'async BLAG) it is possible that by the time
the next command is executed the process has finished and it's not
possible to retrieve the process return value.
The patch below change vc-do-command to return the process for the async
case, that way the use has a handle to use in case the return value is
needed.
Index: lisp/vc-dispatcher.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/vc-dispatcher.el,v
retrieving revision 1.69
diff -u -3 -p -r1.69 vc-dispatcher.el
--- lisp/vc-dispatcher.el 7 Aug 2009 08:24:32 -0000 1.69
+++ lisp/vc-dispatcher.el 17 Sep 2009 05:58:06 -0000
@@ -330,13 +330,14 @@ that is inserted into the command line b
(let ((process-connection-type nil))
(apply 'start-file-process command (current-buffer)
command squeezed))))
- (if vc-command-messages
- (message "Running %s in background..." full-command))
+ (when vc-command-messages
+ (message "Running %s in background..." full-command))
;;(set-process-sentinel proc (lambda (p msg) (delete-process p)))
(set-process-filter proc 'vc-process-filter)
- (vc-exec-after
- `(if vc-command-messages
- (message "Running %s in background... done" ',full-command))))
+ (setq status proc)
+ (when vc-command-messages
+ (vc-exec-after
+ `(message "Running %s in background... done" ',full-command))))
;; Run synchronously
(when vc-command-messages
(message "Running %s in foreground..." full-command))
^ permalink raw reply [flat|nested] 2+ messages in thread
* bug#4463: vc-do-command return value when using 'async
2009-09-17 15:43 bug#4463: vc-do-command return value when using 'async Dan Nicolaescu
@ 2009-09-17 18:05 ` Stefan Monnier
0 siblings, 0 replies; 2+ messages in thread
From: Stefan Monnier @ 2009-09-17 18:05 UTC (permalink / raw
To: Dan Nicolaescu; +Cc: 4463, bug-gnu-emacs
> When passing 'async to vc-do-command there's no reliable way to
> determine the exit status for the command.
> When using (vc-do-command 'async BLAG) it is possible that by the time
> the next command is executed the process has finished and it's not
> possible to retrieve the process return value.
> The patch below change vc-do-command to return the process for the async
> case, that way the use has a handle to use in case the return value is
> needed.
If you've checked that returning a process object won't trip up any of
the callers, feel free to install the change.
Stefan
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2009-09-17 18:05 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-09-17 15:43 bug#4463: vc-do-command return value when using 'async Dan Nicolaescu
2009-09-17 18:05 ` Stefan Monnier
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.