comparison lisp/packages/apropos.el @ 4:b82b59fe008d r19-15b3

Import from CVS: tag r19-15b3
author cvs
date Mon, 13 Aug 2007 08:46:56 +0200
parents ac2d302a0011
children 49a24b4fd526
comparison
equal deleted inserted replaced
3:30df88044ec6 4:b82b59fe008d
64 ;; I see no reason why we should do so] 64 ;; I see no reason why we should do so]
65 (defvar apropos-do-all nil 65 (defvar apropos-do-all nil
66 "*Whether the apropos commands should do more. 66 "*Whether the apropos commands should do more.
67 Slows them down more or less. Set this non-nil if you have a fast machine.") 67 Slows them down more or less. Set this non-nil if you have a fast machine.")
68 68
69 (defvar apropos-symbol-face 'bold 69 ;; XEmacs addition
70 (defvar apropos-symbol-face (if (boundp 'font-lock-keyword-face)
71 font-lock-keyword-face
72 'bold)
70 "*Face for symbol name in apropos output or `nil'. 73 "*Face for symbol name in apropos output or `nil'.
71 This looks good, but slows down the commands several times.") 74 This looks good, but slows down the commands several times.")
72 75
73 (defvar apropos-keybinding-face 'underline 76 ;; XEmacs addition
77 (defvar apropos-keybinding-face (if (boundp 'font-lock-string-face)
78 font-lock-string-face
79 'underline)
74 "*Face for keybinding display in apropos output or `nil'. 80 "*Face for keybinding display in apropos output or `nil'.
75 This looks good, but slows down the commands several times.") 81 This looks good, but slows down the commands several times.")
76 82
77 (defvar apropos-label-face 'italic 83 ;; XEmacs addition
84 (defvar apropos-label-face (if (boundp 'font-lock-comment-face)
85 font-lock-comment-face
86 'italic)
78 "*Face for label (Command, Variable ...) in apropos output or `nil'. 87 "*Face for label (Command, Variable ...) in apropos output or `nil'.
79 If this is `nil' no mouse highlighting occurs. 88 If this is `nil' no mouse highlighting occurs.
80 This looks good, but slows down the commands several times. 89 This looks good, but slows down the commands several times.
81 When this is a face name, as it is initially, it gets transformed to a 90 When this is a face name, as it is initially, it gets transformed to a
82 text-property list for efficiency.") 91 text-property list for efficiency.")
83 92
84 (defvar apropos-property-face 'bold-italic 93 ;; XEmacs addition
94 (defvar apropos-property-face (if (boundp 'font-lock-variable-name-face)
95 font-lock-variable-name-face
96 'bold-italic)
85 "*Face for property name in apropos output or `nil'. 97 "*Face for property name in apropos output or `nil'.
86 This looks good, but slows down the commands several times.") 98 This looks good, but slows down the commands several times.")
87 99
88 (defvar apropos-match-face 'secondary-selection 100 (defvar apropos-match-face 'secondary-selection
89 "*Face for matching part in apropos-documentation/value output or `nil'. 101 "*Face for matching part in apropos-documentation/value output or `nil'.
92 104
93 (defvar apropos-mode-map 105 (defvar apropos-mode-map
94 (let ((map (make-sparse-keymap))) 106 (let ((map (make-sparse-keymap)))
95 (define-key map [(control m)] 'apropos-follow) 107 (define-key map [(control m)] 'apropos-follow)
96 (define-key map [(button2up)] 'apropos-mouse-follow) 108 (define-key map [(button2up)] 'apropos-mouse-follow)
97 (define-key map [(button2down)] 'undefined) 109 (define-key map [(button2)] 'undefined)
98 map) 110 map)
99 "Keymap used in Apropos mode.") 111 "Keymap used in Apropos mode.")
100 112
101 113
102 (defvar apropos-regexp nil 114 (defvar apropos-regexp nil
109 "Alist of symbols already found in current apropos run.") 121 "Alist of symbols already found in current apropos run.")
110 122
111 (defvar apropos-item () 123 (defvar apropos-item ()
112 "Current item in or for apropos-accumulator.") 124 "Current item in or for apropos-accumulator.")
113 125
126 (defvar apropos-mode-hook nil) ; XEmacs
127
114 (defun apropos-mode () 128 (defun apropos-mode ()
115 "Major mode for following hyperlinks in output of apropos commands. 129 "Major mode for following hyperlinks in output of apropos commands.
116 130
117 \\{apropos-mode-map}" 131 \\{apropos-mode-map}"
118 (interactive) 132 (interactive)
119 (kill-all-local-variables) 133 (kill-all-local-variables)
120 (use-local-map apropos-mode-map) 134 (use-local-map apropos-mode-map)
121 (setq major-mode 'apropos-mode 135 (setq major-mode 'apropos-mode
122 mode-name "Apropos")) 136 mode-name "Apropos")
137 (run-hooks 'apropos-mode-hook)) ; XEmacs
123 138
124 139
125 ;; For auld lang syne: 140 ;; For auld lang syne:
126 ;;;###autoload 141 ;;;###autoload
127 (fset 'command-apropos 'apropos-command) 142 (fset 'command-apropos 'apropos-command)
459 (funcall doc-fn apropos-accumulator)) 474 (funcall doc-fn apropos-accumulator))
460 (setq apropos-accumulator 475 (setq apropos-accumulator
461 (sort apropos-accumulator (lambda (a b) 476 (sort apropos-accumulator (lambda (a b)
462 (string-lessp (car a) (car b))))) 477 (string-lessp (car a) (car b)))))
463 (and apropos-label-face 478 (and apropos-label-face
464 (symbolp apropos-label-face) 479 (or (symbolp apropos-label-face)
480 (facep apropos-label-face)) ; XEMacs
465 (setq apropos-label-face `(face ,apropos-label-face 481 (setq apropos-label-face `(face ,apropos-label-face
466 mouse-face highlight))) 482 mouse-face highlight)))
467 (with-output-to-temp-buffer "*Apropos*" 483 (with-output-to-temp-buffer "*Apropos*"
468 (let ((p apropos-accumulator) 484 (let ((p apropos-accumulator)
469 (old-buffer (current-buffer)) 485 (old-buffer (current-buffer))
627 (put-text-property 8 (- (point) 14) 'face apropos-symbol-face)) 643 (put-text-property 8 (- (point) 14) 'face apropos-symbol-face))
628 (insert (apropos-format-plist symbol "\n ")) 644 (insert (apropos-format-plist symbol "\n "))
629 (princ ")") 645 (princ ")")
630 (print-help-return-message))) 646 (print-help-return-message)))
631 647
648 (provide 'apropos) ; XEmacs
649
632 ;;; apropos.el ends here 650 ;;; apropos.el ends here