From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Joris Vankerschaver Newsgroups: gmane.emacs.help Subject: Re: Wrapping an Emacs dynamic module in a package Date: Mon, 17 Oct 2016 09:34:25 +0100 Message-ID: References: <83h98bzfo5.fsf@gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Trace: blaine.gmane.org 1476693328 2794 195.159.176.226 (17 Oct 2016 08:35:28 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 17 Oct 2016 08:35:28 +0000 (UTC) Cc: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon Oct 17 10:35:22 2016 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bw3O4-00079m-6q for geh-help-gnu-emacs@m.gmane.org; Mon, 17 Oct 2016 10:35:12 +0200 Original-Received: from localhost ([::1]:59820 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bw3O6-00061z-8s for geh-help-gnu-emacs@m.gmane.org; Mon, 17 Oct 2016 04:35:14 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:34192) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bw3NM-00060z-Lt for help-gnu-emacs@gnu.org; Mon, 17 Oct 2016 04:34:29 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bw3NL-0005eC-Fw for help-gnu-emacs@gnu.org; Mon, 17 Oct 2016 04:34:28 -0400 Original-Received: from mail-qt0-x234.google.com ([2607:f8b0:400d:c0d::234]:33177) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1bw3NL-0005e6-AK for help-gnu-emacs@gnu.org; Mon, 17 Oct 2016 04:34:27 -0400 Original-Received: by mail-qt0-x234.google.com with SMTP id s49so109066446qta.0 for ; Mon, 17 Oct 2016 01:34:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:cc; bh=CWr4VjN/7097U/9/6NmkyORI/+Voe8DQ2ypSagb++1I=; b=mieVHPiQxLUmFX/nYL8OwiODJBJXqF43JhJ/ZnCG81qiTEtb8AzN75tIcmT+R2eJDp M0mR7Bxb4OLBlA6g7p3J6xxrdXGaYTu4YfKd+OPoTwIG7C+Bb02Y8rTyWeo4DTCR7Yng bxKSJOYDqjRmtY2ttesTO1FBhoS0OKDeynopJT6cfTLVButHd1Y1EWnNKvnF0X2qDhnL eRRunDNlVtKjYE54Rg/cxx50t4Uj4r+EOpKJBFgMcEgLVhQDY7LveODWp1I33zscV9Bl 9hhSKLWi0GVgft2bb3+PdH+xSezARHrxNeZzLxGZDtb9E8eEOtk+2rAdJgwDNX7RwtIk LcBQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:cc; bh=CWr4VjN/7097U/9/6NmkyORI/+Voe8DQ2ypSagb++1I=; b=g5Mmhfuph9ePrZPdJ1IrIWMB8BQYDKZLks7H/4tZYL8f2uJlwSuE5A4lkQz14dh7M2 XmPflw0ZG+gyCwVUGWqBaPHgTVSFLRPJuuZS1S7VmKAQInx2IKQcYHLnfY/u7PqK1DRu zNChbhhqdTf6QRo06kLGCJKt1ftWPblPb7f8LwyOdBSHRi0Se8145z3MNh+jjq19c7Oz 4VpKSCGP247vvNdvCksKvTdB/vSg4MKMlg0lpLXEZP6oMN+Tv/zz9SmKl5s4q81sROw3 QsVzrrwh8qz/zTxob/+QrWJiFo1b7s9gLfGCAm9oGiJottb8cJ4mNK6VrDX+89jJ1SCj dGdw== X-Gm-Message-State: AA6/9RmwPqxVpoxSzk2MG7G5jv+Hq3P2Vv6vWv24DDumgvMGpZD420Fm6L2WUpAp48EkMGnrYVCBhL5R7ltLvw== X-Received: by 10.28.168.87 with SMTP id r84mr8005604wme.19.1476693266373; Mon, 17 Oct 2016 01:34:26 -0700 (PDT) Original-Received: by 10.80.177.59 with HTTP; Mon, 17 Oct 2016 01:34:25 -0700 (PDT) In-Reply-To: <83h98bzfo5.fsf@gnu.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2607:f8b0:400d:c0d::234 X-Content-Filtered-By: Mailman/MimeDel 2.1.21 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.21 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" Xref: news.gmane.org gmane.emacs.help:111544 Archived-At: Hi Eli, Sorry, I should have been more specific. Here's what I did: 1) I wrote an emacs module _mymod.so, as well as wrappers mymod.el (with some local setup) and mymod-pkg.el (which only has a call to define-package). 2) I tarred these together to form mymod-0.1.tar 3) I installed the resulting package using M-x package-install-file In my messages buffer, I see that Emacs tries to generate autoloads for the .so, and fails with the error indicated in the original email ("_mymod.so:0:0: error: scan-error: (Containing expression ends prematurely 238020 238021))"). I'm pretty confident that the emacs module is correctly built (I can load it, and run the functions in it). Also, if I rename _mymod.so to something else, e.g. _mymod.blablabla, the rest of the package installs correctly and can be loaded. So it really seems as if Emacs is choking on trying to generate autoloads for _mymod.so. Maybe backtracking a little bit: 1) Should Emacs be able to generate autoloads for an .so? 2) Does anybody have any experience with embedding an emacs module in an emacs package? Any best practices I should be aware of? Thanks, Joris. On Mon, Oct 17, 2016 at 6:51 AM, Eli Zaretskii wrote: > > From: Joris Vankerschaver > > Date: Sun, 16 Oct 2016 18:37:54 +0100 > > > > I have an emacs dynamic module that I would like install as part of a > > multi-file package. That is, I have a shared object file _mymod.so, and > > some Elisp wrappers mymod-pkg.el and mymod.el that do various bits of > > initialization. > > > > When Emacs installs my package, things go wrong when generating the > > autoloads for _mymod.so. I get a > > > > (error "_mymod.so:0:0: error: scan-error: (Containing expression ends > > prematurely 238020 238021)) > > > > This happens during autoload-generate-file-autoloads for _mymod.so. > > What do you mean by "Emacs installs", and why does that cause Emacs to > try to generate autoloads for _mymod.so? > >