# HG changeset patch # User Juri Linkov # Date 1198431352 0 # Node ID fb00bf8f41d74687d440d73e9cef0802387bf5bc # Parent 32e5aafa903ccb85e04de0e923cee515833d4046 (Man-follow-manual-reference): Fill the minibuffer's default list with a full list of references. diff -r 32e5aafa903c -r fb00bf8f41d7 lisp/man.el --- a/lisp/man.el Sun Dec 23 16:07:54 2007 +0000 +++ b/lisp/man.el Sun Dec 23 17:35:52 2007 +0000 @@ -1380,25 +1380,32 @@ (interactive (if (not Man-refpages-alist) (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-alist)) - (aheadsym Man-refpages-alist))) - chosen - (prompt (concat "Refer to (default " default "): "))) - (setq chosen (completing-read prompt Man-refpages-alist)) - (if (or (not chosen) - (string= chosen "")) - default - chosen))))) + (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-alist)) + (aheadsym Man-refpages-alist))) + (defaults + (mapcar 'substring-no-properties + (delete-dups + (delq nil (cons default + (mapcar 'car Man-refpages-alist)))))) + chosen + (prompt (concat "Refer to (default " default "): "))) + (setq chosen (completing-read prompt Man-refpages-alist + nil nil nil nil defaults)) + (if (or (not chosen) + (string= chosen "")) + default + chosen))))) (if (not Man-refpages-alist) (error "Can't find any references in the current manpage") (aput 'Man-refpages-alist reference)