[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: The apropos-dialog
- To: cartier@math.uqam.ca (Guillaume Cartier)
- Subject: Re: The apropos-dialog
- From: Michael Travers <mt@media.mit.edu>
- Date: Fri, 28 Feb 92 13:07:40 -0500
- Cc: info-mcl@cambridge.apple.com (Macintosh Common Lisp)
- In-reply-to: Your message of "Fri, 28 Feb 92 09:39:34 EST." <9202281439.AA10377@mipsmath>
I have a useful extension to the apropos dialog that indicates which
symbols have bindings or function bindings by modifying the text
style. The code is enclosed.
The other suggestions sound good, but I'd urge whoever implements them
to use dialog items to control the options rather than magic mouse
clicks.
________________________________________________________________
;;; apropos-style.lisp
(in-package :cl-user)
#|
Indicate bindings in apropos dialog by means of font styles.
Todo: put a key in the header of the window
|#
(defparameter fbound-style '("monaco" 9 :bold))
(defparameter bound-style '("monaco" 9 :italic))
(defparameter both-bound-style '("monaco" 9 :bold :italic))
(defmethod fontify-apropos-dialog ((d apropos-dialog))
(with-slots (table-item) d
(dotimes (cell-v (point-v (table-dimensions table-item)))
(let ((symbol (cell-contents table-item 0 cell-v)))
(set-cell-font table-item (make-point 0 cell-v)
(cond ((and (fboundp symbol)
(boundp symbol))
both-bound-style)
((fboundp symbol)
fbound-style)
((boundp symbol)
bound-style)
(t nil)))))))
(advise ccl::apropos-search
(fontify-apropos-dialog (car arglist))
:when :after :name :fontify)