From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=MAILING_LIST_MULTI, RCVD_IN_DNSWL_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: from primenet.com.au (ns1.primenet.com.au [203.24.36.2]) by inbox.vuxu.org (OpenSMTPD) with ESMTP id c3ea851a for ; Tue, 23 Jul 2019 22:10:45 +0000 (UTC) Received: (qmail 9627 invoked by alias); 23 Jul 2019 22:10:36 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: List-Unsubscribe: X-Seq: 24092 Received: (qmail 25282 invoked by uid 1010); 23 Jul 2019 22:10:36 -0000 X-Qmail-Scanner-Diagnostics: from sedan.comfychair.org by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.101.2/25517. spamassassin: 3.4.2. Clear:RC:0(45.79.171.166):SA:0(-1.9/5.0):. Processed in 1.610695 secs); 23 Jul 2019 22:10:36 -0000 X-Envelope-From: r2d2@comfychair.org X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | Received-SPF: pass (ns1.primenet.com.au: SPF record at comfychair.org designates 45.79.171.166 as permitted sender) Date: Tue, 23 Jul 2019 15:09:58 -0700 From: duvall@comfychair.org To: Bart Schaefer Cc: Sebastian Gniazdowski , Zsh Users Subject: Re: ZQL =?utf-8?Q?=E2=80=93_a_languag?= =?utf-8?Q?e?= for *declaring* scripts content. Any ideas for changes maybe? Message-ID: <20190723220958.GA30369@comfychair.org> Mail-Followup-To: duvall@comfychair.org, Bart Schaefer , Sebastian Gniazdowski , Zsh Users References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/+ (0a4f9d9) (2018-12-12) On Tue, Jul 23, 2019 at 01:50:56PM -0700, Bart Schaefer wrote: > On Mon, Jul 22, 2019 at 9:28 AM Sebastian Gniazdowski > 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