bug-gnu-emacs
[Top][All Lists]
Advanced

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

bug#27822: [PATCH] do not auto-remove external packages (fixes #27822)


From: Noam Postavsky
Subject: bug#27822: [PATCH] do not auto-remove external packages (fixes #27822)
Date: Wed, 08 Aug 2018 21:19:02 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux)

Yuri D'Elia <wavexx@thregr.org> writes:
>
>>From 5a4234b3c1289960fd760256aa6399efbd04bfc3 Mon Sep 17 00:00:00 2001
> From: Yuri D'Elia <wavexx@thregr.org>
> Date: Tue, 17 Jul 2018 12:59:35 +0200
> Subject: [PATCH] Do not consider external packages to be removable
>
> Packages which are not directly user-installed shouldn't be autoremoved,
> since they can be setup through a different path (via
> `package-directory-list') where we have no authority over.

The patch looks okay for emacs-26, I'll push in a few days assuming no
objections.

A couple of nitpicks below:

> +(defun package--user-installed-p (pkg)
> +  "Check if the package is a user-installed package.
> +PKG is a package name.

I think this is better shortened to

    Return non-nil if the package named PKG is user-installed.

> +Checks whether the package was installed into `package-user-dir' where
> +we assume to have control over."
> +  (let* ((pkg-desc (cadr (assq pkg package-alist)))
> +         (dir (package-desc-dir pkg-desc)))
> +    (file-in-directory-p dir package-user-dir)))
> +
>  (defun package--removable-packages ()
>    "Return a list of names of packages no longer needed.
>  These are packages which are neither contained in
> @@ -1763,7 +1772,9 @@ These are packages which are neither contained in

By the way, if you run './autogen --git' you should get nicer headers
for lisp diffs.

>                           ;; `p' and its dependencies are needed.
>                           append (cons p (package--get-deps p)))))
>      (cl-loop for p in (mapcar #'car package-alist)
> -             unless (memq p needed)
> +             unless (or (memq p needed)
> +                        ;; do not auto-remove external packages

Comments should be capitalized and end with a period.

> +                        (not (package--user-installed-p p)))
>               collect p)))






reply via email to

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