[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
pkg a93ec52542 76/76: Work on Lisp interface
From: |
Gerd Moellmann |
Subject: |
pkg a93ec52542 76/76: Work on Lisp interface |
Date: |
Fri, 21 Oct 2022 00:16:20 -0400 (EDT) |
branch: pkg
commit a93ec52542abad5934d83aca4a1f78eaa97c4f98
Author: Gerd Möllmann <gerd@gnu.org>
Commit: Gerd Möllmann <gerd@gnu.org>
Work on Lisp interface
---
lisp/emacs-lisp/pkg.el | 74 +++++++++++++++++---------------------------------
1 file changed, 25 insertions(+), 49 deletions(-)
diff --git a/lisp/emacs-lisp/pkg.el b/lisp/emacs-lisp/pkg.el
index 58dae7dcdc..c9759b51e7 100644
--- a/lisp/emacs-lisp/pkg.el
+++ b/lisp/emacs-lisp/pkg.el
@@ -236,7 +236,7 @@ but have common elements %s" key1 key2 common))))
(let ((symbols (pkg--symbol-listify symbols))
(package (pkg--package-or-default package))
(syms ()))
- (let ((syms ()))
+
;; Ignore any symbols that are already external.
(dolist (sym symbols)
(cl-multiple-value-bind (_s status)
@@ -256,63 +256,39 @@ but have common elements %s" key1 key2 common))))
(find-symbol name p)
(when (and w (not (eq s sym))
(not (member s (package-%shadowing-symbols p))))
- (pushnew sym cset)
- (pushnew p cpackages))))))
+ (cl-pushnew sym cset)
+ (cl-pushnew p cpackages))))))
(when cset
- (restart-case
- (error
- 'simple-package-error
- :package package
- :format-control
- (intl:gettext "Exporting these symbols from the ~A package:~%~S~%~
- results in name conflicts with these packages:~%~{~A ~}")
- :format-arguments
- (list (package-%name package) cset
- (mapcar #'package-%name cpackages)))
- (unintern-conflicting-symbols ()
- :report (lambda (stream)
- (write-string (intl:gettext "Unintern conflicting
symbols.") stream))
- (dolist (p cpackages)
- (dolist (sym cset)
- (moby-unintern sym p))))
- (skip-exporting-these-symbols ()
- :report (lambda (stream)
- (write-string (intl:gettext "Skip exporting conflicting
symbols.") stream))
- (setq syms (nset-difference syms cset))))))
- ;;
- ;; Check that all symbols are accessible. If not, ask to import them.
+ (error "Exporting these symbols from the %s package: %s
+ results in name conflicts with these packages: %s"
+ (package-name package)
+ cset
+ (mapcar #'package-name cpackages))))
+
+ ;; Check that all symbols are accessible.
(let ((missing ())
(imports ()))
(dolist (sym syms)
- (multiple-value-bind (s w) (find-symbol (symbol-name sym) package)
- (cond ((not (and w (eq s sym))) (push sym missing))
- ((eq w :inherited) (push sym imports)))))
+ (cl-multiple-value-bind (s w)
+ (find-symbol (cl-symbol-name sym) package)
+ (cond ((not (and w (eq s sym)))
+ (push sym missing))
+ ((eq w :inherited)
+ (push sym imports)))))
(when missing
- (with-simple-restart
- (continue (intl:gettext "Import these symbols into the ~A package.")
- (package-%name package))
- (error 'simple-package-error
- :package package
- :format-control
- (intl:gettext "These symbols are not accessible in the ~A
package:~%~S")
- :format-arguments
- (list (package-%name package) missing)))
- (import missing package))
- (import imports package))
- ;;
- ;; And now, three pages later, we export the suckers.
- (let ((internal (package-internal-symbols package))
- (external (package-external-symbols package)))
- (dolist (sym syms)
- (nuke-symbol internal (symbol-name sym))
- (add-symbol external sym)))
- t))
-
+ (error "These symbols are not accessible in the %s package: %s"
+ (package-%name package)
+ missing)))
+ ;; Import
+ (import imports package)
+ ;; And now, three pages later, we export the suckers.
+ (dolist (sym syms)
+ (package-%set-status sym package :external))
+ t))
- (error "not yet implemented"))
;;;###autoload
(defun unexport (_symbols &optional package)
- pkg 4c1bbd4fd7 31/76: intern-soft with ':' trick, (continued)
- pkg 4c1bbd4fd7 31/76: intern-soft with ':' trick, Gerd Moellmann, 2022/10/21
- pkg ea65e35cf3 28/76: src/alloc.c: Remove all uses of `pure_alloc`, Gerd Moellmann, 2022/10/21
- pkg a5f6912c6d 30/76: Mapatoms differently, Gerd Moellmann, 2022/10/21
- pkg 2edc30628a 27/76: Use build_pure_c_string, Gerd Moellmann, 2022/10/21
- pkg 85c0eb1682 36/76: Merge remote-tracking branch 'origin/master' into pkg, Gerd Moellmann, 2022/10/21
- pkg 07f0b758ae 62/76: hash_remove_from_table returns bool, Gerd Moellmann, 2022/10/21
- pkg e1a730849e 42/76: Fix printing uninterned symbols, Gerd Moellmann, 2022/10/21
- pkg 1424d2c6b7 61/76: Fix intern-soft, Gerd Moellmann, 2022/10/21
- pkg bdca01dd38 29/76: Workaround for something Stefan missed, Gerd Moellmann, 2022/10/21
- pkg 62582ea927 72/76: Fix completion for new symbol table layout, Gerd Moellmann, 2022/10/21
- pkg a93ec52542 76/76: Work on Lisp interface,
Gerd Moellmann <=
- pkg 9ab00f542f 70/76: Introduce PACKAGE_NAMEX, Gerd Moellmann, 2022/10/21
- pkg 51cd0e05d6 71/76: De-duplicate packages for mapatoms, Gerd Moellmann, 2022/10/21
- pkg 9a263a0782 57/76: Move more package stuff to Lisp, Gerd Moellmann, 2022/10/21
- pkg d374cb202a 43/76: Revert "Use make-package instead of make-vector", Gerd Moellmann, 2022/10/21
- pkg 77543a203a 45/76: Revert "Dpn't assume symbol-name of keywords starts with colon", Gerd Moellmann, 2022/10/21
- pkg 0a345a1181 53/76: Make internals of Lisp_Package visible to Lisp, Gerd Moellmann, 2022/10/21
- pkg 13010d7bd0 47/76: Partially revert "Remove obarrays", Gerd Moellmann, 2022/10/21
- pkg 132f070747 58/76: New predefined hash table test for string-equal, Gerd Moellmann, 2022/10/21
- pkg 4f7c171fb4 49/76: Support specifying package size, Gerd Moellmann, 2022/10/21
- pkg 9e3cfff902 51/76: Increase default symbol-table sizes, Gerd Moellmann, 2022/10/21