Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: ZQL – a language for *declaring* scripts content. Any ideas for changes maybe?
- X-seq: zsh-users 24092
- From: duvall@xxxxxxxxxxxxxx
- To: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- Subject: Re: ZQL – a language for *declaring* scripts content. Any ideas for changes maybe?
- Date: Tue, 23 Jul 2019 15:09:58 -0700
- Cc: Sebastian Gniazdowski <sgniazdowski@xxxxxxxxx>, Zsh Users <zsh-users@xxxxxxx>
- In-reply-to: <CAH+w=7ZkF==CoRWHfsRUgcY4=xQcO21DGMi4=72dDu7FEv9qCQ@mail.gmail.com>
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- List-unsubscribe: <mailto:zsh-users-unsubscribe@zsh.org>
- Mail-followup-to: duvall@xxxxxxxxxxxxxx, Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>, Sebastian Gniazdowski <sgniazdowski@xxxxxxxxx>, Zsh Users <zsh-users@xxxxxxx>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
- References: <CAKc7PVAy+R+D7eyAxNWQWKSj_xSLNcOLH34rX4RxazJzdT2v1Q@mail.gmail.com> <CAH+w=7ZkF==CoRWHfsRUgcY4=xQcO21DGMi4=72dDu7FEv9qCQ@mail.gmail.com>
On Tue, Jul 23, 2019 at 01:50:56PM -0700, Bart Schaefer wrote:
> On Mon, Jul 22, 2019 at 9:28 AM Sebastian Gniazdowski
> <sgniazdowski@xxxxxxxxx> wrote:
> >
> > when I once tried NixOS, a system with declarative configuration at
> > its core, i was naively expecting that I'll be able to declare zshrc.
> > So, for example, that I'll be able to write some kind of rule "append
> > command {X} to the end of the zshrc if it's not somewhere in the
> > file".
>
> You should have a look at the "newuser" module and zsh-newuser-install
> function, also at Functions/MIME/zsh-mime-setup and
> Completion/compinstall ... these all implement something or other of
> the sort. The general approach is to mark off sections of the file(s)
> with keyworded comments and then restrict the operation of the
> "declaration" routines to the corresponding commented sections.
>
> There's probably a lot of recent stuff that could be added to at least
> newuser and compinstall.
IMO, it would make sense to just install files in a directory and only have
.zshrc source them all (either using a well-known ordering mechanism or
implement some fancier dependency system). Then you don't need a brittle
mechanism to edit (multiple times, and then to maintain the lifecycles of those
edits) a file that's nominally under user control, other than to insert a single
line.
Danek
Messages sorted by:
Reverse Date,
Date,
Thread,
Author