Function: Man-follow-manual-reference

Man-follow-manual-reference is an interactive and byte-compiled function defined in man.el.gz.

Signature

(Man-follow-manual-reference REFERENCE)

Documentation

Get one of the manpages referred to in the "SEE ALSO" section.

Specify which REFERENCE to use; default is based on word at point.

Key Bindings

Source Code

;; Defined in /usr/src/emacs/lisp/man.el.gz
(defun Man-follow-manual-reference (reference)
  "Get one of the manpages referred to in the \"SEE ALSO\" section.
Specify which REFERENCE to use; default is based on word at point."
  (interactive
   (if (not Man--refpages)
       (error "There are no references in the current man page")
     (list
      (let* ((default (or
		       (car (all-completions
			     (let ((word
				    (or (Man-possibly-hyphenated-word)
					"")))
			       ;; strip a trailing '-':
			       (if (string-match "-$" word)
				   (substring word 0
					      (match-beginning 0))
				 word))
			     Man--refpages))
                       (if (member Man--last-refpage Man--refpages)
                           Man--last-refpage
                         (car Man--refpages))))
	     (defaults
	       (mapcar 'substring-no-properties
                       (cons default Man--refpages)))
             (prompt (format-prompt "Refer to" default))
	     (chosen (completing-read prompt Man--refpages
				      nil nil nil nil defaults)))
        chosen)))
   man-common)
  (if (not Man--refpages)
      (error "Can't find any references in the current manpage")
    (setq Man--last-refpage reference)
    (Man-getpage-in-background
     (Man-translate-references reference))))