emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Proposal for 'package-isolate' command


From: Thierry Volpiatto
Subject: Re: Proposal for 'package-isolate' command
Date: Thu, 17 Aug 2023 13:56:36 +0000

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

With my simple version of package-isolate I have not this error, both
osm w3m are installed correctly.

(defun package-isolate (packages)
  "Start an uncustomised Emacs and only load a set of PACKAGES."
  (interactive
   (list (completing-read-multiple
          "Packages: " (mapcar #'car (package--alist)))))
  (let* ((name (concat "package-isolate-" (mapconcat #'identity packages ",")))
         (deps (cl-loop for p in packages
                        for sym = (intern p)
                        nconc (package--dependencies sym))))
    (apply #'start-process (concat "*" name "*") nil
           (list (file-truename (expand-file-name
                                 invocation-name invocation-directory))
                 "--quick" "--debug-init"
                 (format "--eval=%S"
                         `(progn
                           (require 'package)
                           (setq package-load-list
                            ',(append (mapcar (lambda (p) (list (intern p) t))
                                              packages)
                                      (mapcar (lambda (p) (list p t)) deps)))
                           (package-initialize)))))))

> [2. text/x-diff; 
> 0001-Add-command-to-start-Emacs-with-specific-packages.patch]...


-- 
Thierry

Attachment: signature.asc
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]