[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
scratch/pkg ad93d064550 2/2: Fixing 'export'
From: |
Gerd Moellmann |
Subject: |
scratch/pkg ad93d064550 2/2: Fixing 'export' |
Date: |
Tue, 8 Aug 2023 02:17:20 -0400 (EDT) |
branch: scratch/pkg
commit ad93d0645507f54ca10dc10b7c8bbab0015a90b5
Author: Gerd Möllmann <gerd@gnu.org>
Commit: Gerd Möllmann <gerd@gnu.org>
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;
}