[PATCH 2/5] Add EXTERNAL-ONLY option to APROPOS.

From ece4a944b77d91f657622adbef9d62cfbfb365b1 Mon Sep 17 00:00:00 2001
---
 src/org/armedbear/lisp/apropos.lisp | 19 +++++++++++--------
 1 file changed, 11 insertions(+), 8 deletions(-)
parent 30018df4
......@@ -34,7 +34,8 @@
(in-package #:system)
(defun apropos-list (string-designator &optional package-designator)
(defun apropos-list (string-designator &optional package-designator
external-only)
(if package-designator
(let ((package (find-package package-designator))
(string (string string-designator))
......@@ -43,18 +44,20 @@
(declare (type symbol symbol))
(when (search string (symbol-name symbol) :test #'char-equal)
(push symbol result)))
(dolist (symbol (package-internal-symbols package))
(declare (type symbol symbol))
(when (search string (symbol-name symbol) :test #'char-equal)
(push symbol result)))
(unless external-only
(dolist (symbol (package-internal-symbols package))
(declare (type symbol symbol))
(when (search string (symbol-name symbol) :test #'char-equal)
(push symbol result))))
result)
(mapcan (lambda (package)
(apropos-list string-designator package))
(apropos-list string-designator package external-only))
(list-all-packages))))
(defun apropos (string-designator &optional package-designator)
(defun apropos (string-designator &optional package-designator external-only)
(dolist (symbol (remove-duplicates (apropos-list string-designator
package-designator)))
package-designator
external-only)))
(fresh-line)
(prin1 symbol)
(when (boundp symbol)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment