From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Thierry Volpiatto Newsgroups: gmane.emacs.devel Subject: Re: Changes to make in elpa-packages file for nongnu elpa Date: Wed, 16 Aug 2023 10:14:11 +0000 Message-ID: <87bkf7b7ls.fsf@posteo.net> References: <87r0oftgye.fsf@posteo.net> <87350vt1wz.fsf@posteo.net> <871qgen1ln.fsf@posteo.net> <87edke4mou.fsf@posteo.net> <87wmy6kuan.fsf@posteo.net> <87wmy6w070.fsf@posteo.net> <87zg2sjleg.fsf@posteo.net> <87pm3nlbm7.fsf@posteo.net> <87zg2ri9g9.fsf@posteo.net> Mime-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="9083"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: Thierry Volpiatto , Philip Kaludercic Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Wed Aug 16 12:33:27 2023 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 1qWDqB-00028y-Fh for ged-emacs-devel@m.gmane-mx.org; Wed, 16 Aug 2023 12:33:27 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qWDpS-000381-97; Wed, 16 Aug 2023 06:32:42 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qWDpR-00037q-5M for emacs-devel@gnu.org; Wed, 16 Aug 2023 06:32:41 -0400 Original-Received: from mout02.posteo.de ([185.67.36.66]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qWDpN-0005En-KP for emacs-devel@gnu.org; Wed, 16 Aug 2023 06:32:40 -0400 Original-Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id B33C8240101 for ; Wed, 16 Aug 2023 12:32:34 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1692181954; bh=03u1c071Ba4TV+UEebgCtGk15ILC+UvQb1vySt82/bI=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:From; b=JOzSr09Z2Qgbxg+o60qY8MdV8N0t0q97h5LP9n7QFdTdq0GJEDghvSSDPLBW/0CJ+ wjKyPep584k+x4k1jXdQRULLlm/80VIe4UndqNsN1FikpY9saLk4HGix7kuq09CdcH aWHYt2Ap6MpaUlMB3o4PLwRt8MqITnx3sj4OVzsf6NgEQ+K+XrnE3TUJSNJ4pNhd4e R8mpVAky/lBEEQ+8UD3grKWY9k619o8tS3P23wBsd75Um9T+7Qpn2uEwkRxTG8wWtB HGcQPXec+0/ZfviE3H0xpPT1ytcib/7HmfCtWM8k5x5NbjqzEiK4acF+79s2QrF8ns o5Nr/6gW1PgYQ== Original-Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4RQkwd5LZ1z6tvt; Wed, 16 Aug 2023 12:32:33 +0200 (CEST) In-reply-to: <87zg2ri9g9.fsf@posteo.net> Received-SPF: pass client-ip=185.67.36.66; envelope-from=thievol@posteo.net; helo=mout02.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, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 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-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:308806 Archived-At: --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Philip Kaludercic writes: > Thierry Volpiatto writes: > >> Philip Kaludercic writes: >> >>> Philip Kaludercic writes: >>> >>>>>>> It is used specially for reproducing bugs in a clean environment, s= ee it >>>>>>> as emacs -Q for Emacs when reporting bugs. This script starts Emacs= -Q >>>>>>> with only Helm loaded, this ensure the bug if one comes from Helm a= nd >>>>>>> not another package. This is important especially nowaday people are >>>>>>> using "Emacs distribution" with the world list of packages installe= d. >>>>>>> Apart that the script is useful to quickly launch Emacs with helm, = one >>>>>>> can use it from the Helm directory or symlinked to e.g. ~/bin.=20 >>>>>> >>>>>> I see. In that case is there any reason you implement this as a she= ll >>>>>> script? >>>>> >>>>> Well when I wrote the script, packages where not existing and from >>>>> outside emacs it is actually the only way to run a package isolated. >>>>> >>>>>> (It might be interesting to provide something like this for >>>>>> package.el, to test packages in a generic way.) >>>>> >>>>> Yes, this would be interesting, it would be something like this: >>>>> >>>>> Emacs -Q >>>>> M-x >>>> packages nuisances> >>>> >>>> I was actually thinking of a command like >>>> >>>> M-x package-isolate RET foo,bar,baz RET >>>> >>>> and a new instance of Emacs using -Q is spun up, with all the packages >>>> you have listed loaded, and nothing else... Sounds like a fun little >>>> weekend project ;^) >>> >>> Here is my first attempt at providing this kind of a command. Any >>> comments? >> >> Why not reusing package.el functions? >> Why do you want to start in an isolated elpa directory? >> Isn't something like this suffice? (just missing to fallback to CRM when >> helm is not available) > > I don't know much about Helm, but does it not support CRM? It does, but this is a much better interface than CRM. >> (defun package-isolate (packages) >> "Start an uncustomised Emacs and only load a set of PACKAGES." >> (interactive >> (list (let ((helm-comp-read-use-marked t)) >> (completing-read "Packages: " (mapcar #'car (package--ali= st)))))) > > This doesn't allow selecting specific package versions, in case multiple > are installed (which might easily happen if you use package-vc). I > stole the code in my patch from package-delete, and I guess it would be > possible to generalise it into a utility function. Ok, I don't know much how package-vc works. >> (let* ((name (concat "package-isolate-" (mapconcat #'identity >> packages ","))) > > This doesn't work, because the above returns a string, not a list of stri= ngs. No, it works, the above returns a list of strings (the completing-read allows marking and returns always a list). >> (deps (cl-loop for p in packages >> for sym =3D (intern p) >> append (package--dependencies sym)))) >> (apply #'start-process (concat "*" name "*") nil >> (list (file-truename (expand-file-name invocation-name in= vocation-directory)) >> "--quick" "--debug-init" >> (format "--eval=3D%S" >> `(progn >> (require 'warnings) >> (add-to-list 'warning-suppress-log-types = 'initialization) >> (require 'package) >> (setq package-load-list >> ',(append (mapcar (lambda (p) (list (int= ern p) t)) packages) >> (mapcar (lambda (p) (list p t)= ) deps))) >> (package-initialize))))))) > > This is actually a good idea, assuming there are no issues with lexical > scoping that might arise from --eval. I didn't think of using > package-load-list here, but it seems that this only works if we don't > add --init-directory, because otherwise the elpa/ directory is not > populated. Yes of course. > It seems to me, that for a proper isolated environment, we should add > a --init-directory option. Why as long as other directories in elpa are not in load-path? > This is easy to fix though, we just need to specify `package-user-dir' > at startup. Here is my updated patch, merging our approaches: > > [2. text/x-diff; 0001-Add-command-to-start-Emacs-with-specific-packages.p= atch]... > > >>> [2. text/x-diff; 0002-Add-command-to-start-Emacs-with-specific-packages= .patch]... >>> >>> [3. text/x-diff; 0001-Add-a-function-to-query-the-Emacs-executable.patc= h]... > > I have slightly modified your version, fixing issues I had, in case > anyone else wants to try it out: Thanks, sorry to not provide the CRM, I quickly wrote this. > (defun package-isolate (packages) > "Start an uncustomised Emacs and only load a set of PACKAGES." > (interactive > (list (mapcar #'intern (completing-read-multiple "Packages: " = (mapcar #'car (package--alist)))))) > (let* ((name (concat "package-isolate-" (mapconcat #'symbol-nam= e packages ","))) > (deps (mapcan #'package--dependencies packages))) > (apply #'start-process (concat "*" name "*") nil > (list (file-truename (expand-file-name invocation-name= invocation-directory)) > "--quick" "--debug-init" > (format "--eval=3D%S" > `(progn > (require 'warnings) > (add-to-list 'warning-suppress-log-ty= pes 'initialization) > (require 'package) > (setq package-load-list > ',(mapcar (lambda (p) (list p t= )) (append packages deps))) > (package-initialize))))))) =2D-=20 Thierry --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQHHBAEBCgAxFiEEI9twfRN7r3nig/xwDsVtFB0W75MFAmTcpb8THHRoaWV2b2xA cG9zdGVvLm5ldAAKCRAOxW0UHRbvk1PWC/9k5VNP9khVxozlrzHaX7LcdgNgaqV4 eTygQ84ucVAQC0tG/tdprxY5FKyfyOTqBGOr6oGEvMRszEMGz66T1lqQXvZFMwl9 4YAwLavrns5qYgsw4UFbppsEjfJnzV4HwYBW304vMRz93xWXPkuvwhUp0r1Ja1N+ l4GYHX0gFNGFO8EIwiyyX5njAkMMAtPdED1Xg1PCgkLFvR+zIvOwE45azhmp6mE9 zz8hgWam3el9+lTvVVGydqqeXIYGk3FLBBPNaiFL9gTTwffqOOsrJiBNJuoPnqou vG6DSkmC2Sjz9DWZXVkNLa6ocvUZsT7J4iRg+V7G8Ye7Fa0awNbccp3KkmuH6/v+ bIwdmHPwFw1SPd1gZ1wg5jYZmYJ03evohvQK/iecreErwTbDs0P1dl/JXR9qI0Hx 627s8deL/7kOEr+yEpD8WdPkQA7+Pg9t+bJzapH/S01Giu8SnCqwGtXH13k82dV8 a5fHCImiR0MKELHQIHUOuTqhZ6kWppCe5Ik= =+DMA -----END PGP SIGNATURE----- --=-=-=--