GNU bug report logs - #4463
vc-do-command return value when using 'async

Previous Next

Package: emacs;

Reported by: Dan Nicolaescu <dann <at> ics.uci.edu>

Date: Thu, 17 Sep 2009 15:50:07 UTC

Severity: normal

Done: Juanma Barranquero <lekktu <at> gmail.com>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 4463 in the body.
You can then email your comments to 4463 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>:
bug#4463; Package emacs. (Thu, 17 Sep 2009 15:50:07 GMT) Full text and rfc822 format available.

Message #3 received at submit <at> emacsbugs.donarmstrong.com (full text, mbox):

From: Dan Nicolaescu <dann <at> ics.uci.edu>
To: bug-gnu-emacs <bug-gnu-emacs <at> gnu.org>
Subject: vc-do-command return value when using 'async
Date: Thu, 17 Sep 2009 08:43:36 -0700 (PDT)
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))




Information forwarded to bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>:
bug#4463; Package emacs. (Thu, 17 Sep 2009 18:15:04 GMT) Full text and rfc822 format available.

Acknowledgement sent to Stefan Monnier <monnier <at> IRO.UMontreal.CA>:
Extra info received and forwarded to list. Copy sent to Emacs Bugs <bug-gnu-emacs <at> gnu.org>. (Thu, 17 Sep 2009 18:15:04 GMT) Full text and rfc822 format available.

Message #8 received at submit <at> emacsbugs.donarmstrong.com (full text, mbox):

From: Stefan Monnier <monnier <at> IRO.UMontreal.CA>
To: Dan Nicolaescu <dann <at> ics.uci.edu>
Cc: 4463 <at> debbugs.gnu.org, bug-gnu-emacs <bug-gnu-emacs <at> gnu.org>
Subject: Re: bug#4463: vc-do-command return value when using 'async
Date: Thu, 17 Sep 2009 14:05:45 -0400
> 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




Information forwarded to bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>:
bug#4463; Package emacs. (Thu, 17 Sep 2009 18:15:08 GMT) Full text and rfc822 format available.

Acknowledgement sent to Stefan Monnier <monnier <at> IRO.UMontreal.CA>:
Extra info received and forwarded to list. Copy sent to Emacs Bugs <bug-gnu-emacs <at> gnu.org>. (Thu, 17 Sep 2009 18:15:08 GMT) Full text and rfc822 format available.

bug closed, send any further explanations to Dan Nicolaescu <dann <at> ics.uci.edu> Request was from Juanma Barranquero <lekktu <at> gmail.com> to control <at> emacsbugs.donarmstrong.com. (Thu, 22 Oct 2009 09:40:25 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> emacsbugs.donarmstrong.com. (Thu, 19 Nov 2009 15:24:17 GMT) Full text and rfc822 format available.

This bug report was last modified 15 years and 275 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.