comparison lisp/apropos.el @ 25752:bb28bbb732db

(apropos-symbol-face): Non-nil even for ttys. (apropos-keybinding-face, apropos-label-face): Likewise. (apropos-property-face, apropos-match-face): Likewise. (apropos-label-properties): New variable. (apropos-print-doc): Use apropos-label-properties. (apropos-print): Set apropos-label-properties.
author Richard M. Stallman <rms@gnu.org>
date Fri, 17 Sep 1999 19:43:09 +0000
parents bbfc1bd58fcc
children 8a6fd8991465
comparison
equal deleted inserted replaced
25751:467b88fab665 25752:bb28bbb732db
69 Slows them down more or less. Set this non-nil if you have a fast machine." 69 Slows them down more or less. Set this non-nil if you have a fast machine."
70 :group 'apropos 70 :group 'apropos
71 :type 'boolean) 71 :type 'boolean)
72 72
73 73
74 (defcustom apropos-symbol-face (if window-system 'bold) 74 (defcustom apropos-symbol-face 'bold
75 "*Face for symbol name in apropos output or `nil'. 75 "*Face for symbol name in Apropos output, or nil for none."
76 This looks good, but slows down the commands several times."
77 :group 'apropos 76 :group 'apropos
78 :type 'face) 77 :type 'face)
79 78
80 (defcustom apropos-keybinding-face (if window-system 'underline) 79 (defcustom apropos-keybinding-face 'underline
81 "*Face for keybinding display in apropos output or `nil'. 80 "*Face for lists of keybinding in Apropos output, or nil for none."
82 This looks good, but slows down the commands several times."
83 :group 'apropos 81 :group 'apropos
84 :type 'face) 82 :type 'face)
85 83
86 (defcustom apropos-label-face (if window-system 'italic) 84 (defcustom apropos-label-face 'italic
87 "*Face for label (Command, Variable ...) in apropos output or `nil'. 85 "*Face for label (`Command', `Variable' ...) in Apropos output.
88 If this is `nil' no mouse highlighting occurs. 86 A value of nil means don't use any special font for them, and also
89 This looks good, but slows down the commands several times. 87 turns off mouse highlighting."
90 When this is a face name, as it is initially, it gets transformed to a
91 text-property list for efficiency."
92 :group 'apropos 88 :group 'apropos
93 :type 'face) 89 :type 'face)
94 90
95 (defcustom apropos-property-face (if window-system 'bold-italic) 91 (defcustom apropos-property-face 'bold-italic
96 "*Face for property name in apropos output or `nil'. 92 "*Face for property name in apropos output, or nil for none."
97 This looks good, but slows down the commands several times."
98 :group 'apropos 93 :group 'apropos
99 :type 'face) 94 :type 'face)
100 95
101 (defcustom apropos-match-face (if window-system 'secondary-selection) 96 (defcustom apropos-match-face 'secondary-selection
102 "*Face for matching part in apropos-documentation/value output or `nil'. 97 "*Face for matching text in Apropos documentation/value, or nil for none.
103 This looks good, but slows down the commands several times." 98 This applies when you look for matches in the documentation or variable value
99 for the regexp; the part that matches gets displayed in this font."
104 :group 'apropos 100 :group 'apropos
105 :type 'face) 101 :type 'face)
106 102
107 103
108 (defvar apropos-mode-map 104 (defvar apropos-mode-map
492 nil 488 nil
493 function)) 489 function))
494 490
495 491
496 492
493 (defvar apropos-label-properties nil
494 "List of face properties to use for a label.
495 Bound by `apropos-print' for use by `apropos-print-doc'.")
496
497 (defun apropos-print (do-keys spacing) 497 (defun apropos-print (do-keys spacing)
498 "Output result of apropos searching into buffer `*Apropos*'. 498 "Output result of apropos searching into buffer `*Apropos*'.
499 The value of `apropos-accumulator' is the list of items to output. 499 The value of `apropos-accumulator' is the list of items to output.
500 Each element should have the format (SYMBOL FN-DOC VAR-DOC [PLIST-DOC]). 500 Each element should have the format (SYMBOL FN-DOC VAR-DOC [PLIST-DOC]).
501 The return value is the list that was in `apropos-accumulator', sorted 501 The return value is the list that was in `apropos-accumulator', sorted
504 (if (null apropos-accumulator) 504 (if (null apropos-accumulator)
505 (message "No apropos matches for `%s'" apropos-regexp) 505 (message "No apropos matches for `%s'" apropos-regexp)
506 (setq apropos-accumulator 506 (setq apropos-accumulator
507 (sort apropos-accumulator (lambda (a b) 507 (sort apropos-accumulator (lambda (a b)
508 (string-lessp (car a) (car b))))) 508 (string-lessp (car a) (car b)))))
509 (and apropos-label-face 509 (setq apropos-label-properties
510 (symbolp apropos-label-face) 510 (if (and apropos-label-face
511 (setq apropos-label-face `(face ,apropos-label-face 511 (symbolp apropos-label-face))
512 mouse-face highlight))) 512 `(face ,apropos-label-face
513 mouse-face highlight)))
513 (with-output-to-temp-buffer "*Apropos*" 514 (with-output-to-temp-buffer "*Apropos*"
514 (let ((p apropos-accumulator) 515 (let ((p apropos-accumulator)
515 (old-buffer (current-buffer)) 516 (old-buffer (current-buffer))
516 symbol item point1 point2) 517 symbol item point1 point2)
517 (set-buffer standard-output) 518 (set-buffer standard-output)
621 (progn 622 (progn
622 (insert " ") 623 (insert " ")
623 (put-text-property (- (point) 2) (1- (point)) 624 (put-text-property (- (point) 2) (1- (point))
624 'action action) 625 'action action)
625 (insert str ": ") 626 (insert str ": ")
626 (if apropos-label-face 627 (if apropos-label-properties
627 (add-text-properties (- (point) (length str) 2) 628 (add-text-properties (- (point) (length str) 2)
628 (1- (point)) 629 (1- (point))
629 apropos-label-face)) 630 apropos-label-properties))
630 (insert (if do-keys (substitute-command-keys i) i)) 631 (insert (if do-keys (substitute-command-keys i) i))
631 (or (bolp) (terpri))))) 632 (or (bolp) (terpri)))))
632 633
633 634
634 (defun apropos-mouse-follow (event) 635 (defun apropos-mouse-follow (event)