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 01:13:40 -0400 Message-ID: <57492904.7050603@gmail.com> References: <57491DA5.4020002@gmail.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="G0Fq9owDtKg467AOwSg6Hn2ieH5fksxj6" X-Trace: ger.gmane.org 1464412445 1234 80.91.229.3 (28 May 2016 05:14:05 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 28 May 2016 05:14:05 +0000 (UTC) Cc: Emacs developers To: Robert Weiner Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat May 28 07:13:56 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 1b6WZQ-0004Lj-7Z for ged-emacs-devel@m.gmane.org; Sat, 28 May 2016 07:13:56 +0200 Original-Received: from localhost ([::1]:51427 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b6WZP-0005M2-4A for ged-emacs-devel@m.gmane.org; Sat, 28 May 2016 01:13:55 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:53569) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b6WZI-0005LO-CW for emacs-devel@gnu.org; Sat, 28 May 2016 01:13:49 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b6WZE-0004aU-5G for emacs-devel@gnu.org; Sat, 28 May 2016 01:13:47 -0400 Original-Received: from mout.kundenserver.de ([212.227.126.134]:63016) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b6WZD-0004aO-Qt for emacs-devel@gnu.org; Sat, 28 May 2016 01:13:44 -0400 Original-Received: from [18.189.83.142] ([18.189.83.142]) by mrelayeu.kundenserver.de (mreue003) with ESMTPSA (Nemesis) id 0MM2UC-1b9pxS1EnE-007hop; Sat, 28 May 2016 07:13:42 +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:4EkgLK2jEggG3/A+qCTyckEok+Q+/u0HwIZQExzTQUCOt+AS300 PQm0vZf1AluY5tydHAkzm3Eoab/huV9bO0Ol+B+QwqmQXxk8bPJAlkYn0umOUAetMTqiG/2 6jmAFDM1R4biJuKRS7oMU/cMqrRy6tgsd7aF8W0yGy87GnkWR5fTiW0QhmUq+vnAlH3OI5s pGzYWmk3ctAKo8s3l9HjA== X-UI-Out-Filterresults: notjunk:1;V01:K0:5op+dQEfrIo=:RqnpkckEBRikAKW8r3SNFZ v+oey81ccT+5MhycJAcAJgdVzkpN6RPayKbeR7O+baxv3AgLHC7LtD1QCbkqfte75+VMCXlcc TN4I7n9hfWO9fIbeIokST7GJcC73In5YgI9RoFABTAFbA1sM+j3bfDQ4q70P3x2XLps6gb7tD uq79qePUeMNP8fZNu6s4TwcTrbkGCI9rE8qtjSMaz0V4g7A37cOdGF86OzsEy2G2xieJW/3fh vVLxvxSLAdkTuKLEKE6gTm8ljznFFapOtTFxfhZJElmfetNgnuKduhmY95iVZtTUlxKuBaOKb RVWfCc6VWmD1aDOU7cSsi1b1Sy2XJeWrHb51F1x9spQO3F9UWNmdtGCXtQx9Jcx0AMm17hSIi 46lMfPj8W+UhCj944HVJGAb27tDJhk7utrr2C0116XHHB8DxknARGDVn8QXrWw1eAazebzHYw hV/0vl9cyqAUBnYIeeDmEPsbOMIyc5jbohOX5snPnqwgT1/YI8ONyd1cUd059fb4U5DtKtwsj rxZDz261CNq3VRE2TYhonSVlY7AF1JOKBuuFXUlFJLDCxAiuweWmD8wVU46+JYMomZkEAPiOG fEJ8+Pco/7mUm28EO25fQK2vXncf0DYmtlHlFBD97xCkJvdYfdkHesaUAlLvpOhfkzwAd6zpG 22FBvM9qtR2lorRpifPV9YaOZ1Ur/2o0AjDWgY/AkioSSeGayAfrOwBuvfZqXtFHxWNSBfNDp YzniZRZEu1HUwX8a X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 212.227.126.134 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:204100 Archived-At: This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --G0Fq9owDtKg467AOwSg6Hn2ieH5fksxj6 Content-Type: multipart/mixed; boundary="1hNnWIwNHp0oGX8rOSKlFgIxjm1LJNNPT" From: =?UTF-8?Q?Cl=c3=a9ment_Pit--Claudel?= To: Robert Weiner Cc: Emacs developers Message-ID: <57492904.7050603@gmail.com> Subject: Re: Autoloads and subdirectories References: <57491DA5.4020002@gmail.com> In-Reply-To: --1hNnWIwNHp0oGX8rOSKlFgIxjm1LJNNPT Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 2016-05-28 01:00, Robert Weiner wrote: > You missed my message and solution for this 5 days back, so I have > included the solution here.=20 Indeed, I did miss it! Thanks for sharing it. > Just replace this one function in package.el in the lisp/emacs-lisp/ > subdirectory of your emacs installation. No one had any comments on > it surprisingly. I have added the patch file here as well. Let me > know how it goes for you. It looks like a neat patch. Small question: why do you only accept direct= ories that start with a letter? The regular expression that you pass to d= irectory files seems rather restrictive. That being said, this is no really the kind of answers that I'm looking f= or: applying this patch would fix the problem for future version of Emacs= , but I'd like to support current versions of Emacs too, and the upcoming= release as well. Ideally, I'd love a solution that works with current Emacsen, and that wo= n't be broken by future upstream fixes. One such solution is to staticall= y generate my autoloads (using code similar to the one you posted) and sh= ip 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 fil= e that I ship. This isn't very pretty, though. Thanks for your help! Cl=C3=A9ment. > (defun package-generate-autoloads (name pkg-dir) > (let* ((auto-name (format "%s-autoloads.el" name)) > ;;(ignore-name (concat name "-pkg.el")) > (generated-autoload-file (expand-file-name auto-name pkg-dir))= > ;; Silence `autoload-generate-file-autoloads'. > (noninteractive inhibit-message) > (backup-inhibited t) > (version-control 'never)) > (package-autoload-ensure-default-file generated-autoload-file) > (apply #'update-directory-autoloads pkg-dir > (delq nil (mapcar (lambda (f) (and (file-directory-p f) > (not (file-symlink-p f)) > f)) > (directory-files pkg-dir t "[a-zA-Z].*" nil)))) > (let ((buf (find-buffer-visiting generated-autoload-file))) > (when buf (kill-buffer buf))) > auto-name)) >=20 > ------- > *** package-orig.el2016-05-28 00:54:25.000000000 -0400 > --- package.el2016-05-28 00:54:25.000000000 -0400 > *************** > *** 916,928 **** > (backup-inhibited t) > (version-control 'never)) > (package-autoload-ensure-default-file generated-autoload-file) > ! (update-directory-autoloads pkg-dir) > (let ((buf (find-buffer-visiting generated-autoload-file))) > (when buf (kill-buffer buf))) > auto-name)) > =20 > (defun package--make-autoloads-and-stuff (pkg-desc pkg-dir) > "Generate autoloads, description file, etc.. for PKG-DESC installed = at PKG-DIR." > (package-generate-autoloads (package-desc-name pkg-desc) pkg-dir) > (let ((desc-file (expand-file-name (package--description-file pkg-d= ir) > pkg-dir))) > --- 911,927 ---- > (backup-inhibited t) > (version-control 'never)) > (package-autoload-ensure-default-file generated-autoload-file) > ! (apply #'update-directory-autoloads pkg-dir > ! (delq nil (mapcar (lambda (f) (and (file-directory-p f) > ! (not (file-symlink-p f)) > ! f)) > ! (directory-files pkg-dir t "[a-zA-Z].*" nil)))) > (let ((buf (find-buffer-visiting generated-autoload-file))) > (when buf (kill-buffer buf))) > auto-name)) > =20 > (defun package--make-autoloads-and-stuff (pkg-desc pkg-dir) > "Generate autoloads, description file, etc. for PKG-DESC installed a= t PKG-DIR." > (package-generate-autoloads (package-desc-name pkg-desc) pkg-dir) > (let ((desc-file (expand-file-name (package--description-file pkg-d= ir) > pkg-dir))) > *************** >=20 >=20 --1hNnWIwNHp0oGX8rOSKlFgIxjm1LJNNPT-- --G0Fq9owDtKg467AOwSg6Hn2ieH5fksxj6 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) iQIcBAEBAgAGBQJXSSkEAAoJEPqg+cTm90wjKHYP/2xdK8+wsgVeRpSmsMlq653Q VIZuoFNsIwrhhmvCEgZMMlRlNCCi3LfiNMONBPc0/V/LHwLAgi+Yz3neVkdDu7im Ge0zMFEhMaKTfwwRbDKRtzHlLG3jYZRFx9wqJoDdZMwozBv2xR82vvgNFbEcomLx 63Hzwys79HJKPVtFEAGF3XrjTJRNgMWNWkPCc9F8kDFz/8BRAMXlxq3TXwnrl4Fg ThKnx2bpyq5s810pMtrYcftRjPlFY7FlrckOQ6KZIwljKl0A+7idlc0IaV1eibrU DPfRPVU5gxsmMqpYIVmnTaT4KS1yCoqTDNNJou2gbZJr8Q+5nyIq9alW7/jl8h0I utwLhMwfs52ZCz/NPHcP8U6750efkz/nh5NVl+bKduC0UEOzyQXpPeScppJ92VcM 8IuU+H10XQr30qXqbURfW7eP+x3JR0d2xAOlwmRwSWYjzGD8fq6CE/pPQd9yDyCU A8P39J/IqEg96VPuiNHP1s2QoKDnWMA4r/louqVJ9IT6pSqX4WZMgpK9zIiaG28p 7eNmUPebAr3gOiBLk4PgqWujbZ7sy4DYmILsI+EiC/LVqK4txyWuIGGXxmUGAkd3 xgN4NUaAMqZ0meJGGmztPY64sGEF52/n/GJrWZ3SX/JvTQZguLJ0knGwMHqzpXUZ w3eDWrP71r1WFgC4DDlz =X4bJ -----END PGP SIGNATURE----- --G0Fq9owDtKg467AOwSg6Hn2ieH5fksxj6--