From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Perry Smith Newsgroups: gmane.emacs.help Subject: Re: waiting for asynchronous processes Date: Sun, 16 Oct 2011 07:49:28 -0500 Message-ID: <1A429CBB-4E91-427F-B556-5DF1224C435E@gmail.com> References: <87hb39zydn.fsf@gmail.com> <9669B9E0-85E4-4025-9596-FA77C8754E84@gmail.com> <87d3dxzqgl.fsf@gmail.com> <878volz47v.fsf@gmail.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 (Apple Message framework v1251.1) Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1318769386 14750 80.91.229.12 (16 Oct 2011 12:49:46 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sun, 16 Oct 2011 12:49:46 +0000 (UTC) Cc: help-gnu-emacs List To: =?utf-8?Q?=C5=A0t=C4=9Bp=C3=A1n_N=C4=9Bmec?= Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sun Oct 16 14:49:42 2011 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1RFQ9t-0004ea-N2 for geh-help-gnu-emacs@m.gmane.org; Sun, 16 Oct 2011 14:49:41 +0200 Original-Received: from localhost ([::1]:37615 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RFQ9s-00061E-Sn for geh-help-gnu-emacs@m.gmane.org; Sun, 16 Oct 2011 08:49:40 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:47630) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RFQ9o-00060x-EC for help-gnu-emacs@gnu.org; Sun, 16 Oct 2011 08:49:37 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RFQ9n-0006Il-Ec for help-gnu-emacs@gnu.org; Sun, 16 Oct 2011 08:49:36 -0400 Original-Received: from mail-gy0-f169.google.com ([209.85.160.169]:42100) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RFQ9n-0006Ih-An for help-gnu-emacs@gnu.org; Sun, 16 Oct 2011 08:49:35 -0400 Original-Received: by gyf3 with SMTP id 3so2474693gyf.0 for ; Sun, 16 Oct 2011 05:49:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=subject:mime-version:content-type:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to:x-mailer; bh=Z7AdPf4bvjY0qtacDF/U7kmrUWd5vQmtPcHC2m4x8XU=; b=nERbbQfvAIAMo7blsG8Z4bPz+e1qbLqw7ccr8spjGe7zVpNuZsxebacaDR5/BtUCvG nKp1rBRNkQXSdbSIbTJUMYTJMZjMTACudtoXTpQjMTyVX8gfurlMXJr4AHzYnH8dYLP+ g5888XKIm85Pt+b9sPLqhCFA5wpEMeIMGTLLU= Original-Received: by 10.150.190.20 with SMTP id n20mr14007750ybf.63.1318769374777; Sun, 16 Oct 2011 05:49:34 -0700 (PDT) Original-Received: from [10.0.0.4] ([64.128.19.234]) by mx.google.com with ESMTPS id u13sm27413477anf.14.2011.10.16.05.49.32 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 16 Oct 2011 05:49:34 -0700 (PDT) In-Reply-To: <878volz47v.fsf@gmail.com> X-Mailer: Apple Mail (2.1251.1) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 209.85.160.169 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:82575 Archived-At: On Oct 16, 2011, at 4:16 AM, =C5=A0t=C4=9Bp=C3=A1n N=C4=9Bmec wrote: > On Sun, 16 Oct 2011 03:49:51 +0200 > Perry Smith wrote: >=20 >> I was hooking this into a keyboard macro so I basically wanted to "do = nothing" >> while I waited for the process to complete. What is the proper way to = "do >> nothing" in emacs? >=20 > Well, `sleep-for' is quite close to "do nothing" I suppose, but I = don't > think that's what you want -- you want the process to run and other > stuff to happen when the process finishes, so just staring at the = screen > until then seems a more appropriate "do nothing" implementation here. >=20 > I also don't think a keyboard macro is suitable for what you're doing. > You will at least need to bind some variable(s) around the `grep' > invocation, and the only way I can think of to do that with a keyboard > macro only would be something like M-:, which would be crazy. Why = don't > you just define a command and bind it to a key? Well... I was trying to gently steer you to the errors of your ways but you seem to be missing the light. First, you missed the point that I was using grep. Instead you said I should be using a synchronous process. You missed that I wasn't writing the code that started the process but using a pre-existing and commonly used routine. Thus, I could not reach in and change from async to sync. I had to ask that on a follow up question (which was trying to gently get you to discover that you had not suggested anything useful). It appeared to me as if you had not read my original post. I hoped, perhaps, you would go back and re-read it. You definitely seem to have missed the complexity of what I had accomplished. The second problem is, ok.... suppose I write a sentinels and it will = tell me when the process is done... Now what do I do? I write a wrapper that does nothing until that sentinel tells me its ok to proceed. You = have only added another layer and accomplished nothing. According to (info "(elisp)Sentinels"), the best way to do nothing is accept-process-output -- which is what I had and is also really the only key question. That should have clued you in. But no, you still keep coming. So... So... third: it is fairly common (for me) to do M-: (translated from = :) inside a macro and put in some lisp code to set variables or do whatever you need. It may not be neat and tidy but it gets the job done. I did write a small glue function in *scratch* but that is mostly beside the point. In the keyboard function, I used straight lisp. Happens all the time. So, lets review: my original post wasn't asking for help on how to do it = -- I had already accomplished what I wanted to do. I was asking if there was a better way. You offered a rather stern judgement but still have not offered a better way. None of these things appears to have occurred to you. Hope this helps pedz