summaryrefslogtreecommitdiff
path: root/lisp/man.el
diff options
context:
space:
mode:
authorJuri Linkov <juri@jurta.org>2007-12-23 17:35:52 +0000
committerJuri Linkov <juri@jurta.org>2007-12-23 17:35:52 +0000
commitdebe92052c1c5451982e618e6c7057420a5a7f67 (patch)
tree03efe872cd39cce6fa1ec03ec474761c4c4be54f /lisp/man.el
parenta769e627ec3990b2d85cc919756f79939acc67e0 (diff)
downloademacs-debe92052c1c5451982e618e6c7057420a5a7f67.tar.gz
(Man-follow-manual-reference): Fill the minibuffer's
default list with a full list of references.
Diffstat (limited to 'lisp/man.el')
-rw-r--r--lisp/man.el45
1 files changed, 26 insertions, 19 deletions
diff --git a/lisp/man.el b/lisp/man.el
index ebf1ebc69bc..48639cd764b 100644
--- a/lisp/man.el
+++ b/lisp/man.el
@@ -1380,25 +1380,32 @@ Specify which REFERENCE to use; default is based on word at point."
(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)