help / color / mirror / code / Atom feed
From: Roman Perepelitsa <roman.perepelitsa@gmail.com>
To: Thomas Lauer <thomas.lauer@virgin.net>
Cc: zsh-users@zsh.org
Subject: Re: completing .directories without . and ..
Date: Tue, 21 Feb 2023 20:14:22 +0100	[thread overview]
Message-ID: <CAN=4vMqCNYyyW0UZn3uV2h7zKfqvNxnp-9gLuqmN0JU0CG+bZA@mail.gmail.com> (raw)
In-Reply-To: <a2u9vhthr8vqcj51iglh2o5je3qete0b7i@tlc.com>

On Tue, Feb 21, 2023 at 5:59 PM Thomas Lauer <thomas.lauer@virgin.net> wrote:
> From: Roman Perepelitsa <roman.perepelitsa@gmail.com>
> Date: Tue, 21 Feb 2023 17:48:44 +0100
> > See "special-dirs" in `man zshcompsys` for documentation.
> Right. I knew it was something simple but all my attempts to find that
> simple thing were getting nowhere.

Here's a hypothetical yet plausible way how you could've found it.

First, look at `man zsh`. At the very top it has an index. Given that
you are trying to customize completions, there are 3 candidates that
mention completions:

    zshcompwid   Zsh completion widgets
    zshcompsys   Zsh completion system
    zshcompctl   Zsh completion control

zshcompctl is a trap. Hopefully you wouldn't fall for it given this
sentence at the top of it:

    New users of the shell may prefer to use the newer and more
    powerful system based on shell functions; this is described in
    zshcompsys(1), and the basic shell mechanisms which
    support it are described in zshcompwid(1).

This hints that zshcompwid isn't what you want either. Let's check it anyway:

    A  complete set of shell functions based on these features is
    described in zshcompsys(1), and users with no interest in
    adding to that system (or, potentially, writing their own -- see
    dictionary entry for `hubris') should skip the current section.
    The older system based on the compctl builtin command is
    described in zshcompctl(1).

This confirms that zshcompctl is a trap that you should avoid, and
that zshcompwid describes the low level API on top of which the
user-facing zshcompsys is built.

Hopefully, eventually you would've looked at zshcompcsys. Searching
".." would then land you on special-dirs fairly quickly.

Note that if you already knew that the user-facing docs for
completions are in zshcompsys, the search would be fairly

There are only 9 zsh man pages that I ever look at (plus zshall if I'm
unsure which one I need), and I remember their names by now. Before I
learned them, I often opened `man zsh` to see the list of section
names with short descriptions.


  parent reply	other threads:[~2023-02-21 19:15 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-21 16:38 Thomas Lauer
2023-02-21 16:48 ` Roman Perepelitsa
2023-02-21 16:59   ` Thomas Lauer
2023-02-21 17:14     ` Ray Andrews
2023-02-21 18:09       ` Thomas Lauer
2023-02-21 19:14     ` Roman Perepelitsa [this message]
2023-02-21 21:25       ` Ray Andrews
2023-02-21 22:11       ` Bart Schaefer
2023-02-22 13:16       ` Thomas Lauer
2023-02-22 13:31         ` Thomas Lauer

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:

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

  git send-email \
    --in-reply-to='CAN=4vMqCNYyyW0UZn3uV2h7zKfqvNxnp-9gLuqmN0JU0CG+bZA@mail.gmail.com' \
    --to=roman.perepelitsa@gmail.com \
    --cc=thomas.lauer@virgin.net \
    --cc=zsh-users@zsh.org \


* 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


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).