zsh-users
 help / color / mirror / code / Atom feed
From: Daniel Shahaf <d.s@daniel.shahaf.name>
To: zsh-users@zsh.org
Subject: Re: Most minimal configuration challenge
Date: Sun, 4 Sep 2022 06:42:24 +0000	[thread overview]
Message-ID: <20220904064224.GO5920@tarpaulin.shahaf.local2> (raw)
In-Reply-To: <20220902144434.GG255755@cventin.lip.ens-lyon.fr>

Vincent Lefevre wrote on Fri, Sep 02, 2022 at 16:44:34 +0200:
> On 2022-09-02 09:26:40 +0000, Daniel Shahaf wrote:
> > Vincent Lefevre wrote on Wed, Aug 31, 2022 at 11:28:31 +0200:
> > > On 2022-08-28 18:29:27 +0000, Daniel Shahaf wrote:
> > > > zstyle has been explained multiple times in the past so you might want
> > > > to look those up and ask about parts that are unclear to you.
> > > > 
> > > > In short, «zstyle ':foo:bar:*:baz' key v1 v2» translates as "When
> > > > library foo asks for the value of key in a situation of the form
> > > > bar:*:baz, tell it the answer is «v1 v2»".
> > > 
> > > Perhaps there should be a zsh function that translates a zstyle line
> > > to plain English. :-)
> > 
> > What do you have in mind, exactly?  It'd be pretty easy to write
> > something that, say, runs «zstyle -L» and applies the sh-to-English
> > mechanical transformation I did above.  That's just a compiler…
> 
> The above is not very helpful for the end user.
> 
> For instance, "zstyle -L" gives in particular:
> 
>   zstyle :urlglobber url-local-schema ftp file
>   zstyle ':url-quote-magic:*' url-metas '*?[]^(|)~#{}='
> 
> but I can't find any explanation about why it should be ":urlglobber"
> and not something else. The man page looks similar for urlglobber and
> url-quote-magic, though they look different above.
> 

By convention, context patterns are of the form «:foo:…» where «foo»
identifies a particular library / module / plugin for namespacing
reasons.  So, it says ":urlglobber" and not something else because
that's what the author of urlglobber named urlglobber.

> In the zshmodules(1) man page:
> 
>   For  example,  a  fictional  `weather' plugin might state in its
>   documentation that it looks up the preferred-precipitation style
>   under the `:weather:continent:day-of-the-week:phase-of-the-moon'
>   context.  According to this, you might set the following in your
>   zshrc:
> 
>     zstyle ':weather:europe:*' preferred-precipitation rain
>     zstyle ':weather:*:Sunday:*' preferred-precipitation snow
> 
> So I would expect the translator to mention "continent",
> "day-of-the-week" and "phase-of-the-moon" in its output.

The zstyle completion actually does this; try completing
«zstyle :vcs_info:<TAB>» or «zstyle :completion:<TAB>».

> Moreover, for ':completion:*', it is difficult to find the associated
> documentation, because if one searches for "completion" in the zshall
> man page, one gets too many matches.

In this case the best approach is to look for the style name.  In other
formats of the manual, each style name has its own index entry.

----

Potentially some of the above should be added to the manual.

Daniel
(I might not have time this morning to reply to all threads I participated in)


  reply	other threads:[~2022-09-04  6:43 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-27  4:30 Felipe Contreras
2022-08-27 16:10 ` Daniel Shahaf
2022-08-27 19:32   ` Vincent Bernat
2022-08-27 20:04     ` Lawrence Velázquez
2022-08-27 23:53       ` Ray Andrews
2022-08-28  7:53         ` zzapper
2022-08-28 10:30         ` Daniel Shahaf
2022-08-28 13:59           ` Ray Andrews
2022-08-28 18:29             ` Daniel Shahaf
2022-08-31  9:28               ` Vincent Lefevre
2022-08-31 14:17                 ` Ray Andrews
2022-09-01 21:52                   ` Felipe Contreras
2022-09-02  1:41                     ` Lawrence Velázquez
2022-09-02  1:26                   ` Lawrence Velázquez
2022-09-02  1:49                     ` Felipe Contreras
2022-09-02  5:40                       ` Lawrence Velázquez
2022-09-02  7:38                         ` Felipe Contreras
2022-09-02 10:36                       ` Daniel Shahaf
2022-09-02 14:26                         ` Ray Andrews
2022-09-04  7:13                           ` Daniel Shahaf
2022-09-04 16:30                             ` Ray Andrews
2022-09-02 10:39                       ` [PATCH] zstyle: Correct and expand docs (was: Re: Most minimal configuration challenge) Daniel Shahaf
2022-09-02 15:05                         ` Bart Schaefer
2022-09-04  6:51                           ` Daniel Shahaf
2022-09-02 13:55                       ` Most minimal configuration challenge Ray Andrews
2022-09-04  7:21                         ` Daniel Shahaf
2022-09-04 16:34                           ` Ray Andrews
2022-09-02 13:32                     ` Ray Andrews
2022-09-04  7:28                       ` Daniel Shahaf
2022-09-02  9:53                   ` Daniel Shahaf
2022-09-02  9:26                 ` Daniel Shahaf
2022-09-02 14:44                   ` Vincent Lefevre
2022-09-04  6:42                     ` Daniel Shahaf [this message]
2022-09-05  9:47                       ` Vincent Lefevre
2022-09-12  8:59                         ` Daniel Shahaf
2022-08-28 18:58             ` Bart Schaefer
2022-08-28 19:23               ` Felipe Contreras
2022-08-28 19:35               ` Ray Andrews
2022-08-28 18:57   ` Felipe Contreras
2022-09-02  1:36 ` Vincent Lefevre

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=20220904064224.GO5920@tarpaulin.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).