unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Philip Kaludercic <philipk@posteo.net>
To: Thierry Volpiatto <thievol@posteo.net>
Cc: emacs-devel@gnu.org
Subject: Re: Proposal for 'package-isolate' command
Date: Thu, 17 Aug 2023 18:17:36 +0000	[thread overview]
Message-ID: <87y1i9fs8v.fsf@posteo.net> (raw)
In-Reply-To: <871qg1oi61.fsf@posteo.net> (Thierry Volpiatto's message of "Thu,  17 Aug 2023 14:28:40 +0000")

Thierry Volpiatto <thievol@posteo.net> writes:

> Thierry Volpiatto <thievol@posteo.net> writes:
>
>> Philip Kaludercic <philipk@posteo.net> writes:
>>
>>> Thierry Volpiatto <thievol@posteo.net> writes:
>>>
>>>> Philip Kaludercic <philipk@posteo.net> writes:
>>>>
>>>>>> No don't worry, helm will work in any cases, thanks.
>>>>>
>>>>> OK, in that case I'd prefer to keep it the way it is.
>>>>
>>>> Ok, fair enough.
>>>>
>>>>>>> Mainly to avoid issues with packages that might place files in the
>>>>>>> configuration directory, which might hinder the reproduction of bugs.
>>>>>>
>>>>>> Hmm, maybe, I don't have an example in mind though.
>>>>>
>>>>> It might not be the best example, but my package autocrypt generates a
>>>>> file in the `user-emacs-directory'.  If we don't use --init-directory,
>>>>> the existing file would be re-used.
>>>>
>>>> Ok, for such case it is easy to either rename the file temporarily to
>>>> foo_ori or foo_save or to set the variable handling the file (generally
>>>> it is not harcoded) to something else. But another issue is if your
>>>> isolated package needs the history file or tramp file or whatever file
>>>> ~/.emacs.d is handling; e.g. a package providing completion on history.
>>>> I still think it is more handy to reuse user-emacs-directory and its
>>>> elpa directory where the packages are already installed.
>>>
>>> How about this patch, that will use a temporary directory when
>>> `package-isolate' is invoked with a prefix argument (not sure what the
>>> default should be, I guess reusing `user-emacs-directory' is less
>>> surprising):
>>
>> However it is not working properly:
>>
>> Tried to isolate two packages, osm and w3m, and osm use compat as
>> dependency:
>>
>> Unable to activate package ‘osm’.
>> Required package ‘compat-29.1.4.0’ is unavailable
>
> Forget it, it is working properly, just forget you had modified
> package--dependencies as well.
> Sorry for the noise.

It was either that or a new function had to be added, not sure which
approach is worse.  The current implementation seems to have been
hastily added by Lars last year, and it is a bit regrettable in
retrospect.  It would be possible to modify my change, and have the
function always return package-desc objects, since the function is only
used in one other spot in another part of the file.  While there might
be others (packages or individuals) that depend on the function behaving
the way it does, but on the other hand, convention designates it as
being an "internal" function.

Thierry Volpiatto <thievol@posteo.net> writes:

> Philip Kaludercic <philipk@posteo.net> writes:
>
>> Thierry Volpiatto <thievol@posteo.net> writes:
>>
>>> Hello Philip,
>>>
>>> Philip Kaludercic <philipk@posteo.net> writes:
>>>
>>>> Thierry Volpiatto <thievol@posteo.net> writes:
>>>>
>>>>> Philip Kaludercic <philipk@posteo.net> writes:
>>>>>
>>>>>>> No don't worry, helm will work in any cases, thanks.
>>>>>>
>>>>>> OK, in that case I'd prefer to keep it the way it is.
>>>>>
>>>>> Ok, fair enough.
>>>>>
>>>>>>>> Mainly to avoid issues with packages that might place files in the
>>>>>>>> configuration directory, which might hinder the reproduction of bugs.
>>>>>>>
>>>>>>> Hmm, maybe, I don't have an example in mind though.
>>>>>>
>>>>>> It might not be the best example, but my package autocrypt generates a
>>>>>> file in the `user-emacs-directory'.  If we don't use --init-directory,
>>>>>> the existing file would be re-used.
>>>>>
>>>>> Ok, for such case it is easy to either rename the file temporarily to
>>>>> foo_ori or foo_save or to set the variable handling the file (generally
>>>>> it is not harcoded) to something else. But another issue is if your
>>>>> isolated package needs the history file or tramp file or whatever file
>>>>> ~/.emacs.d is handling; e.g. a package providing completion on history.
>>>>> I still think it is more handy to reuse user-emacs-directory and its
>>>>> elpa directory where the packages are already installed.
>>>>
>>>> How about this patch, that will use a temporary directory when
>>>> `package-isolate' is invoked with a prefix argument (not sure what the
>>>> default should be, I guess reusing `user-emacs-directory' is less
>>>> surprising):
>>>
>>> Yes.
>>>
>>> Isn't these two loop the same? (save one loop)
>>
>> No, because that assumes that we are only interested in the first
>> package descriptor in every package--alist entry, while there might be
>> multiple.
>
> Ah ok.
>
>>>     (cl-loop for p in (cl-loop for p in (package--alist) append (cdr p))
>>>     	 unless (package-built-in-p p)
>>
>> Also, do we want this or wouldn't it be useful to be able to force a
>> built-in package being loaded?
>
> Some packages seems to require a specific version of a package for their
> dependency e.g. seq, by excluding it the package may not work correctly,
> this is my understanding but I may be wrong. Also perhaps the package
> e.g. seq is selected later when computing dependencies but maybe user
> wants to select a particular version manually in the first place?

The current algorithm should pick the first package in the package alist
that satisfies the necessary dependencies.  Perhaps that should be
re-thought or the selection should be more clever, e.g. if the user
explicitly specifies a dependency with a version, then it should be
preferred to whatever other dependency might be determined, at the
possible expense of triggering runtime bugs.



  reply	other threads:[~2023-08-17 18:17 UTC|newest]

Thread overview: 60+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-07  7:57 Changes to make in elpa-packages file for nongnu elpa Thierry Volpiatto
2023-08-07 13:30 ` Philip Kaludercic
2023-08-07 18:19   ` Thierry Volpiatto
2023-08-07 20:33     ` Philip Kaludercic
2023-08-08  4:33       ` Thierry Volpiatto
2023-08-08  5:52         ` Philip Kaludercic
2023-08-08  6:17           ` Thierry Volpiatto
2023-08-15 16:55           ` Philip Kaludercic
2023-08-15 17:34             ` Eshel Yaron
2023-08-15 19:39               ` Proposal for 'package-isolate' command Philip Kaludercic
2023-08-17 10:53                 ` Adam Porter
2023-08-15 18:56             ` Changes to make in elpa-packages file for nongnu elpa Eli Zaretskii
2023-08-15 19:52               ` Proposal for 'package-isolate' command Philip Kaludercic
2023-08-16 11:25                 ` Eli Zaretskii
2023-08-16 18:48                   ` Philip Kaludercic
2023-08-16  6:51             ` Changes to make in elpa-packages file for nongnu elpa Thierry Volpiatto
2023-08-16 10:10               ` Philip Kaludercic
2023-08-16 10:14                 ` Thierry Volpiatto
2023-08-16 11:03                   ` Philip Kaludercic
2023-08-16 11:55                     ` Thierry Volpiatto
2023-08-16 18:34                       ` Proposal for 'package-isolate' command Philip Kaludercic
2023-08-16 18:49                         ` Stefan Kangas
2023-08-16 19:00                           ` Philip Kaludercic
2023-08-17  5:30                         ` Thierry Volpiatto
2023-08-17  8:34                           ` Philip Kaludercic
2023-08-17  9:07                             ` Eshel Yaron
2023-08-17 14:19                               ` Philip Kaludercic
2023-08-17 13:32                             ` Thierry Volpiatto
2023-08-17 14:04                               ` Philip Kaludercic
2023-08-17 14:15                                 ` Thierry Volpiatto
2023-08-17 13:56                             ` Thierry Volpiatto
2023-08-17 14:18                               ` Philip Kaludercic
2023-08-17 14:28                               ` Thierry Volpiatto
2023-08-17 18:17                                 ` Philip Kaludercic [this message]
2023-08-18  4:57                                   ` Thierry Volpiatto
2023-08-18  5:44                                     ` Eli Zaretskii
2023-08-18  7:49                                     ` Philip Kaludercic
2023-08-18 12:43                                       ` Thierry Volpiatto
2023-08-18 18:34                                       ` Adding package and package-vc to ELPA Philip Kaludercic
2023-08-19 10:26                                         ` Thierry Volpiatto
2023-08-20  6:40                             ` Proposal for 'package-isolate' command Thierry Volpiatto
2023-08-20  7:51                               ` Philip Kaludercic
2023-08-20 16:06                               ` Thierry Volpiatto
2023-08-20 18:41                                 ` Philip Kaludercic
2023-08-20 19:15                                   ` Thierry Volpiatto
2023-08-20 20:24                                     ` Thierry Volpiatto
2023-08-20 20:28                                     ` Philip Kaludercic
2023-08-16 14:10                 ` Changes to make in elpa-packages file for nongnu elpa Eli Zaretskii
2023-08-16 18:52                   ` Philip Kaludercic
2023-08-08  6:01       ` Thierry Volpiatto
2023-08-08  6:34       ` Michael Albinus
2023-08-08 16:37         ` Philip Kaludercic
2023-08-08 16:41           ` Michael Albinus
2023-08-09  7:06             ` Philip Kaludercic
2023-08-09 11:53               ` Eli Zaretskii
2023-08-09 14:53                 ` Philip Kaludercic
2023-08-09 14:55                   ` Eli Zaretskii
2023-08-09 15:24                     ` Philip Kaludercic
2023-08-09 16:23                       ` Eli Zaretskii
2023-08-09  3:47   ` Richard Stallman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87y1i9fs8v.fsf@posteo.net \
    --to=philipk@posteo.net \
    --cc=emacs-devel@gnu.org \
    --cc=thievol@posteo.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).