From 8f53ac64620db17a7b163889bb319b621ab97a25 Mon Sep 17 00:00:00 2001 From: Philip Kaludercic Date: Wed, 10 May 2023 08:58:34 +0200 Subject: [PATCH] Ensure that package menu respects 'package-install-upgrade-built-in' * lisp/emacs-lisp/package.el (package-menu--find-upgrades): Check if built-in packages can be upgraded if 'package-install-upgrade-built-in' is non-nil. --- lisp/emacs-lisp/package.el | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el index 9476354ebe0..24ba67cef2f 100644 --- a/lisp/emacs-lisp/package.el +++ b/lisp/emacs-lisp/package.el @@ -3731,7 +3731,9 @@ package-menu--find-upgrades ;; ENTRY is (PKG-DESC [NAME VERSION STATUS DOC]) (let ((pkg-desc (car entry)) (status (aref (cadr entry) 2))) - (cond ((member status '("installed" "dependency" "unsigned" "external")) + (cond ((member status (append + '("installed" "dependency" "unsigned" "external" "built-in") + (and package-install-upgrade-built-in '("built-in")))) (push pkg-desc installed)) ((member status '("available" "new")) (setq available (package--append-to-alist pkg-desc available)))))) @@ -3742,6 +3744,8 @@ package-menu--find-upgrades (and avail-pkg (version-list-< (package-desc-priority-version pkg-desc) (package-desc-priority-version avail-pkg)) + (xor (not package-install-upgrade-built-in) + (package--active-built-in-p pkg-desc)) (push (cons name avail-pkg) upgrades)))) upgrades)) -- 2.39.2