From ed571ccb1d14abc788a29c3b3bbf08aa4b951ab8 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Fri, 20 Apr 2012 15:56:59 -0400 Subject: [PATCH] * lisp/minibuffer.el (completion-file-name-table): Complete user names. --- lisp/ChangeLog | 4 ++++ lisp/minibuffer.el | 6 ++++++ 2 files changed, 10 insertions(+) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 5b9e85ef29c..132aee66a9f 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,7 @@ +2012-04-20 Stefan Monnier + + * minibuffer.el (completion-file-name-table): Complete user names. + 2012-04-20 Leo Liu * font-lock.el (lisp-font-lock-keywords-2): Add pcase, pcase-let diff --git a/lisp/minibuffer.el b/lisp/minibuffer.el index c7e14ca481b..5a990f6ab35 100644 --- a/lisp/minibuffer.el +++ b/lisp/minibuffer.el @@ -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)))) -- 2.39.2