From 0d6677f04e4f3539e6451aef6a07df1b74e8f6b1 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Gerd=20M=C3=B6llmann?= Date: Wed, 26 Oct 2022 14:05:01 +0200 Subject: [PATCH] Add register-package * lisp/emacs-lisp/pkg.el (register-package): New function. --- lisp/emacs-lisp/pkg.el | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/lisp/emacs-lisp/pkg.el b/lisp/emacs-lisp/pkg.el index 56c191f7d08..48d6e108dc0 100644 --- a/lisp/emacs-lisp/pkg.el +++ b/lisp/emacs-lisp/pkg.el @@ -299,6 +299,16 @@ but is what Common Lisp implementations usually do." (package-%use-list package) use) package)) +(defun register-package (package) + "Register PACKAGE in the package registry. +Signal an error if the name or one of the nicknames of PACKAGE +conflicts with a name already present in the registry. +Value is PACKAGE." + (let ((package (pkg--package-or-lose package))) + (pkg--check-name-conflicts package) + (pkg--add-to-registry package) + package)) + ;;;###autoload (defun list-all-packages () "Return a fresh list of all registered packages." -- 2.39.2