diff --git a/src/CHANGELOG b/src/CHANGELOG index 06471f111..666d87cad 100644 --- a/src/CHANGELOG +++ b/src/CHANGELOG @@ -132,6 +132,8 @@ ECL 0.9i - The compiler is slightly faster by avoiding use of EVAL. + - APROPOS, APROPOS-LIST and EXT:HELP* are now case insensitive. + * MOP compatibility: - SLOT-VALUE, SLOT-BOUNDP, etc, together with MOP SLOT*-USING-CLASS generic diff --git a/src/lsp/autoload.lsp b/src/lsp/autoload.lsp index 0c24c61a6..0503cd655 100644 --- a/src/lsp/autoload.lsp +++ b/src/lsp/autoload.lsp @@ -187,7 +187,7 @@ Welcome to ECL. Here are the few functions you should learn first. (QUIT) ends the current ECL session. -For the precise language specification, refere to Guy Steele's \"Common Lisp, +For the precise language specification, refer to Guy Steele's \"Common Lisp, the Language\" and our \"ECL Manual\". \"ECL Dictionary\", the hard-copied version of ECL online documentation, will be useful as a handbook. @@ -195,15 +195,6 @@ Good luck! " (print-doc symbol)) -(defun help* (string &optional (package (find-package "CL"))) - "Args: (string &optional (package-spec 'lisp)) -ECL specific. -Prints the documentation associated with those symbols in the specified -package whose print names contain STRING as substring. STRING may be a -symbol, in which case the print-name of that symbol is used. If PACKAGE is -NIL, then all packages are searched." - (apropos-doc string package)) - ;;; Pretty-print-formats. ;;; ;;; The number N as the property of a symbol SYMBOL indicates that, diff --git a/src/lsp/describe.lsp b/src/lsp/describe.lsp index 3f0d71b80..783c4ce05 100644 --- a/src/lsp/describe.lsp +++ b/src/lsp/describe.lsp @@ -540,20 +540,20 @@ inspect commands, or type '?' to the inspector." (format t "~&No documentation for ~:@(~S~)." symbol)) (values)))) -(defun apropos-doc (string &optional (package "CL") &aux (f nil)) - (setq string (string string)) - (if package - (do-symbols (symbol package) - (when (search string (string symbol) :test #'char-equal) - (setq f (or (print-doc symbol t) f)))) - (do-all-symbols (symbol) - (when (search string (string symbol) :test #'char-equal) - (setq f (or (print-doc symbol t) f))))) - (if f - (format t "~&-----------------------------------------------------------------------------") - (format t "~&No documentation for ~S in ~:[any~;~A~] package." - string package - (and package (package-name (coerce-to-package package))))) +(defun help* (string &optional (package "CL")) + "Args: (string &optional (package-spec 'lisp)) +ECL specific. +Prints the documentation associated with those symbols in the specified +package whose print names contain STRING as substring. STRING may be a +symbol, in which case the print-name of that symbol is used. If PACKAGE is +NIL, then all packages are searched." + (do* ((f nil) + (l (apropos-list string package) (cdr l))) + ((endp l) + (format t (if f + "~&-----------------------------------------------------------------------------" + "~&No documentation for ~S in ~:[any~;~A~] package.") + string package (and package (package-name (coerce-to-package package))))) + (when (print-doc (first l) t) + (setf f t))) (values)) - -;(provide 'describe) diff --git a/src/lsp/load.lsp.in b/src/lsp/load.lsp.in index 8c88418d1..ad8455459 100644 --- a/src/lsp/load.lsp.in +++ b/src/lsp/load.lsp.in @@ -12,7 +12,6 @@ "src:lsp;helpfile.lsp" "src:lsp;evalmacros.lsp" "src:lsp;autoload.lsp" - "src:lsp;describe.lsp" "src:lsp;setf.lsp" "src:lsp;predlib.lsp" "src:lsp;seq.lsp" @@ -37,6 +36,7 @@ #+tk "src:lsp;tk-init.lsp" "build:lsp;config.lsp" + "src:lsp;describe.lsp" "src:lsp;module.lsp" "src:lsp;cmdline.lsp" "src:lsp;top.lsp" diff --git a/src/lsp/packlib.lsp b/src/lsp/packlib.lsp index f2816baba..ee853e208 100644 --- a/src/lsp/packlib.lsp +++ b/src/lsp/packlib.lsp @@ -150,39 +150,24 @@ to NIL) and returns all values." Prints those symbols whose print-names contain STRING as substring. If PACKAGE is non-NIL, then only the specified PACKAGE is searched." (setq string (string string)) - (cond (package - (do-symbols (symbol package) - (when (search string (string symbol)) - (print-symbol-apropos symbol))) - (do ((p (package-use-list package) (cdr p))) - ((null p)) - (do-external-symbols (symbol (car p)) - (when (search string (string symbol)) - (print-symbol-apropos symbol))))) - (t - (do-all-symbols (symbol) - (when (search string (string symbol)) - (print-symbol-apropos symbol))))) + (mapc #'print-symbol-apropos (apropos-list string package)) (values)) -(defun apropos-list (string &optional package &aux list) +(defun apropos-list (string &optional package) "Args: (string &optional (package nil)) Returns a list of all symbols whose print-names contain STRING as substring. If PACKAGE is non-NIL, then only the specified PACKAGE is searched." - (setq list nil) - (setq string (string string)) - (cond (package - (do-symbols (symbol package) - (when (search string (string symbol)) - (setq list (cons symbol list)))) - (do ((p (package-use-list package) (cdr p))) - ((null p)) - (do-symbols (symbol (car p)) - (when (search string (string symbol)) - (setq list (cons symbol list)))))) - (t - (do-all-symbols (symbol) - (when (search string (string symbol)) - (setq list (cons symbol list)))))) - list) + (let* ((list '()) + (string (string string))) + (cond (package + (dolist (p (package-use-list package)) + (setf list (nconc (apropos-list string p) list))) + (do-symbols (symbol package) + (when (search string (string symbol) :test #'char-equal) + (setq list (cons symbol list))))) + (t + (do-all-symbols (symbol) + (when (search string (string symbol) :test #'char-equal) + (setq list (cons symbol list)))))) + list))