comparison lisp/apropos.el @ 39706:4825323bc19f

(apropos-next-label-button): Use the presence of a `apropos-label' property to detect label buttons.
author Miles Bader <miles@gnu.org>
date Mon, 08 Oct 2001 16:35:33 +0000
parents 05b7a0e7b426
children 620762a412a6
comparison
equal deleted inserted replaced
39705:29172903e620 39706:4825323bc19f
195 'help-echo "mouse-2, RET: Display more help on this plist" 195 'help-echo "mouse-2, RET: Display more help on this plist"
196 'action (lambda (button) 196 'action (lambda (button)
197 (apropos-describe-plist (button-get button 'apropos-symbol)))) 197 (apropos-describe-plist (button-get button 'apropos-symbol))))
198 198
199 (defun apropos-next-label-button (pos) 199 (defun apropos-next-label-button (pos)
200 "Returns the next `apropos-label' button after POS, or nil if there's none. 200 "Returns the next apropos label button after POS, or nil if there's none.
201 Will also return nil if more than one `apropos-symbol' button is encountered 201 Will also return nil if more than one `apropos-symbol' button is encountered
202 before finding a label." 202 before finding a label."
203 (let* ((button (next-button pos t)) 203 (let* ((button (next-button pos t))
204 (already-hit-symbol nil) 204 (already-hit-symbol nil)
205 (button-type (and button (button-get button 'type)))) 205 (label (and button (button-get button 'apropos-label)))
206 (type (and button (button-get button 'type))))
206 (while (and button 207 (while (and button
207 (not (eq button-type 'apropos-label)) 208 (not label)
208 (or (not (eq button-type 'apropos-symbol)) 209 (or (not (eq type 'apropos-symbol))
209 (not already-hit-symbol))) 210 (not already-hit-symbol)))
210 (when (eq button-type 'apropos-symbol) 211 (when (eq type 'apropos-symbol)
211 (setq already-hit-symbol t)) 212 (setq already-hit-symbol t))
212 (setq button (next-button (button-start button))) 213 (setq button (next-button (button-start button)))
213 (when button 214 (when button
214 (setq button-type (button-get button 'type)))) 215 (setq label (button-get button 'apropos-label))
215 (and (eq button-type 'apropos-label) 216 (setq type (button-get button 'type))))
216 button))) 217 (and label button)))
217 218
218 219
219 ;;;###autoload 220 ;;;###autoload
220 (define-derived-mode apropos-mode fundamental-mode "Apropos" 221 (define-derived-mode apropos-mode fundamental-mode "Apropos"
221 "Major mode for following hyperlinks in output of apropos commands. 222 "Major mode for following hyperlinks in output of apropos commands.