zsh-workers
 help / color / mirror / code / Atom feed
From: Daniel Shahaf <d.s@daniel.shahaf.name>
To: Marlon Richert <marlon.richert@gmail.com>
Cc: Zsh hackers list <zsh-workers@zsh.org>
Subject: Re: Feature Patch: Use completion to view parameter values
Date: Mon, 29 Mar 2021 07:39:13 +0000	[thread overview]
Message-ID: <20210329073913.GP18178@tarpaulin.shahaf.local2> (raw)
In-Reply-To: <CAHLkEDtf6JqSn86duXjEuQFXGKJn8COcxnEypoOUV=V63SsdPQ@mail.gmail.com>

Marlon Richert wrote on Sun, Mar 28, 2021 at 23:53:29 +0300:
> +++ b/Completion/Zsh/Type/_parameters
> @@ -32,8 +37,18 @@ zstyle -t ":completion:${curcontext}:parameters"
> +if zstyle -t ":completion:${curcontext}:parameters" extra-verbose; then
> +  zstyle -s ":completion:${curcontext}:parameters" list-separator sep ||
> +    sep=--
> +  zformat -a disp " $sep " ${matches[@]:/(#m)*/"${MATCH}:${(Pkv@q+)MATCH}"}

What about parameters implemented by modules?  The getters of those may
run arbitrary code, and may have side effects: e.g., imagine an
$AUTOINCREMENT parameter that returns an incremented-by-one value every
time it's evaluated:

    % repeat 3 echo $AUTOINCREMENT
    1
    2
    3
    % echo $AUTOINCR<TAB><Enter>

Wouldn't that print «5»?

Cheers,

Daniel


> +  disp=( "${disp[@]:/(#m)*/$MATCH[1,COLUMNS]}" )
> +  dopt=( -d disp )
> +fi


  reply	other threads:[~2021-03-29  7:39 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-28 20:53 Marlon Richert
2021-03-29  7:39 ` Daniel Shahaf [this message]
2021-03-29 11:55   ` Marlon Richert
2021-03-29 17:11     ` Daniel Shahaf
2021-03-29 17:20       ` Bart Schaefer
2021-03-29 18:14         ` Daniel Shahaf
2021-03-29 20:00           ` Marlon Richert
2021-03-29 20:05             ` Daniel Shahaf
2021-03-29 20:35               ` Marlon Richert
2021-04-01  4:28                 ` Marlon Richert
2021-04-01 18:40                   ` Daniel Shahaf
2021-04-02  0:50                 ` Oliver Kiddle
2021-04-10 20:20                   ` Lawrence Velázquez
2021-04-11 20:06                     ` Marlon Richert
2021-04-11 21:24                     ` Patch bumping (was Re: Feature Patch: Use completion to view parameter values) Bart Schaefer
2021-04-12  8:18                       ` Marlon
2021-04-13 12:32                         ` Daniel Shahaf
2021-04-13 18:08                           ` Lawrence Velázquez
2021-04-15  9:39                             ` [META] Tone of voice / Writing style in patch reviews (was Re: Patch bumping) Marlon
2021-04-15 10:33                               ` zeurkous
2021-04-13 13:35                         ` Patch bumping (was Re: Feature Patch: Use completion to view parameter values) Daniel Shahaf
2021-04-13 21:31                           ` Lawrence Velázquez
2021-04-13 21:50                             ` Bart Schaefer
2021-04-14 12:52                             ` Daniel Shahaf
2021-04-13  2:47                       ` Lawrence Velázquez
2021-04-12 20:22                   ` Feature Patch: Use completion to view parameter values Marlon
2021-04-12 21:49                     ` Bart Schaefer
2021-04-13  4:50                       ` Marlon Richert
2021-03-30  5:41           ` Mikael Magnusson
2021-03-31 22:55             ` Daniel Shahaf
2021-03-31 23:03               ` Daniel Shahaf
2021-03-29 20:10         ` Peter Stephenson
2021-03-29 11:48 ` Mikael Magnusson
2021-03-29 12:06   ` Marlon Richert
2021-03-29 12:07     ` Marlon Richert

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=20210329073913.GP18178@tarpaulin.shahaf.local2 \
    --to=d.s@daniel.shahaf.name \
    --cc=marlon.richert@gmail.com \
    --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).