zsh-workers
 help / color / mirror / code / Atom feed
From: Bart Schaefer <schaefer@brasslantern.com>
To: Zsh hackers list <zsh-workers@zsh.org>
Subject: Re: backward-kill-shell-word widget
Date: Wed, 13 Jan 2016 22:54:02 -0800	[thread overview]
Message-ID: <160113225402.ZM14484@torch.brasslantern.com> (raw)
In-Reply-To: <20160114001341.GA4698@tarsus.local2>

On Jan 14, 12:13am, Daniel Shahaf wrote:
}
} Perhaps that has something to do with the fact that the zsh default
} setup is rather minimal: no cwd in PS1, no history tracking, etc..

I've been noodling about with a set of default styles to set for
compsys, not (obviously) to be incorporated into the C code but to
be distributed as a source-able (or potentially autoloadable) file.
It would replace the zstyle stuff at the end of StartupFiles/zshrc.

} (Actually, with StartupFiles/zshrc, I can't get even "rsync --<TAB>" to
} work, even though it calls compinit.)

That's interesting.  It works for me.  Had you noticed that there is a
"return 0" at the very top of StartupFiles/zshrc that you must edit out?

} So one of the things a "plugin infrastructure" could do is standardise
} a documentation format, so if you had N plugins installed, each plugin
} could register the styles and parameters it cares about, and then you
} could look them up, or enumerate them, in a unified way.

Of course the original example for this is the prompt themes system,
where each file name follows a pattern and each file defines functions
that also are conventionally named, which includes a "help" function.

This could probably be improved upon.

As for Sebastian's grumble about "flooding $fpath" ... there's really
no [default] way to avoid using fpath entries without populating the
shell process memory with a full function definition.  As is often
the case, the problem is bootstrapping -- first a hook to the plugin
has to be found in some standard place, and then that hook informs
how the rest of the plugin is found.  $fpath is the well-known way
to identify all of those places.

There is a sort of workaround; instead of

    fpath=(/path/to/the/plugin $fpath)
    autoload some_function_from_plugin

the plugin initializer might instead do

    function some_function_from_plugin {
	local FPATH=/path/to/the/plugin
	autoload -X
    }

This wastes some space in the function definition (a value for FPATH
is stored in every "not yet defined" function), but it avoids putting
anything in the global $fpath and it guarantees the function is loaded
from the same place regardless of $fpath order (one of Ray's bugaboos
from last summer).

However, you still have to bootstrap before these functions can exist;
so there at least has to be a single fpath entry where all the plugins
agree to deposit their equivalent of "promptinit" (or where the user
of the plugin is instructed to put a link to that, or whatever).


  reply	other threads:[~2016-01-14  6:53 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-01  0:37 Daniel Shahaf
2016-01-10  7:42 ` Sebastian Gniazdowski
2016-01-10  7:54   ` Sebastian Gniazdowski
2016-01-10 20:13   ` Daniel Shahaf
2016-01-10 13:37 ` Sebastian Gniazdowski
2016-01-10 19:59   ` Daniel Shahaf
2016-01-10 21:06     ` Bart Schaefer
2016-01-12  8:23   ` Bart Schaefer
2016-01-10 15:50 ` Sebastian Gniazdowski
2016-01-10 20:19   ` Daniel Shahaf
2016-01-11  8:05     ` Sebastian Gniazdowski
2016-01-12 10:36       ` Sebastian Gniazdowski
2016-01-13  1:18       ` Daniel Shahaf
2016-01-13  8:38         ` Sebastian Gniazdowski
2016-01-14  0:13           ` Daniel Shahaf
2016-01-14  6:54             ` Bart Schaefer [this message]
2016-01-15  6:26               ` Daniel Shahaf
2016-01-10 17:17 ` Bart Schaefer
2016-01-10 19:53   ` Daniel Shahaf
2016-01-12  7:54     ` Bart Schaefer
2016-04-14 16:21   ` Bart Schaefer
2016-07-08 14:19   ` Oliver Kiddle
2016-01-11 11:53 ` Sebastian Gniazdowski
2016-01-12  6:59   ` Bart Schaefer
2016-01-12  7:49     ` Sebastian Gniazdowski

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=160113225402.ZM14484@torch.brasslantern.com \
    --to=schaefer@brasslantern.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).