[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gcl-devel] omitting duplicates in apropos and apropos-list
From: |
John Paul Wallington |
Subject: |
[Gcl-devel] omitting duplicates in apropos and apropos-list |
Date: |
Sat, 08 Feb 2003 13:41:39 +0000 |
User-agent: |
Gnus/5.090015 (Oort Gnus v0.15) Emacs/21.3.50 (i686-pc-linux-gnu) |
How about omitting the duplicates in apropos and apropos-list output?
Index: packlib.lsp
===================================================================
RCS file: /cvsroot/gcl/gcl/lsp/packlib.lsp,v
retrieving revision 1.9
diff -u -r1.9 packlib.lsp
--- packlib.lsp 21 Jan 2003 16:41:49 -0000 1.9
+++ packlib.lsp 8 Feb 2003 13:31:18 -0000
@@ -134,24 +134,6 @@
(terpri))
-(defun apropos (string &optional package)
- (setq string (string string))
- (cond (package
- (do-symbols (symbol package)
- (when (substringp string (string symbol))
- (print-symbol-apropos symbol)))
- (do ((p (package-use-list package) (cdr p)))
- ((null p))
- (do-external-symbols (symbol (car p))
- (when (substringp string (string symbol))
- (print-symbol-apropos symbol)))))
- (t
- (do-all-symbols (symbol)
- (when (substringp string (string symbol))
- (print-symbol-apropos symbol)))))
- (values))
-
-
(defun apropos-list (string &optional package &aux list)
(setq list nil)
(setq string (string string))
@@ -161,14 +143,22 @@
(setq list (cons symbol list))))
(do ((p (package-use-list package) (cdr p)))
((null p))
- (do-symbols (symbol (car p))
+ (do-external-symbols (symbol (car p))
(when (substringp string (string symbol))
- (setq list (cons symbol list))))))
+ (setq list (cons symbol list))))))
(t
(do-all-symbols (symbol)
(when (substringp string (string symbol))
(setq list (cons symbol list))))))
- list)
+ (stable-sort (delete-duplicates list :test #'eq)
+ #'string< :key #'symbol-name))
+
+
+(defun apropos (string &optional package)
+ (dolist (symbol (apropos-list string package))
+ (print-symbol-apropos symbol))
+ (values))
+
(defmacro with-package-iterator ((name plist &rest symbol-types) . body)
(let ((p (gensym)) (i (gensym)) (l (gensym)) (q (gensym)) (dum (gensym))
- [Gcl-devel] omitting duplicates in apropos and apropos-list,
John Paul Wallington <=