* lisp/minibuffer.el (completion-file-name-table): Complete user names.
authorStefan Monnier <monnier@iro.umontreal.ca>
Fri, 20 Apr 2012 19:56:59 +0000 (15:56 -0400)
committerStefan Monnier <monnier@iro.umontreal.ca>
Fri, 20 Apr 2012 19:56:59 +0000 (15:56 -0400)
lisp/ChangeLog
lisp/minibuffer.el

index 5b9e85e..132aee6 100644 (file)
@@ -1,3 +1,7 @@
+2012-04-20  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+       * minibuffer.el (completion-file-name-table): Complete user names.
+
 2012-04-20  Leo Liu  <sdl.web@gmail.com>
 
        * font-lock.el (lisp-font-lock-keywords-2): Add pcase, pcase-let
index c7e14ca..5a990f6 100644 (file)
@@ -1817,6 +1817,12 @@ same as `substitute-in-file-name'."
   (condition-case nil
       (cond
        ((eq action 'metadata) '(metadata (category . file)))
+       ((string-match-p "\\`~[^/\\]*\\'" string)
+        (completion-table-with-context "~"
+                                       (mapcar (lambda (u) (concat u "/"))
+                                               (system-users))
+                                       (substring string 1)
+                                       pred action))
        ((eq (car-safe action) 'boundaries)
         (let ((start (length (file-name-directory string)))
               (end (string-match-p "/" (cdr action))))