From ad93d0645507f54ca10dc10b7c8bbab0015a90b5 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Gerd=20M=C3=B6llmann?= Date: Tue, 8 Aug 2023 08:15:59 +0200 Subject: [PATCH] Fixing 'export' * lisp/emacs-lisp/pkg.el (pkg-defpackage): Fix a typo. * src/pkg.c (pkg_set_status): Use pkg_error instead of eassert. --- lisp/emacs-lisp/pkg.el | 2 +- src/pkg.c | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/lisp/emacs-lisp/pkg.el b/lisp/emacs-lisp/pkg.el index d56a034eb65..9b9755ad303 100644 --- a/lisp/emacs-lisp/pkg.el +++ b/lisp/emacs-lisp/pkg.el @@ -609,7 +609,7 @@ Value is t." (let ((other-package (pkg--package-or-lose (car imports-from)))) (dolist (sym-name (cdr imports-from)) (import (list (pkg--ensure-symbol sym-name other-package)) - gpackage)))) + package)))) ;; Exports. (let ((old-exports nil) diff --git a/src/pkg.c b/src/pkg.c index 7f78c61cf32..ceb339e28cf 100644 --- a/src/pkg.c +++ b/src/pkg.c @@ -479,12 +479,16 @@ pkg_set_status (Lisp_Object symbol, Lisp_Object package, Lisp_Object status) { CHECK_SYMBOL (symbol); CHECK_PACKAGE (package); + if (!EQ (status, QCinternal) && !EQ (status, QCexternal)) pkg_error ("Invalid symbol status %s", status); struct Lisp_Hash_Table *h = XHASH_TABLE (PACKAGE_SYMBOLS (package)); - ptrdiff_t i = hash_lookup (h, SYMBOL_NAME (symbol), NULL); - eassert (i >= 0); + const ptrdiff_t i = hash_lookup (h, SYMBOL_NAME (symbol), NULL); + if (i < 0) + pkg_error ("Symbol '%s' is not an internal symbol in package '%s'", + SDATA (SYMBOL_NAME (symbol)), + SDATA (PACKAGE_NAMEX (package))); ASET (h->key_and_value, 2 * i + 1, status); return Qnil; } -- 2.39.2