]> git.eshelyaron.com Git - emacs.git/commitdiff
Improve Lisp interface on the C side of packages
authorGerd Möllmann <gerd@gnu.org>
Sat, 22 Oct 2022 13:20:46 +0000 (15:20 +0200)
committerGerd Möllmann <gerd@gnu.org>
Sat, 22 Oct 2022 13:20:46 +0000 (15:20 +0200)
* src/pkg.c (Fpackage_percent_set_name): Allow nil as name.
(Fpackage_percent_register): Return the package.

src/pkg.c

index 0222658c5a124e088ad92a1381a2037cff1e15a5..97bf0ea7f37eba0a6fcb8df59b6f54f182007834 100644 (file)
--- a/src/pkg.c
+++ b/src/pkg.c
@@ -803,7 +803,8 @@ DEFUN ("package-%set-name", Fpackage_percent_set_name, Spackage_percent_set_name
   (Lisp_Object package, Lisp_Object name)
 {
   CHECK_PACKAGE (package);
-  CHECK_STRING (name);
+  if (!NILP (name))
+    CHECK_STRING (name);
   return XPACKAGE (package)->name = name;
 }
 
@@ -875,7 +876,7 @@ DEFUN ("package-%register", Fpackage_percent_register,
   (Lisp_Object package)
 {
   pkg_register_package (package);
-  return Qnil;
+  return package;
 }
 
 \f