summaryrefslogtreecommitdiff
path: root/lisp/man.el
diff options
context:
space:
mode:
authorStefan Monnier <monnier@iro.umontreal.ca>2009-11-28 20:28:51 +0000
committerStefan Monnier <monnier@iro.umontreal.ca>2009-11-28 20:28:51 +0000
commitd7117720c988ea26414046f0e0eba9137326f1df (patch)
treec93e6246f3a5a94d65505ef080437a43c2ae7d50 /lisp/man.el
parent159e3ad54017b598056879885e481fb3b757b3a2 (diff)
downloademacs-d7117720c988ea26414046f0e0eba9137326f1df.tar.gz
(Man-completion-table): Make it easier to enter "<sec> <name>".
Diffstat (limited to 'lisp/man.el')
-rw-r--r--lisp/man.el5
1 files changed, 5 insertions, 0 deletions
diff --git a/lisp/man.el b/lisp/man.el
index d40f21c0ca8..de827d89ef6 100644
--- a/lisp/man.el
+++ b/lisp/man.el
@@ -789,6 +789,11 @@ POS defaults to `point'."
(push (substring comp 0 (match-beginning 0)) table)))
(completion-table-with-context (concat section " ") table
prefix pred action))
+ ;; If the current text looks like a possible section name,
+ ;; then add a completion entry that just adds a space so SPC
+ ;; can be used to insert a space.
+ (if (string-match "\\`[[:digit:]]" string)
+ (push (concat string " ") table))
(let ((res (complete-with-action action table string pred)))
;; In case we're completing to a single name that exists in
;; several sections, the longest prefix will look like "foo(".