From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-3.4 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 27669 invoked from network); 17 Jan 2023 21:25:41 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 17 Jan 2023 21:25:41 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1673990741; b=G894i4MFPpAI3Sl4TO45TLbem7494EZIPDpGdaguTucmauGYXQNUQ4lCKQhmh+DMkPdi4l5bcV 2muBiLzX7jwF8/XegIWbjskDWpqZTFkCTj9FvyLDXt7YXuTdSsTQxPtMIMdWrdeCdAm5VHLqy7 C7qAFCBEtoAk2aRtqCZadWkCrmtWdG5OWlz2SerKJK+kIncXKjEJTxeN0wyqoFkqVymMfnOSwP zdKj6bjSKbOLwQY/zMJZrN+EZj6B5cXXyef/TGjym26WvIcrXB9tBBaYCE3069TM4IQztsaokF K8jo2PNoZpJeeM5dapF6Epx/E87wvrE/MlGkpdy025ULfQ==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mail-yb1-f174.google.com) smtp.remote-ip=209.85.219.174; dkim=pass header.d=gmail.com header.s=20210112 header.a=rsa-sha256; dmarc=pass header.from=gmail.com; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20210803; t=1673990741; bh=5GmKth1RFYuigE5vSX2xYL+5rhhn0vqIt+f2SrSw50o=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:Content-Type:Cc:To:Subject:Message-ID:Date:From:In-Reply-To: References:MIME-Version:DKIM-Signature:DKIM-Signature; b=P/bVEc+E6V0aHcMxWpaA08amATvDsxnrCFCbGqM1h66rMJkWlITlJ/PmmIDYokPi4vnmPjXjFE VJY9ybJKwRms4g3+xONTJfZyjlZ6rBP+NBDPkvtpErif4VbKfakGWRH3xmppCHurJozWzJufuV bSjccrth0H4Otwq7BX6I6GxDfEcjTQIacEhN+OaCpnAf6/CuoVxAVleX5GiYgiFRcPC1TEwvWh nkyjyXx3xa7LZJPFJir2n0Rcbw/ciidXG8SSjI739IQgN3GrmpMh0CMVb+HsWxSrb/s2ifB8rT vgwmaa18/Rv50LYgBQdozjwzx4NHKxWrO5DJoEn3VzGDYA==; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=zsh.org; s=rsa-20210803; h=List-Archive:List-Owner:List-Post:List-Unsubscribe: List-Subscribe:List-Help:List-Id:Sender:Content-Type:Cc:To:Subject:Message-ID :Date:From:In-Reply-To:References:MIME-Version:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=dZ5BRyjkYuM2TUe+DJMi43kFZof4cpZhnTM8UkhFIow=; b=HfvmBLscNXA09XZIu2NG2292l1 jxudg5KKT2R3b9D4H8CFucJXJvHwy/sdThTIM4g4BioNQDWZRe7bRs+Dp3D/aOJjaQNV8T95WxUqF lknEjlOMoNghR+WTFAKJ91MekTI+O096WmC+pZIu1xzeUupTorfimkQ4YF/A8zmMqouf4GdYDe42r maeIHOYk8a77jq8M5SnEI2U47J+MqKgZuhipI7eTzeWhJ+Yt1yVAraRlbC2YEWgJ8gKISFKDpW4+a 3YK4kdDv+D4DBWk66Wbl8S/05RpWnWjRQwuDYWxv9lQ2Uhlg2xfYicMD+ARPJ501hvSWqwVsISoKF JFmLYNVg==; Received: by zero.zsh.org with local id 1pHtSe-000LtF-Oo; Tue, 17 Jan 2023 21:25:40 +0000 Authentication-Results: zsh.org; iprev=pass (mail-yb1-f174.google.com) smtp.remote-ip=209.85.219.174; dkim=pass header.d=gmail.com header.s=20210112 header.a=rsa-sha256; dmarc=pass header.from=gmail.com; arc=none Received: from mail-yb1-f174.google.com ([209.85.219.174]:35533) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_128_GCM_SHA256:128) id 1pHtRP-000L9L-LY; Tue, 17 Jan 2023 21:24:24 +0000 Received: by mail-yb1-f174.google.com with SMTP id o75so35795258yba.2 for ; Tue, 17 Jan 2023 13:24:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=dZ5BRyjkYuM2TUe+DJMi43kFZof4cpZhnTM8UkhFIow=; b=nPI+qeO8q7q7Z8L8c/VPuClCDIbrzSVW4BGjaqMel8OEg0S03pQHVrDTxu9evXf43c Am15ce4QxnAq21yjseYmE/lJyPLCBk/nab5gC8MR8lTxGb8fJFXA1j0jyJm/WkzAK6A0 24tFjBrk5AzJ3Vs1GJQHhL0PIgmZHSVfpLsZJKrwOHxKfzD1e6Pona7D4/oPTYckdoJh L60hArQlSuy3P2RSMigQpeAyVOOn3FtIToFpkYkSnHlZET/1CcD8XzmNvyku704win8q Y9dlVKqQuBSV6pk9kQACJhcmR00STFL74D2TmeehOG3G4+g8VNGakDaDlylrxnia7K05 p/RQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=dZ5BRyjkYuM2TUe+DJMi43kFZof4cpZhnTM8UkhFIow=; b=u1Ele5HObm6Li7fc4i75D80kwVsuDRic83j0aKuU0UmYhMWQCnYawd/cq1YglUhyCw W7+adUa9IlnUlJ52maHE0d6qviU/lfI2QfvdiN5Vu2p2SgiJx+ZxEYzrk2QmSMkViYim 7XOOntWeougSI48rx2Fj2QRSc6vc8anAgPFaVlrlWH1+rK8O5KLrP3u2FoxPc3TugUdu zqtnQZ4r95Y3I1C9bfHnKW2PQmbIL3KrbGkyWy6GwFt/pOpmYLYZYLD8pvG6oTfK8cfu pDtIVBBEPvMOWTtZCDsfI1UBDTOG94jC+j+uhmMfIyPkVqscK+dy44CLdPPnFTZXahxO PAjw== X-Gm-Message-State: AFqh2koOUtY8oPB4gcgr0A/ePZRIsccCVDlxT6kigBrwUP6WFGM5+HvI /0s14CDthc4IfYLdtccpn5IosXh3KxOxerqQ9aDigmF2 X-Google-Smtp-Source: AMrXdXtqJymEkUVAaJhVFIVV/4fueMWiLJHwbSC69noMD+4ttat6So1x80lPe71F8guToLMbLIiL6KjVEqJjvfYml1U= X-Received: by 2002:a5b:604:0:b0:799:f820:f48 with SMTP id d4-20020a5b0604000000b00799f8200f48mr632233ybq.192.1673990662588; Tue, 17 Jan 2023 13:24:22 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Roman Perepelitsa Date: Tue, 17 Jan 2023 22:24:10 +0100 Message-ID: Subject: Re: order of sourcing To: Ray Andrews Cc: Zsh Users Content-Type: text/plain; charset="UTF-8" X-Seq: 28648 Archived-At: X-Loop: zsh-users@zsh.org Errors-To: zsh-users-owner@zsh.org Precedence: list Precedence: bulk Sender: zsh-users-request@zsh.org X-no-archive: yes List-Id: List-Help: , List-Subscribe: , List-Unsubscribe: , List-Post: List-Owner: List-Archive: On Tue, Jan 17, 2023 at 10:10 PM Ray Andrews wrote: > > In my .zshrc, to source all my functions I just switch to the directory > where they're stored and: > > for aa in *(.); do source $aa; done > > ... seems fine, but sometimes I'm editing one function or another and I > run into 'not found' issues, like some subsidiary function has been > 'lost'. Sourcing it's file fixes the 'not found' but I'm wondering if > there's some standard way of insuring that function files are sourced in > a preferred order. For some of them I've renamed the files in an > alphabetical order since the above code seems to source the files > alphabetically. But it's add hoc and messy. Dunno, I could list them > all in a file in preferred order and then source that file. But what's > the done thing? The standard solution is to autoload functions. It solves a bunch of other problems that you get when sourcing files with function definitions: - You no longer pay the startup time penalty. - You can rely on the standard options being in effect when the function is parsed. - You can rely on there being no aliases when the function is parsed. Roman.