]> git.eshelyaron.com Git - emacs.git/commitdiff
Add locked member to Lisp_Package
authorGerd Möllmann <gerd@gnu.org>
Sat, 12 Aug 2023 14:51:32 +0000 (16:51 +0200)
committerGerd Möllmann <gerd@gnu.org>
Sat, 12 Aug 2023 14:51:32 +0000 (16:51 +0200)
* src/lisp.h (GCALIGNED_STRUCT): Add locked member to Lisp_Package.
* src/pkg.c (Fpackage_percent_locked): New function.
(Fpackage_percent_set_locked): New function.
(syms_of_pkg): Defsubr new functions.

src/lisp.h
src/pkg.c

index 516157c8c6b1886cd63dbb67645ac70d028e8e1d..742fce58eacab2670437b30f8287d6576c8b1d7c 100644 (file)
@@ -2230,6 +2230,9 @@ struct Lisp_Package
      package.  */
   Lisp_Object use_list;
 
+  /* T means the package is locked, i.e. no symbols can be added to it.  */
+  Lisp_Object locked;
+
   /* List of shadowing symbols.  */
   Lisp_Object shadowing_symbols;
 
index 622a5391f6db622b11e6107e279864d79f517cd9..6869f721475cf16b651a65eac21fd5075bc8b710 100644 (file)
--- a/src/pkg.c
+++ b/src/pkg.c
@@ -858,6 +858,22 @@ DEFUN ("package-%set-shadowing-symbols", Fpackage_percent_set_shadowing_symbols,
   return XPACKAGE (package)->shadowing_symbols = shadowing_symbols;
 }
 
+DEFUN ("package-%locked", Fpackage_percent_locked,
+       Spackage_percent_locked, 1, 1, 0, doc:  /* Internal use only.  */)
+  (Lisp_Object package)
+{
+  CHECK_PACKAGE (package);
+  return XPACKAGE (package)->locked;
+}
+
+DEFUN ("package-%set-locked", Fpackage_percent_set_locked,
+       Spackage_percent_set_locked, 2, 2, 0, doc: /* Internal use only.  */)
+  (Lisp_Object package, Lisp_Object locked)
+{
+  CHECK_PACKAGE (package);
+  return XPACKAGE (package)->locked = locked;
+}
+
 DEFUN ("package-%symbols", Fpackage_percent_symbols,
        Spackage_percent_symbols, 1, 1, 0, doc:  /* Internal use only.  */)
   (Lisp_Object package)
@@ -991,6 +1007,8 @@ syms_of_pkg (void)
   defsubr (&Spackage_percent_set_symbol_package);
   defsubr (&Spackage_percent_set_use_list);
   defsubr (&Spackage_percent_shadowing_symbols);
+  defsubr (&Spackage_percent_locked);
+  defsubr (&Spackage_percent_set_locked);
   defsubr (&Spackage_percent_symbols);
   defsubr (&Spackage_percent_use_list);
   defsubr (&Spackagep);