From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: =?UTF-8?Q?Cl=c3=a9ment_Pit--Claudel?= Newsgroups: gmane.emacs.devel Subject: Re: Autoloads and subdirectories Date: Sat, 28 May 2016 14:47:37 -0400 Message-ID: <5749E7C9.3030300@gmail.com> References: <57491DA5.4020002@gmail.com> <57492904.7050603@gmail.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="WfrTSBnqeDDbD8AbqCgOf0KEK2xiB0xoT" X-Trace: ger.gmane.org 1464461299 7272 80.91.229.3 (28 May 2016 18:48:19 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 28 May 2016 18:48:19 +0000 (UTC) Cc: Stefan Monnier To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat May 28 20:48:08 2016 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 1b6jHL-0007e5-9p for ged-emacs-devel@m.gmane.org; Sat, 28 May 2016 20:48:07 +0200 Original-Received: from localhost ([::1]:53947 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b6jHK-0003Bx-Fm for ged-emacs-devel@m.gmane.org; Sat, 28 May 2016 14:48:06 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:55869) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b6jHE-0003Ba-G3 for emacs-devel@gnu.org; Sat, 28 May 2016 14:48:01 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b6jHA-0007Vw-43 for emacs-devel@gnu.org; Sat, 28 May 2016 14:47:59 -0400 Original-Received: from mout.kundenserver.de ([217.72.192.73]:58894) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b6jH9-0007Vs-Pc for emacs-devel@gnu.org; Sat, 28 May 2016 14:47:56 -0400 Original-Received: from [18.189.83.142] ([18.189.83.142]) by mrelayeu.kundenserver.de (mreue102) with ESMTPSA (Nemesis) id 0MAvQq-1bGae32Pqu-009xCz; Sat, 28 May 2016 20:47:51 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.8.0 In-Reply-To: X-Provags-ID: V03:K0:4bKvTkEdE3IFgqKtqtOvUUwmaqNHq9S4Qvt17mqzwOfFudcdfsP 4UaL+4p4mbyqF1Y09kHDhh/dqPdeFgqkXB8uOATIHXT6dLObqbo6ylgf385XzEv5wu8mMdl V7lEozidosGsEPz7IvmamfuhgPw0w0vMkvYQDIR8SDwd8Q4z1XAHZCYNKFLL2pHiMObtgRl 89/pNlDLr1BSZ9H6h67OQ== X-UI-Out-Filterresults: notjunk:1;V01:K0:U/LrT4uXs4I=:/K9iPFmuJA/v6GVbsMAteT OOM1PK4BMHKuf/Je5yddA/wRegea+MpC7soCJMXTYYi4l3ZiVAEFLfy93qHSABQJN87i+p4mS fMEsuW9obZH7p/Jy4JU8rVkGz2Z/LKbcClGj0TeYFnxg0Z0iARgH5kDiLxDJxN8MGDv3Lqzc9 c+svL5tP4YEZ1maVV/RY1zDYSJfIKwnaoKVlsNjgVYLxWDs4JNl8EKZNShCMpvnbXARyRpZav KfInph6+2hlYaKVJ2JPnlfPEJnx4yiiC5uYcbTqft8KtH/UfBmYt7i0HhmdhkFuzgfUv9qHCQ iox3LROaC14lg4cwmHMtP/21rJcLVKMWsMv6DKypu7329acx4471uh3hjOzLDl271P1HWW8Nh 5WCdEEBbCS7SMCv6Y+cRghUbL5HX6NrIIDKBXQqe2d2SVccujS5f8Qw1UoBep7kuV+1sfkcCU bG2K3ZkWdnd1L3TJ+XXstJ0XOI1Op7IlxVwa57p24Wou+Ro1TkJ/tUA2GLSsXDLfSiI8UZGl/ sihBsguT6I3ptREuvtge2QC7bU0jv2Q9gWFguY/c0HdrW4QfNXywk8KlqF41MNiObHynzoz+I oj61JyqHgihiK7LzDyyMP+uTgRYUJIqVVjJ8dzKNkc8ct/8lJb/o+rCw4YrWgi/XmByxCemo+ aN4YfQp2aLFN/in14ZSFJFW5V+ek+tiJqgZbhndeg3jby0czcRpxfRCUdYRyKd7rLgtLcSwBb Xr0/O6ADpEWxbyiK X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 217.72.192.73 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 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" Xref: news.gmane.org gmane.emacs.devel:204115 Archived-At: This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --WfrTSBnqeDDbD8AbqCgOf0KEK2xiB0xoT Content-Type: multipart/mixed; boundary="6JFFPshS9SjnwIKsHId6tFKddMjW160sr" From: =?UTF-8?Q?Cl=c3=a9ment_Pit--Claudel?= To: emacs-devel@gnu.org Cc: Stefan Monnier Message-ID: <5749E7C9.3030300@gmail.com> Subject: Re: Autoloads and subdirectories References: <57491DA5.4020002@gmail.com> <57492904.7050603@gmail.com> In-Reply-To: --6JFFPshS9SjnwIKsHId6tFKddMjW160sr Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable On 2016-05-28 14:18, Stefan Monnier wrote: >> be broken by future upstream fixes. One such solution is to statically= >> generate my autoloads (using code similar to the one you posted) and s= hip >> these as part of my package, while adding an autoloaded form to a new = file >> in my content directory that just loads the additional autoloads file = that >> I ship. This isn't very pretty, though. >=20 > The other option is to split your package into several packages. Interesting, thanks Stefan! The context in which this comes up is =91real= gud=92, a rewrite of gud that supports about 15 debuggers out of the box.= I don't think it would be too great to split this into 15 packages. I think I'll push an implementation of my suggestion above. I included a = draft below; I'd be very happy to hear comments about it :) IOW, assuming= I manually generate autoloads using the following snippet: (defun realgud-refresh-subdirectory-autoloads () "Update subdirectory-autoloads.el. This is needed because the package.el infrastructure doesn't process autoloads in subdirectories; instead we create an additional autoloads file of our own, and we load it from an autoloaded form." (interactive) (let ((generated-autoload-file (expand-file-name realgud-subdir-autoloads-name realgud-cont= ent-dir))) (when (file-exists-p generated-autoload-file) (delete-file generated-autoload-file)) (dolist (name (directory-files-recursively realgud-content-dir ""= t)) (when (file-directory-p name) (update-directory-autoloads name))))) Then would it be enough to put the following in a file that lives in the = package's root directory? ;;;###autoload (defconst realgud-subdir-autoloads-name "subdirectory-autoloads.el") ;;;###autoload (defconst realgud-content-dir (file-name-directory (or (and load-in-progress load-file-name) (bound-and-true-p byte-compile-current-file) buffer-file-name))) ;;;###autoload (with-demoted-errors "Error loading autoloads: %s" (load (expand-file-name realgud-subdir-autoloads-name realgud-conte= nt-dir) t t)) (btw, is there a more concise way of writing realgud-content-directory?) Thanks! Cl=E9ment. --6JFFPshS9SjnwIKsHId6tFKddMjW160sr-- --WfrTSBnqeDDbD8AbqCgOf0KEK2xiB0xoT Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (GNU/Linux) iQIcBAEBAgAGBQJXSefPAAoJEPqg+cTm90wjbKIQAKAuxfJcPcYA3u+9vs8KVsZv jrWfptBSYkj1r5lCz4w9X3Jl7oiYR3H+ACnruX+sFK4/YptUAWAAGICjtQ/lzwza CNZkVbopDBtd/w3PLrC9KRmcCP0Letm6WmmA/YogPqtrR4XFShSWTjEHNEjBz94W 5hyDNcG/C4AEl7wHIT2Eiz4ReD6Q/sUsZEBSyQGVe2YPdGU9E6WiBL8w3jkZZ2v4 uSCd5NFnRq8MzmyahMsdXxQMNGTkqOP+MiOGGPpGUjnOfdjhK5uBb1QLglQAKL2l aHhh/yme6UC0i/k9O/sOnJZIEds4dnDeiKX0NQ26NKZ6vOhbQO2jc9NJM3omzPZd 1ihc+69qUTHSssnoZPhfAdBFYSHYQ7UMZGLMKoUcLGua/lD1WiN7afObsmhheOZv k0dS7UcTLVlEZLbkC6bWS3+82IUMgeFl+AvAwcnAfOn1Ud2a7Yy1pxJY62jvww6W CQEH2MzyxH0fYr+PLVRu3cf24f9O9PhAwVtC+qMY1V6iibElrVTnJgl2yVbLKdqo Bk7x6bzmEhwb0buxooNHWCVklTEsAj7KYpxsiFhNsToCthXl6Dk9lZpDWcxtQ3Iv Yr35KqPRAcgaKY7Kkgx2PkreE1WzU+/W1IXRSPA1NegLbGMNID1WbQDesLqpoHFy 5ir5CniUmHm0GfkFSggd =sJSH -----END PGP SIGNATURE----- --WfrTSBnqeDDbD8AbqCgOf0KEK2xiB0xoT--