zsh-users
 help / color / mirror / code / Atom feed
From: Bart Schaefer <schaefer@brasslantern.com>
To: "Peter Slížik" <peter.slizik@gmail.com>
Cc: Zsh Users <zsh-users@zsh.org>
Subject: Re: <Tab> completion does not insert a slash
Date: Wed, 11 Aug 2021 15:20:12 -0700	[thread overview]
Message-ID: <CAH+w=7bfH5w_U3CEvU9ea_wH6DsNVsurFNDcdiS=fvLyrOiFiA@mail.gmail.com> (raw)
In-Reply-To: <CAC-uhUBFM8O8THkkTXYbDibC_MmfJ5W_zunVZy-rogyPWR-TCQ@mail.gmail.com>

On Wed, Aug 11, 2021 at 1:23 PM Peter Slížik <peter.slizik@gmail.com> wrote:
>
> сре, 11. авг 2021. у 22:03 Peter Slížik <peter.slizik@gmail.com> је написао/ла:
>>
>> Sorry for the late reply, I tried both versions (with and without parentheses).

I don't know what "with and without parentheses" means here.

>> % cd sr<ctrl+x h>
>> tags in context :completion::complete:cd::
>> local-directories named-directories      (_cd)
>> users named-directories directory-stack  (_tilde _cd)
>> users                                    (_users _tilde _cd)
>>
>> % cd src/py<ctrl+x h>
>> tags in context :completion::complete:cd::
>> named-directories  (_cd)
>> local-directories  (_cd)
>>
>> % cd src/python/<ctrl+x h>
>> (no results)

Are there any subdirectories inside src/python/ ?  The only case in
which I can get this to reproduce is when there's nothing more to
complete.

If there are subdirectories, a possibility is that the permissions on
either the python directory or the subdirectories are preventing
further names from being found.

This is the case where you switch to running <ctrl+x ?> and look at
the trace file.

>> Do you think that there is anything suspicious? Personally I wonder why there are duplicated entries in the first case and why are the tags listed in a reversed order in the second case.

The output of c-x h is not sorted by the tag-order style, it's in the
order that the tags are populated by the completion function.  _cd
happens to check for named directories first.  In an actual completion
pass, filtering the display according to tag-order happens later,
after all the possible tags have been populated.

> OK, more clarification. I've used "zstyle ':completion:*:*:*:*:descriptions'".
>
> Now it seems that with the second completed path, the completion engine cannot decide between these two:
>
> % cd src/python<Tab>
> -- directory after cdablevar --
> -- local directory --

I don't have your set of "hash -d" entries nor your file structure,
but with the closest guess I can make using the zsh source tree, I get
that result only when there are no subdirectories left to complete.
What does (execution of, not completion of)
  ls -ld ~src/python/*(/)
show you at that point?

> Frankly, I still don't understand what the problem is, because I'm inside a dir pointed to by a named directory (src/ in this case) and both "directory after cdablevar" and "local directory" are the same directory anyway.

Whether they're the same directory doesn't actually matter; the tags
have caused them to be placed in separate groups, so as far as
completion is concerned they are different alternatives.  The
"directory after cdablevar" branch has gone down the full path
$src/python (and then hidden a prefix) whereas the local directory
branch has used the relative path src/python and completion is only
looking for unique strings, not filesystem targets.  The filesystem is
only examined to generate the strings that are compared.


  reply	other threads:[~2021-08-11 22:21 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-04 15:02 Peter Slížik
2021-08-04 15:45 ` Bart Schaefer
2021-08-04 16:49   ` Peter Slížik
2021-08-04 17:26     ` Bart Schaefer
2021-08-11 20:03       ` Peter Slížik
2021-08-11 20:23         ` Peter Slížik
2021-08-11 22:20           ` Bart Schaefer [this message]
2021-08-16 21:39             ` Peter Slížik
2021-08-16 21:41               ` Peter Slížik
2021-08-16 22:17               ` Bart Schaefer
2021-08-17  8:57                 ` Peter Slížik

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='CAH+w=7bfH5w_U3CEvU9ea_wH6DsNVsurFNDcdiS=fvLyrOiFiA@mail.gmail.com' \
    --to=schaefer@brasslantern.com \
    --cc=peter.slizik@gmail.com \
    --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).