From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: Callbacks from modules Date: Thu, 26 Nov 2015 20:41:00 +0200 Message-ID: <83vb8otxhf.fsf@gnu.org> References: Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1448563304 20557 80.91.229.3 (26 Nov 2015 18:41:44 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 26 Nov 2015 18:41:44 +0000 (UTC) Cc: darthandrus@gmail.com, dancol@dancol.org, emacs-devel@gnu.org To: Philipp Stephani Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Nov 26 19:41:33 2015 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 1a21U3-00086Z-54 for ged-emacs-devel@m.gmane.org; Thu, 26 Nov 2015 19:41:31 +0100 Original-Received: from localhost ([::1]:52782 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a21U5-00072q-EH for ged-emacs-devel@m.gmane.org; Thu, 26 Nov 2015 13:41:33 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:48045) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a21Ts-00071i-Uu for emacs-devel@gnu.org; Thu, 26 Nov 2015 13:41:21 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a21Tp-0002Gj-PB for emacs-devel@gnu.org; Thu, 26 Nov 2015 13:41:20 -0500 Original-Received: from mtaout20.012.net.il ([80.179.55.166]:62103) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a21Tp-0002GX-HQ for emacs-devel@gnu.org; Thu, 26 Nov 2015 13:41:17 -0500 Original-Received: from conversion-daemon.a-mtaout20.012.net.il by a-mtaout20.012.net.il (HyperSendmail v2007.08) id <0NYF00900Q60EV00@a-mtaout20.012.net.il> for emacs-devel@gnu.org; Thu, 26 Nov 2015 20:41:16 +0200 (IST) Original-Received: from HOME-C4E4A596F7 ([84.94.185.246]) by a-mtaout20.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0NYF0091GQKR7KA0@a-mtaout20.012.net.il>; Thu, 26 Nov 2015 20:41:16 +0200 (IST) In-reply-to: X-012-Sender: halo1@inter.net.il X-detected-operating-system: by eggs.gnu.org: Solaris 10 X-Received-From: 80.179.55.166 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:195308 Archived-At: > From: Philipp Stephani > Date: Thu, 26 Nov 2015 18:16:13 +0000 > Cc: Eli Zaretskii , Daniel Colascione > > There are two major issues with allowing callbacks at arbitrary times, which > need to be discussed and resolved first. The first is that such a facility > would change the execution model of Emacs in a quite fundamental way. Right now > all user-defined code inside the Emacs process gets run through a path under > the control of Emacs, either as a response to an input event, or a timer, or a > process filter etc. Adding a facility to run module code from arbitrary > callbacks would remove this invariant, which can have global effects on Emacs. I don't even understand what is meant by "arbitrary callbacks". If they are called in the context of a separate thread, we will not allow them to run. IOW, such arbitrary callbacks need to run in the C land, and communicate with Lisp via timers. In the future, we might add facilities that would allow a module register a file descriptor through which events could flow into the Emacs event queue. But that is not yet available, and I'm not sure we'd want to allow it.