zsh-workers
 help / color / mirror / code / Atom feed
From: "Daniel Shahaf" <d.s@daniel.shahaf.name>
To: "Zsh hackers list" <zsh-workers@zsh.org>
Subject: Re: Official plugin manager?
Date: Sat, 04 Jan 2020 16:27:34 +0000	[thread overview]
Message-ID: <a9725bee-fd7a-476a-8a8f-efcdd3fdf396@www.fastmail.com> (raw)
In-Reply-To: <CAN=4vMqm8kLXNjCSoqRnKFo+1tOkEXr9cHJc3CenLUoL9Fk_aw@mail.gmail.com>

Roman Perepelitsa wrote on Sat, 04 Jan 2020 15:46 +00:00:
>     zle -N zle-line-init my-zle-line-init
> 
> This works. Until we source a plugin after setting up bindings and the
> plugin happens to hook zle-line-init without calling our hook. This
> time it's the plugin breaking our code rather than vise versa.

That plugin is broken.  Plugins shouldn't overwrite whatever had been
hooked to zle-line-init before they were sourced.  That's no more acceptable
than for a plugin to rm(1) files that it didn't create.

I know of two solutions.  One, plugins can wrap my-zle-line-init (using
${widgets} to discover it).  Two, add-zle-hook-widget may be used.

> The alternative to this rather complex and brittle approach is to bind
> beginning-of-line to several escape sequences.

"Hard cases make bad law."  Don't design the system to DTRT even when
plugins remove random files; just fix those plugins, or don't use them.

> > Obviously we shouldn't go crazy with it, but i don't see any reason to
> > specifically limit the use of styles. The style system is an important aspect
> > of configuring zsh. There are very useful settings that can only be changed
> > that way, and it's important for users to know about it if they want to make
> > their own changes.
> 
> Oh yeah, I've nothing against styles. I wanted (but failed) to make a
> point that the basic config shouldn't attempt to provide the best
> possible shell experience at the expense of config complexity. If 12
> completion style lines give you only slightly better completion that 2
> lines, it may be preferable to go with 2 lines. When the user's
> complexity threshold is exceeded by the config, the whole thing
> becomes opaque. A slightly worse but simpler config may result in
> better long term user experience as the user will be able to customize
> it.

Well, yes and no.  You're right that new users shouldn't be overwhelmed
with complexity right off the bat, but that doesn't mean we can't have
any complexity at all; we just have to label it appropriately so new users
won't try to dive into it on their first day.  For example, in zsh-sensible we
could, say, create a "zshrc.history_options" file that walks the reader
through the 25 (!) history-related options, and have zshrc point to it
as a "further reading" resource.  [It may very well be that few readers
will ever open that file.  That'll be an indication that it's working as
designed. :)]

I've done this sort of thing before in presentations (put the table of
contents in the margin of each slide, with chapter titles being
hyperlinks, and click them to skip past entire chapters).  It's
even been done in print: for example, The TeXbook called this
"dangerous bends".

Cheers,

Daniel

  reply	other threads:[~2020-01-04 16:28 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-02  3:17 Sebastian Gniazdowski
2020-01-02  4:28 ` Eric Cook
2020-01-02 11:03 ` Daniel Shahaf
2020-01-02 11:37   ` Sebastian Gniazdowski
2020-01-02 11:55     ` Sebastian Gniazdowski
2020-01-02 21:30     ` dana
2020-01-03  0:25       ` Sebastian Gniazdowski
2020-01-03  1:36         ` dana
2020-01-03  2:43           ` Sebastian Gniazdowski
2020-01-03  2:45           ` Bart Schaefer
2020-01-03  3:26             ` dana
2020-01-03  5:13               ` Sebastian Gniazdowski
2020-01-03 15:00               ` Peter Stephenson
2020-01-03 20:48                 ` Daniel Shahaf
2020-01-03 21:51                   ` Roman Perepelitsa
2020-01-03 22:06                     ` Daniel Shahaf
2020-01-03 22:26                       ` Bart Schaefer
2020-01-03 22:37                       ` Roman Perepelitsa
2020-01-04  0:42                         ` dana
2020-01-04  1:06                           ` Daniel Shahaf
2020-01-04 15:46                           ` Roman Perepelitsa
2020-01-04 16:27                             ` Daniel Shahaf [this message]
2020-01-04 16:41                               ` Roman Perepelitsa
2020-01-04 17:35                                 ` Daniel Shahaf
2020-01-04 17:42                                   ` Roman Perepelitsa
2020-01-04 17:11                             ` Bart Schaefer
2020-01-05 10:40                               ` Oliver Kiddle
2020-01-06 17:47                   ` Leah Neukirchen
2020-01-03 11:15             ` Oliver Kiddle
2020-01-04  5:16               ` Sebastian Gniazdowski
2020-01-04  6:00                 ` Sebastian Gniazdowski
2020-01-02 12:00   ` Roman Perepelitsa
2020-01-02 12:21     ` Sebastian Gniazdowski
2020-01-02 12:27       ` Roman Perepelitsa

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=a9725bee-fd7a-476a-8a8f-efcdd3fdf396@www.fastmail.com \
    --to=d.s@daniel.shahaf.name \
    --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).