emacs-diffs
[Top][All Lists]
Advanced

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

scratch/pkg 87c6d1de783: Check locks in delete-package


From: Gerd Moellmann
Subject: scratch/pkg 87c6d1de783: Check locks in delete-package
Date: Wed, 6 Sep 2023 01:19:27 -0400 (EDT)

branch: scratch/pkg
commit 87c6d1de783c159af9b9b4a5462265605011ffb9
Author: Gerd Moellmann <gerd.moellmann@gmail.com>
Commit: Gerd Moellmann <gerd.moellmann@gmail.com>

    Check locks in delete-package
---
 lisp/emacs-lisp/pkg.el | 21 ++++++++++++++++-----
 1 file changed, 16 insertions(+), 5 deletions(-)

diff --git a/lisp/emacs-lisp/pkg.el b/lisp/emacs-lisp/pkg.el
index c1f69884ba9..4b2ca980902 100644
--- a/lisp/emacs-lisp/pkg.el
+++ b/lisp/emacs-lisp/pkg.el
@@ -260,7 +260,8 @@ normally, or else if an explcit return occurs the value it 
transfers."
          ,var
         ,result-form))))
 
-(defun pkg--internal-symbols (package)
+;;;###autoload
+(defun internal-symbols (package)
   (let (syms
         (package (pkg--package-or-lose package)))
     (do-symbols (sym package)
@@ -268,7 +269,8 @@ normally, or else if an explcit return occurs the value it 
transfers."
         (push sym syms)))
     syms))
 
-(defun pkg--external-symbols (package)
+;;;###autoload
+(defun external-symbols (package)
   (let (syms
         (package (pkg--package-or-lose package)))
     (do-external-symbols (sym package)
@@ -276,12 +278,19 @@ normally, or else if an explcit return occurs the value 
it transfers."
         (push sym syms)))
     syms))
 
+;;;###autoload
 (cl-defmacro without-package-locks (&body body)
   `(let ((enable-package-locks nil))
      (progn ,@body)))
 
+;;;###autoload
 (cl-defmacro with-unlocked-packages ((&rest _packages) &body body)
   )
+
+;;;###autoload
+(cl-defmacro with-locked-packages ((&rest _packages) &body body)
+  )
+
 
 
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;;                        Basic stuff
@@ -454,7 +463,9 @@ error."
     (let ((package (pkg--package-or-lose package)))
       (when (or (eq package *emacs-package*)
                 (eq package *keyword-package*))
-        (error "Cannot delete a standard package"))
+        (error "Cannot delete a standard package: %s"
+               package))
+      (pkg--check-package-lock package)
       (pkg--remove-from-registry package)
       (setf (package-%name package) nil)
       (do-symbols (sym package)
@@ -479,9 +490,9 @@ Value is the renamed package object."
         (new-name (pkg--stringify-name new-name "package name"))
         (new-nicknames (pkg--stringify-names new-nicknames
                                              "package nickname")))
-    (pkg--check-package-lock package)
     (unless (package-%name package)
-      (error "Package is deleted"))
+      (error "Package %s is deleted" package))
+    (pkg--check-package-lock package)
     (pkg--remove-from-registry package)
     (setf (package-%nicknames package) new-nicknames)
     (setf (package-%name package) new-name)



reply via email to

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