From 57562c3fd0a5a7b640cc42c6daaad6842cd5b311 Mon Sep 17 00:00:00 2001 From: Thuna Date: Wed, 19 Apr 2023 23:43:22 +0200 Subject: Recognize defstruct slot names in various eieio functions * lisp/emacs-lisp/cl-preloaded.el (cl-struct-define): Set each slot's name's 'slot-name' property so that 'eieio--known-slot-name-p' can recognize them. (Bug#62959) Copyright-paperwork-exempt: yes --- lisp/emacs-lisp/cl-preloaded.el | 1 + 1 file changed, 1 insertion(+) (limited to 'lisp/emacs-lisp') diff --git a/lisp/emacs-lisp/cl-preloaded.el b/lisp/emacs-lisp/cl-preloaded.el index 9445093f143..5235be52996 100644 --- a/lisp/emacs-lisp/cl-preloaded.el +++ b/lisp/emacs-lisp/cl-preloaded.el @@ -176,6 +176,7 @@ supertypes from the most specific to least specific.") (i 0) (offset (if type 0 1))) (dolist (slot slots) + (put (car slot) 'slot-name t) (let* ((props (cl--plist-to-alist (cddr slot))) (typep (assq :type props)) (type (if (null typep) t -- cgit v1.2.1 From 2901a3443c7daa15cbe01947ace3e0980e419028 Mon Sep 17 00:00:00 2001 From: Philip Kaludercic Date: Sun, 30 Apr 2023 20:21:04 +0200 Subject: Prevent unnecessary modifications of 'package-vc-selected-packages' * lisp/emacs-lisp/package-vc.el (package-vc--unpack): Handle the structure of correctly, not as an alist but a list of alists. (package-vc--archive-spec-alist, package-vc--archive-spec-alists, package-vc--desc->spec, package-vc--read-archive-data, package-vc--download-and-read-archives, package-vc--unpack): Rename 'package-vc--archive-spec-alist' to 'package-vc--archive-spec-alists'. --- lisp/emacs-lisp/package-vc.el | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'lisp/emacs-lisp') diff --git a/lisp/emacs-lisp/package-vc.el b/lisp/emacs-lisp/package-vc.el index fa9fce24acc..8f62e7d65f3 100644 --- a/lisp/emacs-lisp/package-vc.el +++ b/lisp/emacs-lisp/package-vc.el @@ -162,7 +162,7 @@ archive." (:vc-backend symbol))))) :version "29.1") -(defvar package-vc--archive-spec-alist nil +(defvar package-vc--archive-spec-alists nil "List of package specifications for each archive. The list maps each package name, as a string, to a plist as specified in `package-vc-selected-packages'.") @@ -194,15 +194,15 @@ name for PKG-DESC." (not (alist-get name package-vc-selected-packages nil nil #'string=))) (alist-get (intern (package-desc-archive pkg-desc)) - package-vc--archive-spec-alist) + package-vc--archive-spec-alists) ;; Consult both our local list of package specifications, as well ;; as the lists provided by the archives. (apply #'append (cons package-vc-selected-packages - (mapcar #'cdr package-vc--archive-spec-alist)))) + (mapcar #'cdr package-vc--archive-spec-alists)))) '() nil #'string=)) (defun package-vc--read-archive-data (archive) - "Update `package-vc--archive-spec-alist' for ARCHIVE. + "Update `package-vc--archive-spec-alists' for ARCHIVE. This function is meant to be used as a hook for `package-read-archive-hook'." (let ((contents-file (expand-file-name (format "archives/%s/elpa-packages.eld" archive) @@ -219,7 +219,7 @@ This function is meant to be used as a hook for `package-read-archive-hook'." (let ((spec (read (current-buffer)))) (when (eq package-vc--elpa-packages-version (plist-get (cdr spec) :version)) - (setf (alist-get (intern archive) package-vc--archive-spec-alist) + (setf (alist-get (intern archive) package-vc--archive-spec-alists) (car spec))) (setf (alist-get (intern archive) package-vc--archive-data-alist) (cdr spec)) @@ -230,7 +230,7 @@ This function is meant to be used as a hook for `package-read-archive-hook'." (defun package-vc--download-and-read-archives (&optional async) "Download specifications of all `package-archives' and read them. -Populate `package-vc--archive-spec-alist' with the result. +Populate `package-vc--archive-spec-alists' with the result. If optional argument ASYNC is non-nil, perform the downloads asynchronously." @@ -571,7 +571,7 @@ Emacs Lisp files.") (defun package-vc--unpack (pkg-desc pkg-spec &optional rev) "Install the package described by PKG-DESC. PKG-SPEC is a package specification, a property list describing -how to fetch and build the package. See `package-vc--archive-spec-alist' +how to fetch and build the package. See `package-vc--archive-spec-alists' for details. The optional argument REV specifies a specific revision to checkout. This overrides the `:branch' attribute in PKG-SPEC." (unless (eq (package-desc-kind pkg-desc) 'vc) @@ -620,7 +620,8 @@ abort installation?" name)) (throw 'done (setq lisp-dir name))))) ;; Ensure we have a copy of the package specification - (unless (equal (alist-get name (mapcar #'cdr package-vc--archive-spec-alist)) pkg-spec) + (unless (seq-some (lambda (alist) (equal (alist-get name (cdr alist)) pkg-spec)) + package-vc--archive-spec-alists) (customize-save-variable 'package-vc-selected-packages (cons (cons name pkg-spec) -- cgit v1.2.1 From 94e984e6700c805c3aaac6f8d9c56381a8d0673a Mon Sep 17 00:00:00 2001 From: Robert Pluim Date: Thu, 4 May 2023 14:07:08 +0200 Subject: Make loaddefs-generate slightly more tolerant There are packages in the wild, such as vlf-20191126.2250, which have entries that are not terminated by three ';', but by two. Tolerate such entries. * lisp/emacs-lisp/loaddefs-gen.el (loaddefs-generate): Search for two ';' as a delimiter, not three. (Bug#63236) --- lisp/emacs-lisp/loaddefs-gen.el | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'lisp/emacs-lisp') diff --git a/lisp/emacs-lisp/loaddefs-gen.el b/lisp/emacs-lisp/loaddefs-gen.el index a966b1e9f40..2a46fb7a022 100644 --- a/lisp/emacs-lisp/loaddefs-gen.el +++ b/lisp/emacs-lisp/loaddefs-gen.el @@ -635,9 +635,12 @@ instead of just updating them with the new/changed autoloads." (progn (goto-char (point-max)) (search-backward "\f\n" nil t)) - ;; Delete the old version of the section. + ;; Delete the old version of the section. Strictly + ;; speaking this should search for "\n\f\n;;;", but + ;; there are loaddefs files in the wild that only + ;; have two ';;'. (Bug#63236) (delete-region (match-beginning 0) - (and (search-forward "\n\f\n;;;") + (and (search-forward "\n\f\n;;") (match-beginning 0))) (forward-line -2))) (insert head) -- cgit v1.2.1 From 79a886ba36837c0e13d83172ab33c1c2680c6e62 Mon Sep 17 00:00:00 2001 From: Dmitry Gutov Date: Sat, 6 May 2023 03:32:08 +0300 Subject: (package-upgrade): Don't remove the package from 'package-selected-packages' * lisp/emacs-lisp/package.el (package-upgrade): Don't remove the package from 'package-selected-packages', fixing the problem described in https://debbugs.gnu.org/62720#718. --- lisp/emacs-lisp/package.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lisp/emacs-lisp') diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el index 0919ce34448..bbe2b8bb4af 100644 --- a/lisp/emacs-lisp/package.el +++ b/lisp/emacs-lisp/package.el @@ -2282,7 +2282,7 @@ newer version from ELPA by using `\\\\[package-menu-mark- (pkg-desc (cadr (assq package package-alist)))) (if (package-vc-p pkg-desc) (package-vc-upgrade pkg-desc) - (package-delete pkg-desc 'force) + (package-delete pkg-desc 'force 'dont-unselect) (package-install package 'dont-select)))) (defun package--upgradeable-packages () -- cgit v1.2.1