comparison lisp/apropos.el @ 17417:c351a7e1880c

(apropos): Add support for faces, widgets, and user options. (apropos-print): Ditto.
author Richard M. Stallman <rms@gnu.org>
date Sat, 12 Apr 1997 18:49:35 +0000
parents 81e18e642412
children 7512243efd89
comparison
equal deleted inserted replaced
17416:c0c355e7934c 17417:c351a7e1880c
179 (and (not do-all) 179 (and (not do-all)
180 (not apropos-do-all) 180 (not apropos-do-all)
181 (lambda (symbol) 181 (lambda (symbol)
182 (or (fboundp symbol) 182 (or (fboundp symbol)
183 (boundp symbol) 183 (boundp symbol)
184 (facep symbol)
184 (symbol-plist symbol)))))) 185 (symbol-plist symbol))))))
185 (apropos-print 186 (apropos-print
186 (or do-all apropos-do-all) 187 (or do-all apropos-do-all)
187 (lambda (p) 188 (lambda (p)
188 (let (symbol doc properties) 189 (let (symbol doc properties)
200 "(not documented)")) 201 "(not documented)"))
201 (when (setq properties (symbol-plist symbol)) 202 (when (setq properties (symbol-plist symbol))
202 (setq doc (list (car properties))) 203 (setq doc (list (car properties)))
203 (while (setq properties (cdr (cdr properties))) 204 (while (setq properties (cdr (cdr properties)))
204 (setq doc (cons (car properties) doc))) 205 (setq doc (cons (car properties) doc)))
205 (mapconcat #'symbol-name (nreverse doc) " ")))) 206 (mapconcat #'symbol-name (nreverse doc) " "))
207 (when (get symbol 'widget-type)
208 (if (setq doc (documentation-property
209 symbol 'widget-documentation t))
210 (substring doc 0
211 (string-match "\n" doc))
212 "(not documented)"))
213 (when (facep symbol)
214 (if (setq doc (documentation-property
215 symbol 'face-documentation t))
216 (substring doc 0
217 (string-match "\n" doc))
218 "(not documented)"))))
206 (setq p (cdr p))))) 219 (setq p (cdr p)))))
207 nil)) 220 nil))
208 221
209 222
210 ;;;###autoload 223 ;;;###autoload
515 "Command" 528 "Command"
516 (if (apropos-macrop symbol) 529 (if (apropos-macrop symbol)
517 "Macro" 530 "Macro"
518 "Function")) 531 "Function"))
519 do-keys) 532 do-keys)
520 (apropos-print-doc 'describe-variable 2 533 (if (get symbol 'custom-type)
521 "Variable" do-keys) 534 (apropos-print-doc 'customize-variable-other-window 2
535 "User Option" do-keys)
536 (apropos-print-doc 'describe-variable 2
537 "Variable" do-keys))
538 (apropos-print-doc 'customize-face-other-window 5 "Face" do-keys)
539 (apropos-print-doc 'widget-browse-other-window 4 "Widget" do-keys)
522 (apropos-print-doc 'apropos-describe-plist 3 540 (apropos-print-doc 'apropos-describe-plist 3
523 "Plist" nil))))) 541 "Plist" nil)))))
524 (prog1 apropos-accumulator 542 (prog1 apropos-accumulator
525 (setq apropos-accumulator ()))) ; permit gc 543 (setq apropos-accumulator ()))) ; permit gc
526 544