comparison lisp/apropos.el @ 59021:cef0d0d34987

(apropos-symbol, apropos-function, apropos-macro) (apropos-command, apropos-variable, apropos-face, apropos-group) (apropos-widget, apropos-plist): Add follow-link property.
author Kim F. Storm <storm@cua.dk>
date Fri, 17 Dec 2004 15:17:22 +0000
parents b41192af5b23
children 253d4187af2d eac554634bfa
comparison
equal deleted inserted replaced
59020:9916bd512da7 59021:cef0d0d34987
161 ;;; Button types used by apropos 161 ;;; Button types used by apropos
162 162
163 (define-button-type 'apropos-symbol 163 (define-button-type 'apropos-symbol
164 'face apropos-symbol-face 164 'face apropos-symbol-face
165 'help-echo "mouse-2, RET: Display more help on this symbol" 165 'help-echo "mouse-2, RET: Display more help on this symbol"
166 'follow-link t
166 'action #'apropos-symbol-button-display-help 167 'action #'apropos-symbol-button-display-help
167 'skip t) 168 'skip t)
168 169
169 (defun apropos-symbol-button-display-help (button) 170 (defun apropos-symbol-button-display-help (button)
170 "Display further help for the `apropos-symbol' button BUTTON." 171 "Display further help for the `apropos-symbol' button BUTTON."
172 (or (apropos-next-label-button (button-start button)) 173 (or (apropos-next-label-button (button-start button))
173 (error "There is nothing to follow for `%s'" (button-label button))))) 174 (error "There is nothing to follow for `%s'" (button-label button)))))
174 175
175 (define-button-type 'apropos-function 176 (define-button-type 'apropos-function
176 'apropos-label "Function" 177 'apropos-label "Function"
178 'help-echo "mouse-2, RET: Display more help on this function"
179 'follow-link t
177 'action (lambda (button) 180 'action (lambda (button)
178 (describe-function (button-get button 'apropos-symbol))) 181 (describe-function (button-get button 'apropos-symbol))))
179 'help-echo "mouse-2, RET: Display more help on this function") 182
180 (define-button-type 'apropos-macro 183 (define-button-type 'apropos-macro
181 'apropos-label "Macro" 184 'apropos-label "Macro"
185 'help-echo "mouse-2, RET: Display more help on this macro"
186 'follow-link t
182 'action (lambda (button) 187 'action (lambda (button)
183 (describe-function (button-get button 'apropos-symbol))) 188 (describe-function (button-get button 'apropos-symbol))))
184 'help-echo "mouse-2, RET: Display more help on this macro") 189
185 (define-button-type 'apropos-command 190 (define-button-type 'apropos-command
186 'apropos-label "Command" 191 'apropos-label "Command"
192 'help-echo "mouse-2, RET: Display more help on this command"
193 'follow-link t
187 'action (lambda (button) 194 'action (lambda (button)
188 (describe-function (button-get button 'apropos-symbol))) 195 (describe-function (button-get button 'apropos-symbol))))
189 'help-echo "mouse-2, RET: Display more help on this command")
190 196
191 ;; We used to use `customize-variable-other-window' instead for a 197 ;; We used to use `customize-variable-other-window' instead for a
192 ;; customizable variable, but that is slow. It is better to show an 198 ;; customizable variable, but that is slow. It is better to show an
193 ;; ordinary help buffer and let the user click on the customization 199 ;; ordinary help buffer and let the user click on the customization
194 ;; button in that buffer, if he wants to. 200 ;; button in that buffer, if he wants to.
195 ;; Likewise for `customize-face-other-window'. 201 ;; Likewise for `customize-face-other-window'.
196 (define-button-type 'apropos-variable 202 (define-button-type 'apropos-variable
197 'apropos-label "Variable" 203 'apropos-label "Variable"
198 'help-echo "mouse-2, RET: Display more help on this variable" 204 'help-echo "mouse-2, RET: Display more help on this variable"
205 'follow-link t
199 'action (lambda (button) 206 'action (lambda (button)
200 (describe-variable (button-get button 'apropos-symbol)))) 207 (describe-variable (button-get button 'apropos-symbol))))
201 208
202 (define-button-type 'apropos-face 209 (define-button-type 'apropos-face
203 'apropos-label "Face" 210 'apropos-label "Face"
204 'help-echo "mouse-2, RET: Display more help on this face" 211 'help-echo "mouse-2, RET: Display more help on this face"
212 'follow-link t
205 'action (lambda (button) 213 'action (lambda (button)
206 (describe-face (button-get button 'apropos-symbol)))) 214 (describe-face (button-get button 'apropos-symbol))))
207 215
208 (define-button-type 'apropos-group 216 (define-button-type 'apropos-group
209 'apropos-label "Group" 217 'apropos-label "Group"
210 'help-echo "mouse-2, RET: Display more help on this group" 218 'help-echo "mouse-2, RET: Display more help on this group"
219 'follow-link t
211 'action (lambda (button) 220 'action (lambda (button)
212 (customize-group-other-window 221 (customize-group-other-window
213 (button-get button 'apropos-symbol)))) 222 (button-get button 'apropos-symbol))))
214 223
215 (define-button-type 'apropos-widget 224 (define-button-type 'apropos-widget
216 'apropos-label "Widget" 225 'apropos-label "Widget"
217 'help-echo "mouse-2, RET: Display more help on this widget" 226 'help-echo "mouse-2, RET: Display more help on this widget"
227 'follow-link t
218 'action (lambda (button) 228 'action (lambda (button)
219 (widget-browse-other-window (button-get button 'apropos-symbol)))) 229 (widget-browse-other-window (button-get button 'apropos-symbol))))
220 230
221 (define-button-type 'apropos-plist 231 (define-button-type 'apropos-plist
222 'apropos-label "Plist" 232 'apropos-label "Plist"
223 'help-echo "mouse-2, RET: Display more help on this plist" 233 'help-echo "mouse-2, RET: Display more help on this plist"
234 'follow-link t
224 'action (lambda (button) 235 'action (lambda (button)
225 (apropos-describe-plist (button-get button 'apropos-symbol)))) 236 (apropos-describe-plist (button-get button 'apropos-symbol))))
226 237
227 (defun apropos-next-label-button (pos) 238 (defun apropos-next-label-button (pos)
228 "Return the next apropos label button after POS, or nil if there's none. 239 "Return the next apropos label button after POS, or nil if there's none.