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: Dynamic loading progress Date: Sun, 13 Sep 2015 09:14:32 -0400 Message-ID: References: <54F789B2.6030105@dancol.org> <87egnel6ac.fsf@lifelogs.com> <87vbgpk1po.fsf@lifelogs.com> <85mw20gmeo.fsf@stephe-leake.org> <878u97nyjn.fsf@lifelogs.com> <86d1yirnqw.fsf@stephe-leake.org> <87si7977rs.fsf@tromey.com> <55DB7C3D.4090106@cs.ucla.edu> <55DE75FD.8020308@cs.ucla.edu> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1442150092 20204 80.91.229.3 (13 Sep 2015 13:14:52 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 13 Sep 2015 13:14:52 +0000 (UTC) Cc: Stephen Leake , Emacs development discussions , Paul Eggert , Tom Tromey , Daniel Colascione To: =?windows-1252?Q?Aur=E9lien?= Aptel Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Sep 13 15:14:43 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 1Zb77A-0000DK-Ui for ged-emacs-devel@m.gmane.org; Sun, 13 Sep 2015 15:14:41 +0200 Original-Received: from localhost ([::1]:35862 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zb77A-00045B-Jz for ged-emacs-devel@m.gmane.org; Sun, 13 Sep 2015 09:14:40 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:43755) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zb777-00044z-Gb for emacs-devel@gnu.org; Sun, 13 Sep 2015 09:14:38 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Zb774-0006en-2K for emacs-devel@gnu.org; Sun, 13 Sep 2015 09:14:37 -0400 Original-Received: from ironport2-out.teksavvy.com ([206.248.154.181]:1142) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zb773-0006eZ-Tx for emacs-devel@gnu.org; Sun, 13 Sep 2015 09:14:33 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A0CtCwA731xV/0jo92hcgxCEAsEMCYdLBAICgTw5FAEBAQEBAQGBCkEFg10BAQMBViMFCws0EhQYDSSINwjPIwEBAQcCAR+LOoUFB4QtAQSfF5IUg1kjgWaCLiKCeAEBAQ X-IPAS-Result: A0CtCwA731xV/0jo92hcgxCEAsEMCYdLBAICgTw5FAEBAQEBAQGBCkEFg10BAQMBViMFCws0EhQYDSSINwjPIwEBAQcCAR+LOoUFB4QtAQSfF5IUg1kjgWaCLiKCeAEBAQ X-IronPort-AV: E=Sophos;i="5.13,465,1427774400"; d="scan'208";a="164706836" Original-Received: from 104-247-232-72.cpe.teksavvy.com (HELO fmsmemgm.homelinux.net) ([104.247.232.72]) by ironport2-out.teksavvy.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 13 Sep 2015 09:14:33 -0400 Original-Received: by fmsmemgm.homelinux.net (Postfix, from userid 20848) id CF128AE124; Sun, 13 Sep 2015 09:14:32 -0400 (EDT) In-Reply-To: (=?windows-1252?Q?=22Aur=E9lien?= Aptel"'s message of "Sun, 13 Sep 2015 01:11:45 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 206.248.154.181 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:189887 Archived-At: > The case where a module calls an emacs function that ends up calling > signal/error. OK, what are you worried about w.r.t that case? > I don't know enough about how signaling and unwind-protect work. It's > just black stack magic for me right now :) Fsignal works using longjmp. unwind-protect (and dynamic let-bindings) works by adding things onto a stack which Fsignal will run just prior to calling longjmp. > I think we just need to implement funcall (from the module API) like this: > global error = 0 > module_funcall(fun, args): > // wrap (protect?) this with the right code > // - to keep the control > // - set ret to nil and error to 1 in case of error > ret = Ffuncall(fun, args) > return ret > The error is accessible via error_get(), error_clear() and > error_check() in the module API. error_get() is currently redundant > with error_check() unless we decide to return detailed errors. I don't understand what kind of error handling you have in mind. How/why/when would we use things like error_get, error_clear, etc...? > I didn't think about the case where a module calls Fthrow but my guess > is it will just work. I have to test thoroughly what I have already > anyway, I'll see if it works. Fthrow uses the same technique as Fsignal, and I think your intuition is right: it should just work (for both). Stefan