(gv-define-simple-setter package-%use-list package-%set-use-list)
(gv-define-simple-setter package-%shadowing-symbols
package-%set-shadowing-symbols)
+(gv-define-simple-setter package-%lock package-%set-lock)
\f
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
registered package."
(package-%shadowing-symbols (pkg--package-or-lose package)))
+;;;###autoload
+(defun package-locked-p (package)
+ "Return non-nnil if PACKAGE is locked.
+If PACKAGE is not a package object already, it must the name of a
+registered package."
+ (package-%lock (pkg--package-or-lose package)))
+
+;;;###autoload
+(defun lock-package (package)
+ "Lock PACKAGE.
+If PACKAGE is not a package object already, it must the name of a
+registered package."
+ (setf (package-%lock (pkg--package-or-lose package)) t))
+
+;;;###autoload
+(defun unlock-package (package)
+ "Lock PACKAGE.
+If PACKAGE is not a package object already, it must the name of a
+registered package."
+ (setf (package-%lock (pkg--package-or-lose package)) nil))
+
;;;###autoload
(defun package-use-list (package)
(package-%use-list (pkg--package-or-lose package)))
/* Common Lisp style packages.
Useful features that could be added:
- package locks
hierarchical packages
package-local nicknames */
if (!EQ (existing_symbol, Qunbound))
symbol = existing_symbol;
else
- symbol = Fmake_symbol (name);
+ {
+ if (!NILP (XPACKAGE (package)->lock))
+ error ("Package %s is locked", SDATA (XPACKAGE (package)->name));
+ symbol = Fmake_symbol (name);
+ }
/* PACKAGE becomes the home package of the symbol created. */
XSYMBOL (symbol)->u.s.package = package;