# HG changeset patch # User Miles Bader # Date 1002558933 0 # Node ID 4825323bc19fa8a3a1b8097aaf060477b8c388d7 # Parent 29172903e620a786457b814e68b9ebbc22b3d2c4 (apropos-next-label-button): Use the presence of a `apropos-label' property to detect label buttons. diff -r 29172903e620 -r 4825323bc19f lisp/apropos.el --- a/lisp/apropos.el Mon Oct 08 15:47:47 2001 +0000 +++ b/lisp/apropos.el Mon Oct 08 16:35:33 2001 +0000 @@ -197,23 +197,24 @@ (apropos-describe-plist (button-get button 'apropos-symbol)))) (defun apropos-next-label-button (pos) - "Returns the next `apropos-label' button after POS, or nil if there's none. + "Returns the next apropos label button after POS, or nil if there's none. Will also return nil if more than one `apropos-symbol' button is encountered before finding a label." (let* ((button (next-button pos t)) (already-hit-symbol nil) - (button-type (and button (button-get button 'type)))) + (label (and button (button-get button 'apropos-label))) + (type (and button (button-get button 'type)))) (while (and button - (not (eq button-type 'apropos-label)) - (or (not (eq button-type 'apropos-symbol)) + (not label) + (or (not (eq type 'apropos-symbol)) (not already-hit-symbol))) - (when (eq button-type 'apropos-symbol) + (when (eq type 'apropos-symbol) (setq already-hit-symbol t)) (setq button (next-button (button-start button))) (when button - (setq button-type (button-get button 'type)))) - (and (eq button-type 'apropos-label) - button))) + (setq label (button-get button 'apropos-label)) + (setq type (button-get button 'type)))) + (and label button))) ;;;###autoload