#include <config.h>
#include "lisp.h"
+#include "buffer.h"
#include "character.h"
/***********************************************************************
/* Sometimes useful for setting a breakpoint, after inserting it
somewhere in the code. */
-void pkg_break (void)
+void
+pkg_break (void)
{
}
(Lisp_Object symbol, Lisp_Object newval, Lisp_Object operation,
Lisp_Object where)
{
- if (!PACKAGEP (newval))
- error ("%s must be bound or set to a package object",
- SDATA (SYMBOL_NAME (symbol)));
+ if (EQ (operation, Qmakunbound))
+ {
+ if (!BUFFERP (where))
+ error ("Cannot makunbound %s", SDATA (SYMBOL_NAME (symbol)));
+ }
+ else if (!PACKAGEP (newval))
+ error ("%s must alwasy be bound to a package object (operation %s)",
+ SDATA (SYMBOL_NAME (symbol)),
+ SDATA (SYMBOL_NAME (operation)));
return Qnil;
}
doc: /* */);
Fmake_variable_buffer_local (Qpackage_prefixes);
- Fmake_variable_buffer_local (Qpackage_prefixes);
-
Fprovide (Qsymbol_packages, Qnil);
}
(should (eq (let ((*package* (find-package "emacs"))) 'good) 'good))
(should-error (let ((*package* :emacs)) nil))
(should-error (let ((*package* 1))))
- (should-error (setq *package* :keyword)))
+ (should-error (setq *package* :keyword))
+ (should-error (makunbound *package*))
+ (with-temp-buffer
+ (in-package* :emacs-user)
+ (kill-all-local-variables)
+ (should (eq *package* (find-package :emacs)))))
(ert-deftest pkg-tests-standard-packages ()
(should (packagep (find-package "emacs")))