From mboxrd@z Thu Jan 1 00:00:00 1970 Received: by 10.52.109.137 with SMTP id hs9cs122780vdb; Mon, 4 Apr 2011 22:01:03 -0700 (PDT) Received: by 10.229.135.82 with SMTP id m18mr6511949qct.82.1301979663294; Mon, 04 Apr 2011 22:01:03 -0700 (PDT) Return-Path: Received: from rubyforge.org (rubyforge.org [205.234.109.19]) by mx.google.com with ESMTP id f7si11867359qcq.25.2011.04.04.22.01.02; Mon, 04 Apr 2011 22:01:02 -0700 (PDT) Received-SPF: pass (google.com: domain of sup-devel-bounces@rubyforge.org designates 205.234.109.19 as permitted sender) client-ip=205.234.109.19; Authentication-Results: mx.google.com; spf=pass (google.com: domain of sup-devel-bounces@rubyforge.org designates 205.234.109.19 as permitted sender) smtp.mail=sup-devel-bounces@rubyforge.org Received: from rubyforge.org (rubyforge.org [127.0.0.1]) by rubyforge.org (Postfix) with ESMTP id 9894718583A2; Tue, 5 Apr 2011 01:01:01 -0400 (EDT) Received: from steel.pruts.nl (pruts.nl [82.94.235.106]) by rubyforge.org (Postfix) with ESMTP id 198CF185837F for ; Tue, 5 Apr 2011 00:38:08 -0400 (EDT) Received: from localhost (localhost.localdomain [127.0.0.1]) by steel.pruts.nl (Postfix) with ESMTP id 21DFDE20B6; Tue, 5 Apr 2011 06:38:08 +0200 (CEST) X-Virus-Scanned: amavisd-new at pruts.nl Received: from steel.pruts.nl ([127.0.0.1]) by localhost (steel.local [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id I9JPClDZSoRZ; Tue, 5 Apr 2011 06:38:06 +0200 (CEST) Received: by steel.pruts.nl (Postfix, from userid 1000) id 2B934E20BA; Tue, 5 Apr 2011 06:38:06 +0200 (CEST) From: Ico Doornekamp To: Hamish In-reply-to: <1301957971-sup-1165@whisper> References: <1298239068-sup-6985@whisper> <1298747943-sup-9749@whisper> <1298768518-sup-4041@alvh.no-ip.org> <1298774629-sup-4062@medusa> <1298819507-sup-8138@pruts.nl> <1298826314-sup-276@whisper> <1298833983-sup-4830@pruts.nl> <1301957971-sup-1165@whisper> Date: Tue, 05 Apr 2011 06:38:06 +0200 Message-Id: <1301977961-sup-9660@pruts.nl> User-Agent: Sup/git Cc: sup-devel Subject: Re: [sup-devel] editing messages outside of sup X-BeenThere: sup-devel@rubyforge.org X-Mailman-Version: 2.1.12 Precedence: list Reply-To: Sup developer discussion List-Id: Sup developer discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: sup-devel-bounces@rubyforge.org Errors-To: sup-devel-bounces@rubyforge.org * On Tue Apr 05 01:01:18 +0200 2011, Hamish wrote: > > When the infrastructure for background-editor hooks is there, I'm ready > > to try to make the hook! > > OK, I've pushed a change to allow hooks for this functionality. For now > it is just on the async_message_edit branch (in the main gitorious > repo). > > To quote from the hook text: > > Runs when 'H' is pressed in async edit mode. You can run whatever code > you want here - though the default case would be launching a text > editor. Your hook is assumed to not block, so you should use exec() or > fork() to launch the editor. > > Once the hook has returned then sup will be responsive as usual. You will > still need to press 'E' to exit this buffer and send the message. Sounds very useful to me! > The next step would be to have the async mode exit as soon as the forked > hook code has finished. The best way I've thought of to do this is to > trap SIGUSR1. As long as there was only one async mode active this would > work fine, but if there were two there would be trouble. I guess I could > add a return value to the hook about whether to pay attention to > SIGUSR1. Then the BufferManager could know which buffer was waiting for > SIGUSR1. If a second buffer called the same hook while the first was > still waiting for the signal, then it should refuse to honour it. It > does feel a bit messy ... I might have a go at it at some point, but if > anyone has other ideas, then please shout out. I might have understood the details of your implementation wrong, but why would it not just be possible to act on a SIGCHLD and use wait() to retreive the pid and exitstatus of the finished process ? The pid would distinguish the different async handlers, resolving the ambiguity ? Thanks! -- :wq ^X^Cy^K^X^C^C^C^C _______________________________________________ Sup-devel mailing list Sup-devel@rubyforge.org http://rubyforge.org/mailman/listinfo/sup-devel