[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: The apropos-dialog



    Date: Tue, 3 Mar 1992 09:25 PST
    From: bill@cambridge.apple.com (Bill St. Clair)

    I use the Apropos dialog only once or twice a week. I invoke the apropos
    function in the Listener just about as often. The only new feature that
    I would ever use would be the ability to limit output to fbound or bound
    symbols. I'd also like to be able to control-click on one of the symbols
    to edit its definition. I'm glad to hear that some of you are excited about
    having a snazzier Apropos dialog, and look forward to seeing it appear
    on our Anonymous FTP server and the MCL CD.

The feature that I missed almost every time that I used APROPOS
was the ability to do an AND on multiple search keys.  I think
that earlier messages in this thread said that the advanced
APROPOS tool supported this, but until then, here is a
APROPOS-like function that takes a list of keys as the first
argument.  A usage example follows the definition.

Warning: this function calls undocumented internals of MCL, and
will therefore probably break in some future release.

(defun find-syms (parts &optional package)
  (when package (setq package (find-package package)))
  ;; Usually get passed a list of symbols.
  (setq parts (mapcar #'string parts))
  (flet ((check-sym (sym)
           (let ((sym-name (symbol-name sym)))
             ;; Make sure the symbol contains all the keys.
             (when (every #'(lambda (part)
                              #+ignore
                              (search part sym-name :test #'char-equal)
                              ;; A useful internal call, seems faster
                              ;; than the "clean" version above
                              (ccl::%apropos-substring-p part sym-name))
                          parts)
               #+ignore
               (print sym)
               ;; Another internal, useful for printing out the BOUNDP
               ;; and FBOUNDP info.  Unfortunately, it does one more
               ;; search of the key on the sym before printing, but then
               ;; again, APROPOS wasn't designed to provide useful modules
               ;; that some APROPOS-replacement could call.
               (ccl::apropos-aux "" sym)
               ))))
    ;; Call the appropriate (undocumented, internal) function for
    ;; mapping over symbols.
    (if package
      (ccl::iterate-over-accessable-symbols package #'check-sym)
      (ccl::iterate-over-all-symbols #'check-sym))))


----------------
Before:

? (apropos 'forward)
INSPECTOR::FORWARDED-P, Def: STANDARD-GENERIC-FUNCTION
FORWARD
SETF::|INSPECTOR::FORWARDED-P|, Def: STANDARD-GENERIC-FUNCTION
ED-I-SEARCH-FORWARD, Def: STANDARD-GENERIC-FUNCTION
ED-KILL-FORWARD-SEXP, Def: STANDARD-GENERIC-FUNCTION
ED-FORWARD-SELECT-SEXP, Def: STANDARD-GENERIC-FUNCTION
ED-FORWARD-SELECT-WORD, Def: STANDARD-GENERIC-FUNCTION
ED-FORWARD-SELECT-CHAR, Def: STANDARD-GENERIC-FUNCTION
ED-FORWARD-WORD, Def: STANDARD-GENERIC-FUNCTION
ED-FORWARD-CHAR, Def: STANDARD-GENERIC-FUNCTION
ED-FORWARD-SEXP, Def: STANDARD-GENERIC-FUNCTION
ED-DELETE-FORWARD-WHITESPACE, Def: STANDARD-GENERIC-FUNCTION
CCL::FORWARDING-WRAPPER-HASH-TABLE, Def: FUNCTION
CCL::BUFFER-FORWARD-SEARCH-UNQUOTED, Def: FUNCTION
CCL::BUFFER-FORWARD-FIND-CHAR, Def: FUNCTION
CCL::BUFFER-FORWARD-SEARCH, Def: FUNCTION
CCL::%FORWARD-INSTANCE, Def: FUNCTION
CCL::*I-SEARCH-FORWARD-P*,  Value: NIL
CCL::%MAYBE-FORWARDED-INSTANCE, Def: FUNCTION
CCL::BUFFER-FORWARD-FIND-NOT-CHAR, Def: FUNCTION
CCL::*FORWARDING-WRAPPER-HASH-TABLE*,  Value: #<HASH-TABLE :TEST EQ size 0/60 #x2D9C51>
CCL::ED-DELETE-FORWARD-WHITESPACE-1, Def: FUNCTION
:FORWARD,  Value: :FORWARD


After:

? (find-syms '(forward char))
ED-FORWARD-SELECT-CHAR, Def: STANDARD-GENERIC-FUNCTION
ED-FORWARD-CHAR, Def: STANDARD-GENERIC-FUNCTION
CCL::BUFFER-FORWARD-FIND-CHAR, Def: FUNCTION
CCL::BUFFER-FORWARD-FIND-NOT-CHAR, Def: FUNCTION
NIL
?