From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Dan Nicolaescu Newsgroups: gmane.emacs.bugs Subject: bug#4463: vc-do-command return value when using 'async Date: Thu, 17 Sep 2009 08:43:36 -0700 (PDT) Message-ID: <200909171543.n8HFhaR1024941@godzilla.ics.uci.edu> Reply-To: Dan Nicolaescu , 4463@emacsbugs.donarmstrong.com NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1253203935 25391 80.91.229.12 (17 Sep 2009 16:12:15 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 17 Sep 2009 16:12:15 +0000 (UTC) To: bug-gnu-emacs Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Sep 17 18:12:08 2009 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1MoJaY-0000uW-RU for geb-bug-gnu-emacs@m.gmane.org; Thu, 17 Sep 2009 18:12:07 +0200 Original-Received: from localhost ([127.0.0.1]:54045 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MoJaY-0005A7-1N for geb-bug-gnu-emacs@m.gmane.org; Thu, 17 Sep 2009 12:12:06 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MoJVx-0003D6-4g for bug-gnu-emacs@gnu.org; Thu, 17 Sep 2009 12:07:21 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MoJVn-00039s-Tv for bug-gnu-emacs@gnu.org; Thu, 17 Sep 2009 12:07:18 -0400 Original-Received: from [199.232.76.173] (port=43404 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MoJVn-00039k-LO for bug-gnu-emacs@gnu.org; Thu, 17 Sep 2009 12:07:11 -0400 Original-Received: from rzlab.ucr.edu ([138.23.92.77]:33177) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1MoJVm-0007h2-CS for bug-gnu-emacs@gnu.org; Thu, 17 Sep 2009 12:07:11 -0400 Original-Received: from rzlab.ucr.edu (rzlab.ucr.edu [127.0.0.1]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id n8HG71Dm014484; Thu, 17 Sep 2009 09:07:01 -0700 Original-Received: (from debbugs@localhost) by rzlab.ucr.edu (8.14.3/8.14.3/Submit) id n8HFo7kv010990; Thu, 17 Sep 2009 08:50:07 -0700 Resent-Date: Thu, 17 Sep 2009 08:50:07 -0700 X-Loop: owner@emacsbugs.donarmstrong.com Resent-From: Dan Nicolaescu Resent-To: bug-submit-list@donarmstrong.com Resent-CC: Emacs Bugs 2Resent-Date: Thu, 17 Sep 2009 15:50:07 +0000 Resent-Message-ID: Resent-Sender: owner@emacsbugs.donarmstrong.com X-Emacs-PR-Message: report 4463 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Original-Received: via spool by submit@emacsbugs.donarmstrong.com id=B.125320232310266 (code B ref -1); Thu, 17 Sep 2009 15:50:07 +0000 Original-Received: (at submit) by emacsbugs.donarmstrong.com; 17 Sep 2009 15:45:23 +0000 X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. Original-Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id n8HFjL83010263 for ; Thu, 17 Sep 2009 08:45:22 -0700 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MoJAf-00007k-1a for bug-gnu-emacs@gnu.org; Thu, 17 Sep 2009 11:45:21 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MoJAa-00006n-5Y for bug-gnu-emacs@gnu.org; Thu, 17 Sep 2009 11:45:20 -0400 Original-Received: from [199.232.76.173] (port=38659 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MoJAZ-00006k-So for bug-gnu-emacs@gnu.org; Thu, 17 Sep 2009 11:45:15 -0400 Original-Received: from sallyv2.ics.uci.edu ([128.195.1.120]:45601) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_3DES_EDE_CBC_SHA1:24) (Exim 4.60) (envelope-from ) id 1MoJAZ-0003g1-Bf for bug-gnu-emacs@gnu.org; Thu, 17 Sep 2009 11:45:15 -0400 Original-Received: from godzilla.ics.uci.edu (godzilla.ics.uci.edu [128.195.10.101]) by sallyv2.ics.uci.edu (8.13.8+Sun/8.13.8) with ESMTP id n8HFhao6003306 for ; Thu, 17 Sep 2009 08:43:36 -0700 (PDT) Original-Received: (from dann@localhost) by godzilla.ics.uci.edu (8.13.8+Sun/8.13.6/Submit) id n8HFhaR1024941; Thu, 17 Sep 2009 08:43:36 -0700 (PDT) Original-Lines: 39 X-ICS-MailScanner-Information: Please contact the ISP for more information X-ICS-MailScanner-ID: n8HFhao6003306 X-ICS-MailScanner: Found to be clean X-ICS-MailScanner-SpamCheck: not spam, SpamAssassin (score=-1.44, required 5, autolearn=disabled, ALL_TRUSTED -1.44) X-ICS-MailScanner-From: dann@godzilla.ics.uci.edu X-detected-operating-system: by monty-python.gnu.org: Solaris 10 (beta) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) Resent-Date: Thu, 17 Sep 2009 12:07:18 -0400 X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:31170 Archived-At: 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))