From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: async.el: A simple asynchronous framework for Emacs Date: Tue, 19 Jun 2012 17:46:15 -0400 Message-ID: References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1340142386 15752 80.91.229.3 (19 Jun 2012 21:46:26 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Tue, 19 Jun 2012 21:46:26 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Jun 19 23:46:24 2012 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Sh6Fi-0006pM-2l for ged-emacs-devel@m.gmane.org; Tue, 19 Jun 2012 23:46:22 +0200 Original-Received: from localhost ([::1]:46897 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Sh6Fi-0001jD-47 for ged-emacs-devel@m.gmane.org; Tue, 19 Jun 2012 17:46:22 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:50830) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Sh6Ff-0001iT-Kc for emacs-devel@gnu.org; Tue, 19 Jun 2012 17:46:20 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Sh6Fd-00043u-Ta for emacs-devel@gnu.org; Tue, 19 Jun 2012 17:46:19 -0400 Original-Received: from pruche.dit.umontreal.ca ([132.204.246.22]:41723) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Sh6Fd-00043b-PR for emacs-devel@gnu.org; Tue, 19 Jun 2012 17:46:17 -0400 Original-Received: from pastel.home (lechon.iro.umontreal.ca [132.204.27.242]) by pruche.dit.umontreal.ca (8.14.1/8.14.1) with ESMTP id q5JLkGJD006651; Tue, 19 Jun 2012 17:46:16 -0400 Original-Received: by pastel.home (Postfix, from userid 20848) id 36AD3592CA; Tue, 19 Jun 2012 17:46:15 -0400 (EDT) In-Reply-To: (John Wiegley's message of "Tue, 19 Jun 2012 15:44:28 -0500") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.1.50 (gnu/linux) X-NAI-Spam-Flag: NO X-NAI-Spam-Threshold: 5 X-NAI-Spam-Score: 0 X-NAI-Spam-Rules: 1 Rules triggered RV4255=0 X-NAI-Spam-Version: 2.2.0.9309 : core <4255> : streams <770628> : uri <1143767> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 132.204.246.22 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:151036 Archived-At: >>> This will execute the lambda (which must *not* be byte-compiled -- in other >>> words, don't use `function' or #') in a child Emacs asynchronously. >> Can you explain why it can't be byte-compiled? > Because it becomes an un-`read'-able value if prin1'd. The byte-compiler uses prin1 to generate the .elc files, so I'm pretty sure there's a way to solve this problem ;-) >> Also, I'd guess that your package could be improved if Emacs provided >> a `fork' primitive, right? > You bet. However, I would almost never want to fork the whole > environment. I would want the child to end up with nil values for: > timer-list > timer-idle-list > kill-emacs-hook Yes, it can't just be a naive call to `fork' because it also has to forget about all the frames and sub-processes. Also `fork' is probably unavailable under Windows, so the Elisp functionality should work both with and without `fork' (i.e. we can't rely too much on `fork's semantics, we can only use it to improve performance or save us the trouble of "finding the same `emacs' executable in $PATH"). Stefan