changeset 106301:8ba9aa88e9c7

(Man-completion-table): Make it easier to enter "<sec> <name>".
author Stefan Monnier <monnier@iro.umontreal.ca>
date Sat, 28 Nov 2009 20:28:51 +0000
parents 95d84b3cbe43
children ced392aa0bba
files lisp/ChangeLog lisp/man.el
diffstat 2 files changed, 7 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/ChangeLog	Sat Nov 28 20:20:39 2009 +0000
+++ b/lisp/ChangeLog	Sat Nov 28 20:28:51 2009 +0000
@@ -1,5 +1,7 @@
 2009-11-28  Stefan Monnier  <monnier@iro.umontreal.ca>
 
+	* man.el (Man-completion-table): Make it easier to enter "<sec> <name>".
+
 	* eshell/em-prompt.el (eshell-prompt-function): Abbreviate pwd, since
 	`cd' doesn't always do it for us (bug#5067).
 
--- a/lisp/man.el	Sat Nov 28 20:20:39 2009 +0000
+++ b/lisp/man.el	Sat Nov 28 20:28:51 2009 +0000
@@ -789,6 +789,11 @@
                   (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(".