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