comparison lisp/packages/apropos.el @ 72:b9518feda344 r20-0b31

Import from CVS: tag r20-0b31
author cvs
date Mon, 13 Aug 2007 09:03:46 +0200
parents 131b0175ea99
children c0c698873ce1
comparison
equal deleted inserted replaced
71:bae944334fa4 72:b9518feda344
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'.
91 103
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 [(button2)] 'apropos-mouse-follow) 108 (define-key map [(button2up)] 'apropos-mouse-follow)
109 (define-key map [(button2)] 'undefined)
97 map) 110 map)
98 "Keymap used in Apropos mode.") 111 "Keymap used in Apropos mode.")
99 112
100 113
101 (defvar apropos-regexp nil 114 (defvar apropos-regexp nil
108 "Alist of symbols already found in current apropos run.") 121 "Alist of symbols already found in current apropos run.")
109 122
110 (defvar apropos-item () 123 (defvar apropos-item ()
111 "Current item in or for apropos-accumulator.") 124 "Current item in or for apropos-accumulator.")
112 125
126 (defvar apropos-mode-hook nil) ; XEmacs
127
113 (defun apropos-mode () 128 (defun apropos-mode ()
114 "Major mode for following hyperlinks in output of apropos commands. 129 "Major mode for following hyperlinks in output of apropos commands.
115 130
116 \\{apropos-mode-map}" 131 \\{apropos-mode-map}"
117 (interactive) 132 (interactive)
118 (kill-all-local-variables) 133 (kill-all-local-variables)
119 (use-local-map apropos-mode-map) 134 (use-local-map apropos-mode-map)
120 (setq major-mode 'apropos-mode 135 (setq major-mode 'apropos-mode
121 mode-name "Apropos")) 136 mode-name "Apropos")
137 (run-hooks 'apropos-mode-hook)) ; XEmacs
122 138
123 139
124 ;; For auld lang syne: 140 ;; For auld lang syne:
125 ;;;###autoload 141 ;;;###autoload
126 (fset 'command-apropos 'apropos-command) 142 (fset 'command-apropos 'apropos-command)
458 (funcall doc-fn apropos-accumulator)) 474 (funcall doc-fn apropos-accumulator))
459 (setq apropos-accumulator 475 (setq apropos-accumulator
460 (sort apropos-accumulator (lambda (a b) 476 (sort apropos-accumulator (lambda (a b)
461 (string-lessp (car a) (car b))))) 477 (string-lessp (car a) (car b)))))
462 (and apropos-label-face 478 (and apropos-label-face
463 (symbolp apropos-label-face) 479 (or (symbolp apropos-label-face)
480 (facep apropos-label-face)) ; XEmacs
464 (setq apropos-label-face `(face ,apropos-label-face 481 (setq apropos-label-face `(face ,apropos-label-face
465 mouse-face highlight))) 482 mouse-face highlight)))
466 (with-output-to-temp-buffer "*Apropos*" 483 (with-output-to-temp-buffer "*Apropos*"
467 (let ((p apropos-accumulator) 484 (let ((p apropos-accumulator)
468 (old-buffer (current-buffer)) 485 (old-buffer (current-buffer))
626 (put-text-property 8 (- (point) 14) 'face apropos-symbol-face)) 643 (put-text-property 8 (- (point) 14) 'face apropos-symbol-face))
627 (insert (apropos-format-plist symbol "\n ")) 644 (insert (apropos-format-plist symbol "\n "))
628 (princ ")") 645 (princ ")")
629 (print-help-return-message))) 646 (print-help-return-message)))
630 647
648 (provide 'apropos) ; XEmacs
649
631 ;;; apropos.el ends here 650 ;;; apropos.el ends here