comparison lisp/apropos.el @ 42256:f06cb3ff301f

(apropos-print): SPACING is now nil or a separator string. (apropos-documentation, apropos-value): Pass a suitable string.
author Richard M. Stallman <rms@gnu.org>
date Sat, 22 Dec 2001 01:36:37 +0000
parents dfe41fbdcaa0
children 099200f97432
comparison
equal deleted inserted replaced
42255:262eaf1a389e 42256:f06cb3ff301f
384 (setq f (apropos-value-internal 'fboundp symbol 'symbol-function) 384 (setq f (apropos-value-internal 'fboundp symbol 'symbol-function)
385 p (apropos-format-plist symbol "\n " t))) 385 p (apropos-format-plist symbol "\n " t)))
386 (if (or f v p) 386 (if (or f v p)
387 (setq apropos-accumulator (cons (list symbol f v p) 387 (setq apropos-accumulator (cons (list symbol f v p)
388 apropos-accumulator)))))) 388 apropos-accumulator))))))
389 (apropos-print nil t)) 389 (apropos-print nil "\n----------------\n"))
390 390
391 391
392 ;;;###autoload 392 ;;;###autoload
393 (defun apropos-documentation (apropos-regexp &optional do-all) 393 (defun apropos-documentation (apropos-regexp &optional do-all)
394 "Show symbols whose documentation contain matches for APROPOS-REGEXP. 394 "Show symbols whose documentation contain matches for APROPOS-REGEXP.
422 (if v 422 (if v
423 (setcar (cdr apropos-item) v))) 423 (setcar (cdr apropos-item) v)))
424 (setq apropos-accumulator 424 (setq apropos-accumulator
425 (cons (list symbol f v) 425 (cons (list symbol f v)
426 apropos-accumulator))))))) 426 apropos-accumulator)))))))
427 (apropos-print nil t)) 427 (apropos-print nil "\n----------------\n"))
428 (kill-buffer standard-input)))) 428 (kill-buffer standard-input))))
429 429
430 430
431 (defun apropos-value-internal (predicate symbol function) 431 (defun apropos-value-internal (predicate symbol function)
432 (if (funcall predicate symbol) 432 (if (funcall predicate symbol)
583 "Output result of apropos searching into buffer `*Apropos*'. 583 "Output result of apropos searching into buffer `*Apropos*'.
584 The value of `apropos-accumulator' is the list of items to output. 584 The value of `apropos-accumulator' is the list of items to output.
585 Each element should have the format (SYMBOL FN-DOC VAR-DOC [PLIST-DOC]). 585 Each element should have the format (SYMBOL FN-DOC VAR-DOC [PLIST-DOC]).
586 The return value is the list that was in `apropos-accumulator', sorted 586 The return value is the list that was in `apropos-accumulator', sorted
587 alphabetically by symbol name; but this function also sets 587 alphabetically by symbol name; but this function also sets
588 `apropos-accumulator' to nil before returning." 588 `apropos-accumulator' to nil before returning.
589
590 If SPACING is non-nil, it should be a string;
591 separate items with that string."
589 (if (null apropos-accumulator) 592 (if (null apropos-accumulator)
590 (message "No apropos matches for `%s'" apropos-regexp) 593 (message "No apropos matches for `%s'" apropos-regexp)
591 (setq apropos-accumulator 594 (setq apropos-accumulator
592 (sort apropos-accumulator (lambda (a b) 595 (sort apropos-accumulator (lambda (a b)
593 (string-lessp (car a) (car b))))) 596 (string-lessp (car a) (car b)))))
604 (insert "In this buffer, go to the name of the command, or function," 607 (insert "In this buffer, go to the name of the command, or function,"
605 " or variable,\n" 608 " or variable,\n"
606 (substitute-command-keys 609 (substitute-command-keys
607 "and type \\[apropos-follow] to get full documentation.\n\n")) 610 "and type \\[apropos-follow] to get full documentation.\n\n"))
608 (while (consp p) 611 (while (consp p)
609 (or (not spacing) (bobp) (terpri)) 612 (when (and spacing (not (bobp)))
613 (princ spacing))
610 (setq apropos-item (car p) 614 (setq apropos-item (car p)
611 symbol (car apropos-item) 615 symbol (car apropos-item)
612 p (cdr p)) 616 p (cdr p))
613 (insert-text-button (symbol-name symbol) 617 (insert-text-button (symbol-name symbol)
614 'type 'apropos-symbol 618 'type 'apropos-symbol