zsh-workers
 help / color / mirror / code / Atom feed
From: Daniel Shahaf <d.s@daniel.shahaf.name>
To: Jun T <takimoto-j@kba.biglobe.ne.jp>
Cc: zsh-workers@zsh.org
Subject: Re: How about separating "_arguments --" into a new function?
Date: Thu, 21 Oct 2021 14:15:57 +0000	[thread overview]
Message-ID: <20211021141557.GA16034@tarpaulin.shahaf.local2> (raw)
In-Reply-To: <CC5DEC06-57D9-4D4D-9289-FE90A9FFBF0F@kba.biglobe.ne.jp>

Jun T wrote on Mon, Oct 18, 2021 at 13:40:09 +0900:
> 
> > 2021/10/18 1:49, Daniel Shahaf <d.s@daniel.shahaf.name> wrote:
> > 
> >>>> Or just using $_args_cache_cmd is enough?
> >>> 
> >>> If it is enough, then it should be made more discoverable.
> >> 
> >> I guess it is enough since no one is requesting to separate _arguments.
> >> How about the following?
> >> 
> > 
> > Are we happy with documenting it as a first-class feature, i.e., one
> > that we would be expected to continue supporting?  Or would we rather
> > document this as a "we may change this in the future" thing?
> 
> I personally feel we don't need to document it (it's a kind of hidden
> feature). But you said it should be more discoverable. So where should
> it be documented? At the end ofEtc/completion-style-guide? Or as a
> comment at the top of _arguments?

Happy to leave the decision to you.  Either of these options sounds good
to me.

> > Would prefer «print -r --» in case of backslashes,
> 
> I think (qqq) takes care of backslashes etc., but will use print -r
> if it looks safer.

It's not just "looks safer"; it's a matter of correctness.  The content
of ${_args_cache_foo} need to be escaped once for their transit through
lex.c when _foo will be read by compinit, and once against «echo»'s
treatment of backslashes.  Thus, «print -r --» should be used _in
addition_ to ${(qqq)}, not instead of it.

Cheers,

Daniel


  reply	other threads:[~2021-10-21 14:16 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-08 16:12 Jun. T
2021-10-12 16:04 ` Daniel Shahaf
2021-10-14 10:58   ` Jun T
2021-10-17 16:49     ` Daniel Shahaf
2021-10-18  4:40       ` Jun T
2021-10-21 14:15         ` Daniel Shahaf [this message]
2021-10-24  9:53           ` Jun. T
2021-10-25 19: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=20211021141557.GA16034@tarpaulin.shahaf.local2 \
    --to=d.s@daniel.shahaf.name \
    --cc=takimoto-j@kba.biglobe.ne.jp \
    --cc=zsh-workers@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).