From: Gerd Möllmann Date: Sat, 12 Aug 2023 14:51:32 +0000 (+0200) Subject: Add locked member to Lisp_Package X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=ba213150c5967cb20bd71869ea5dd2db50f424ea;p=emacs.git Add locked member to Lisp_Package * 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. --- diff --git a/src/lisp.h b/src/lisp.h index 516157c8c6b..742fce58eac 100644 --- a/src/lisp.h +++ b/src/lisp.h @@ -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; diff --git a/src/pkg.c b/src/pkg.c index 622a5391f6d..6869f721475 100644 --- 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);