]> git.eshelyaron.com Git - emacs.git/commitdiff
(Man-completion-table): Make it easier to enter "<sec> <name>".
authorStefan Monnier <monnier@iro.umontreal.ca>
Sat, 28 Nov 2009 20:28:51 +0000 (20:28 +0000)
committerStefan Monnier <monnier@iro.umontreal.ca>
Sat, 28 Nov 2009 20:28:51 +0000 (20:28 +0000)
lisp/ChangeLog
lisp/man.el

index 064ff1537574615e03b81e59538aa1743c0afa26..62f2dc5f4b5622a56bd07ce926de7388452b6f91 100644 (file)
@@ -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).
 
index d40f21c0ca8b78b483e94491976e13aeaa244aaf..de827d89ef6a2fba836523ab6901fd0d92542044 100644 (file)
@@ -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(".