comparison lisp/man.el @ 59398:c47c12607f08

(Man-xref-man-page, Man-xref-header-file) (Man-xref-normal-file): Add follow-link property.
author Kim F. Storm <storm@cua.dk>
date Thu, 06 Jan 2005 22:00:56 +0000
parents 07f5b835edb6
children 71d8a58f6f27 cb67264d6096
comparison
equal deleted inserted replaced
59397:fcfd5e8c8e77 59398:c47c12607f08
413 ) 413 )
414 414
415 ;; buttons 415 ;; buttons
416 (define-button-type 'Man-xref-man-page 416 (define-button-type 'Man-xref-man-page
417 'action (lambda (button) (man-follow (button-label button))) 417 'action (lambda (button) (man-follow (button-label button)))
418 'help-echo "RET, mouse-2: display this man page") 418 'follow-link t
419 'help-echo "mouse-2, RET: display this man page")
419 420
420 (define-button-type 'Man-xref-header-file 421 (define-button-type 'Man-xref-header-file
421 'action (lambda (button) 422 'action (lambda (button)
422 (let ((w (button-get button 'Man-target-string))) 423 (let ((w (button-get button 'Man-target-string)))
423 (unless (Man-view-header-file w) 424 (unless (Man-view-header-file w)
424 (error "Cannot find header file: %s" w)))) 425 (error "Cannot find header file: %s" w))))
426 'follow-link t
425 'help-echo "mouse-2: display this header file") 427 'help-echo "mouse-2: display this header file")
426 428
427 (define-button-type 'Man-xref-normal-file 429 (define-button-type 'Man-xref-normal-file
428 'action (lambda (button) 430 'action (lambda (button)
429 (let ((f (substitute-in-file-name 431 (let ((f (substitute-in-file-name
431 (if (file-exists-p f) 433 (if (file-exists-p f)
432 (if (file-readable-p f) 434 (if (file-readable-p f)
433 (view-file f) 435 (view-file f)
434 (error "Cannot read a file: %s" f)) 436 (error "Cannot read a file: %s" f))
435 (error "Cannot find a file: %s" f)))) 437 (error "Cannot find a file: %s" f))))
438 'follow-link t
436 'help-echo "mouse-2: display this file") 439 'help-echo "mouse-2: display this file")
437 440
438 441
439 ;; ====================================================================== 442 ;; ======================================================================
440 ;; utilities 443 ;; utilities