about summary refs log tree commit diff
diff options
context:
space:
mode:
authorDaniel Shahaf <d.s@daniel.shahaf.name>2016-10-22 21:54:07 +0000
committerDaniel Shahaf <d.s@daniel.shahaf.name>2016-10-24 00:53:45 +0000
commit71dd0ab62ecf67e3a4a60749e9f5b1cfc9ac0ec4 (patch)
tree5da98862f9c92cda523da50a5868e92803ea5628
parent4eef3e6f0e2f7e258c961b30cef7f4d463fb8b2f (diff)
downloadzsh-71dd0ab62ecf67e3a4a60749e9f5b1cfc9ac0ec4.tar.gz
zsh-71dd0ab62ecf67e3a4a60749e9f5b1cfc9ac0ec4.tar.xz
zsh-71dd0ab62ecf67e3a4a60749e9f5b1cfc9ac0ec4.zip
39706: _tilde_files: Offer named directories. Document.
-rw-r--r--ChangeLog3
-rw-r--r--Completion/Unix/Type/_tilde_files3
-rw-r--r--Doc/Zsh/compsys.yo6
3 files changed, 11 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 7debe2d83..717f25e76 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2016-10-24  Daniel Shahaf  <d.s@daniel.shahaf.name>
 
+	* 39706: Completion/Unix/Type/_tilde_files, Doc/Zsh/compsys.yo:
+	_tilde_files: Offer named directories. Document.
+
 	* 39708: Completion/Unix/Type/_email_addresses,
 	Doc/Zsh/compsys.yo: Document _email_addresses.
 
diff --git a/Completion/Unix/Type/_tilde_files b/Completion/Unix/Type/_tilde_files
index ee6b18088..b1b3b37f0 100644
--- a/Completion/Unix/Type/_tilde_files
+++ b/Completion/Unix/Type/_tilde_files
@@ -30,7 +30,8 @@ case "$PREFIX" in
   ;;
 \~*)
   compset -P '?'
-  _users "$@"
+  local -a expl=( "$@" )
+  _alternative -O expl users:user:_users named-directories:'named directory':'compadd -k nameddirs'
   ;;
 *)
   _files "$@"
diff --git a/Doc/Zsh/compsys.yo b/Doc/Zsh/compsys.yo
index 33ba92c16..42482760b 100644
--- a/Doc/Zsh/compsys.yo
+++ b/Doc/Zsh/compsys.yo
@@ -5019,6 +5019,12 @@ allows tt(_tags) to use a more
 specific context without having to change and reset the
 tt(curcontext) parameter (which has the same effect).
 )
+findex(_tilde_files)
+item(tt(_tilde_files))(
+Like tt(_files), but resolve leading tildes according to the rules of
+filename expansion, so the suggested completions don't start with
+a `tt(~)' even if the filename on the command-line does.
+)
 findex(_values)
 item(tt(_values) [ tt(-O) var(name) ] [ tt(-s) var(sep) ] [ tt(-S) var(sep) ] [ tt(-wC) ] var(desc) var(spec) ...)(
 This is used to complete arbitrary keywords (values) and their arguments,