zsh-users
 help / color / mirror / code / Atom feed
From: Daniel Shahaf <d.s@daniel.shahaf.name>
To: zsh-users@zsh.org
Subject: X=`cat ~/y` completion
Date: Fri, 03 Jun 2016 05:31:23 +0000	[thread overview]
Message-ID: <20160603053123.GA26773@fujitsu.shahaf.local2> (raw)

Consider the following two cases:

% X=`cat $HOME/t<TAB>
% X=`cat ~/t<TAB>

In 'zsh -f' + compinit, the former works but the latter doesn't.
I expect the latter to behave as the former does.

---

The last related discussion seems to be 35515/35539.

The `functions -t _main_complete` transcripts of the two cases first
diverge at _path_files:255, where «$HOME/t» takes the 'if' branch and
«~/» the 'else' path:

   % nl -ba _path_files
   253	# Now let's have a closer look at the string to complete.
   254	
   255	if [[ "$pre" = [^][*?#^\|\<\>\\]#(\`[^\`]#\`|\$)*/* && "$compstate[quote]" != \' ]]; then
   256	
   257	  # If there is a parameter expansion in the word from the line, we try
   258	  # to complete the beast by expanding the prefix and completing anything
   259	  # after the first slash after the parameter expansion.
   ⋮
   276	elif [[ "$pre[1]" = \~ && -z "$compstate[quote]" ]]; then
   277	
   278	  # It begins with `~', so remember anything before the first slash to be able
   279	  # to report it to the completion code. Also get an expanded version of it
   ⋮
   322	else
   323	  # If the string does not start with a `~' we don't remove a prefix from the
   324	  # string.
   ⋮
   353	fi


             reply	other threads:[~2016-06-03  5:31 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-03  5:31 Daniel Shahaf [this message]
2016-06-03 19:29 ` Bart Schaefer
2016-06-03 20:46   ` Daniel Shahaf

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160603053123.GA26773@fujitsu.shahaf.local2 \
    --to=d.s@daniel.shahaf.name \
    --cc=zsh-users@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).