From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Philip Kaludercic Newsgroups: gmane.emacs.devel Subject: Re: feature/package+vc 04c4c578c7 3/4: Allow for packages to be installed directly from VCS Date: Thu, 17 Feb 2022 09:21:08 +0000 Message-ID: <87sfshn917.fsf@posteo.net> References: <164484721900.31751.1453162457552427931@vcs2.savannah.gnu.org> <20220214140020.04438C00891@vcs2.savannah.gnu.org> <87bkz9tbcj.fsf@posteo.net> <87o839ypx6.fsf@posteo.net> <87mtisnjcb.fsf@posteo.net> <87sfsizaub.fsf@posteo.net> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="13850"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Thu Feb 17 10:44:12 2022 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nKdKd-0003O0-5r for ged-emacs-devel@m.gmane-mx.org; Thu, 17 Feb 2022 10:44:11 +0100 Original-Received: from localhost ([::1]:36198 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nKdKb-0007h4-OQ for ged-emacs-devel@m.gmane-mx.org; Thu, 17 Feb 2022 04:44:09 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:33258) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nKcyS-0001um-OI for emacs-devel@gnu.org; Thu, 17 Feb 2022 04:21:17 -0500 Original-Received: from mout01.posteo.de ([185.67.36.65]:45257) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nKcyO-0001Yp-4G for emacs-devel@gnu.org; Thu, 17 Feb 2022 04:21:16 -0500 Original-Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id F2C19240028 for ; Thu, 17 Feb 2022 10:21:09 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1645089670; bh=hcjiZb3dIxHHOVqs9zMGJ3H40G6TyJlc6Aw9WqOiWYA=; h=From:To:Cc:Subject:Autocrypt:Date:From; b=h+wtCYvXMSs4xNFBfAb8thUIf70z1vbKLXi47RxRK7yyZCsLAWvMF29UTMOrzw0t+ 2Vx99arwIzsLncdtVfRtsKMrURojzU6GAf62udQN1vgTl1CON+hbxdW5YtQH6XP9BW oKZQVCpcMicy6IX6w/TYBWY4JazhExuxtxkd6eZlqDbrRnrGePuvn8ZeNVLLsf39UG mkbxr+wIU+B+Y+L2bE23SRzSK/6AtB9ws1C8ex30eA7QPqBLwm90ifMOUkUgqSc4ZK Twb6SHN4KWMmVlSttU8MG0WgirIwQ9dll/wpRCGKVUtgGyKqVQOh2siXjOypzC8qIB 7S0Blc5dEkg0g== Original-Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4Jzq7n293Rz9rxP; Thu, 17 Feb 2022 10:21:09 +0100 (CET) Autocrypt: addr=philipk@posteo.net; prefer-encrypt=nopreference; keydata= mDMEYHHqUhYJKwYBBAHaRw8BAQdAp3GdmYJ6tm5McweY6dEvIYIiry+Oz9rU4MH6NHWK0Ee0QlBo aWxpcCBLYWx1ZGVyY2ljIChnZW5lcmF0ZWQgYnkgYXV0b2NyeXB0LmVsKSA8cGhpbGlwa0Bwb3N0 ZW8ubmV0PoiQBBMWCAA4FiEEDM2H44ZoPt9Ms0eHtVrAHPRh1FwFAmBx6lICGwMFCwkIBwIGFQoJ CAsCBBYCAwECHgECF4AACgkQtVrAHPRh1FyTkgEAjlbGPxFchvMbxzAES3r8QLuZgCxeAXunM9gh io0ePtUBALVhh9G6wIoZhl0gUCbQpoN/UJHI08Gm1qDob5zDxnIHuDgEYHHqUhIKKwYBBAGXVQEF AQEHQNcRB+MUimTMqoxxMMUERpOR+Q4b1KgncDZkhrO2ql1tAwEIB4h4BBgWCAAgFiEEDM2H44Zo Pt9Ms0eHtVrAHPRh1FwFAmBx6lICGwwACgkQtVrAHPRh1Fw1JwD/Qo7kvtib8jy7puyWrSv0MeTS g8qIxgoRWJE/KKdkCLEA/jb9b9/g8nnX+UcwHf/4VfKsjExlnND3FrBviXUW6NcB In-Reply-To: (Stefan Monnier's message of "Wed, 16 Feb 2022 21:56:19 -0500") Received-SPF: pass client-ip=185.67.36.65; envelope-from=philipk@posteo.net; helo=mout01.posteo.de X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 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-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:286420 Archived-At: Stefan Monnier writes: >>>>> I'm sorry, I don't understand what you're saying here. Who&how does >>>>> "just clone a project into elpa/devel" and what do you mean by "elpa/devel"? >>>> >>>> What I meant was that all directories in ~/.emacs.d/elpa/devel could be >>>> automatically detected and loaded. >>> >>> That's already the case if `~/.emacs.d/elpa/devel` is in >>> `package-directory-list`, so I don't understand how that relates to what >>> we're discussing. >> >> Unless I am mistaken, `package--make-autoloads-and-stuff' is currently >> only invoked by `package-unpack', that in turn is only called by the >> `package-install-from-*' functions. Am I missing something, or how >> would the autoload file be generated if I just place a repository into >> ~/.emacs.d/elpa/devel? > > I don't think we should spend too much time trying to support the case > where a user only does `git clone` and expects Emacs to notice the new > package and set it up magically. Instead, I'd expect > `package-activate-all` to warn the user about a missing `-pkg.el` > when collecting the available packages and about a missing > `-autoloads.el` file when trying to activate a given package. > > Then the user can use some `package--refresh` or somesuch to > (re)create those files (and (re)compile the `.el` files along the way > and (re)generate the docs, ...). This seems reasonable, I will try to implement it in the next few days. >> Say a repository consists of only an init.el, and a few submoduled git >> repositories under /elpa/devel/. These wouldn't include the -pkg.el or >> -autoload.el files, so they should be generated as soon as necessary. > > Let those users write specific code for that if they so wish. > Generating the `-pkg.el` file as well as the `-autoloads.el` > cannot be done fully automatically in all cases. More specifically it > may require the package's spec to find the `:main-file` and other such > things. I don't think we should aim for that level of automation yet. My init.el begins with this blob that does the job well enough (it was also the basis for the site-lisp.el patch I proposed last year): --8<---------------cut here---------------start------------->8--- (eval-and-compile ;for flymake (require 'autoload) (let* ((backup-inhibited t) (dir (locate-user-emacs-file "site-lisp")) (load (expand-file-name "autoload.el" dir))) (dolist (dir (directory-files dir t "^[^.]")) (when (file-directory-p dir) (add-to-list 'load-path dir) (make-directory-autoloads dir load) (byte-recompile-directory dir))) (add-to-list 'load-path dir) (load load nil t) (kill-buffer (find-buffer-visiting load)))) --8<---------------cut here---------------end--------------->8--- So if I want to try some package out from source, all I need to do is clone the repository into ~/.emacs.d/site-lisp and everything else is done automatically when Emacs is restarted (or the snippet is evaluated). -- Philip Kaludercic