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.3 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 28916 invoked from network); 17 Jan 2023 21:36:20 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 17 Jan 2023 21:36:20 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1673991380; b=qBJ9itj9D+mQoY3mn3jFawgaqlqCRaMzvDpR/YMeDhghg5msnQpx7V4jXkjLQ/Ctowita7LE1k 6cgI+ecH27PGm+P+A5reAQndiNZ+ZlzJ3dSu2m5CcXo2aGYD60UgH9mAG52ybR7zkahq1CBOyM thhozMVOH9LBoYxfinH3ceGkgdFfrSdkNUwchO6PNl0eEsxgi1JM0r70hFnqGQG3qzF/9qFGJM jMP3rcKrSzm0yX5VPPZFdK8xkRTdMdlaHKw6ngqpkja7XZacmd4mSitvnBGylvaish9975hh4q FNd8j5XMPVdVEGATW1J8sE5i0VdWlJGS/e/7RhjOY32NeA==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mail-ed1-f48.google.com) smtp.remote-ip=209.85.208.48; dkim=pass header.d=brasslantern-com.20210112.gappssmtp.com header.s=20210112 header.a=rsa-sha256; dmarc=none header.from=brasslantern.com; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20210803; t=1673991380; bh=pfC5wGm3HZbnSSt+q47M4jHcJyto2qFnMnkJrq3Icww=; 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=j3q8vdibU8JwZsoqefkUaqwv5qz8/vLnvjlQQuXpS2cVyoXzXIlJJbn29aw1EI8974i/meGbxI 2Gg8dDQvIxEYr7J/sx/Suz1921RPVSV2KTmi/JQZjLrUSuQSDMbO/kRo91a2492YZK7av8TICg JpL0ZwNSRc+0Vg+83W9BYAgpIbqNQGfEFVHmah3ViOO9ykL2KHgkxy7jaziFgpLpsOmmILnQr5 WRR+8dd5KTMjIVKa1/CpfHzN/ffcRRTaoV6yZLhxrAYzy4HSeX3BClICgg84XiIuHIZ+wNWXf6 o5xPGGGrqh5kc8xOQCoMcR399nTkKgfBwYd3I+VADtrCew==; 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=IDn5DbpA7HMLFhX6UkJOZeRntz/j2Gcf77KezWdDn10=; b=cbBCWZ2ubHr1Y7HEjmpgm1ESP6 svyjsgOuttt+ceHFRlH7lt2QeQXHjJ2Nj6LUKTErACYm0vRJzHsEd+mdJwZHVz9mdcQRB89GSajMu b2rzvyf9n107hcBhkcIwatuMt8/6XojLShEXcw6pn0U90EDdvsvSgoVwqofnsMH8PZfuziG+FJp0S mowg1wZkhgzqvcXCxGDmbq6u1qO5KqDl135+Ud/wQBk4+FxEFpC2Gxeq5/iYL8Ke2ZT7wPr5/oaiC me1EfdkDb7h/dqCYBF7RWdrGZtvfNQDi+NqPnwq4VkPz7Ecci3hXy2WLbE7vtPFu2J85WvzlyozEk 4RVD3jFg==; Received: by zero.zsh.org with local id 1pHtcy-000NGL-0l; Tue, 17 Jan 2023 21:36:20 +0000 Authentication-Results: zsh.org; iprev=pass (mail-ed1-f48.google.com) smtp.remote-ip=209.85.208.48; dkim=pass header.d=brasslantern-com.20210112.gappssmtp.com header.s=20210112 header.a=rsa-sha256; dmarc=none header.from=brasslantern.com; arc=none Received: from mail-ed1-f48.google.com ([209.85.208.48]:34422) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_128_GCM_SHA256:128) id 1pHtbd-000MVc-FR; Tue, 17 Jan 2023 21:34:58 +0000 Received: by mail-ed1-f48.google.com with SMTP id z11so47038389ede.1 for ; Tue, 17 Jan 2023 13:34:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brasslantern-com.20210112.gappssmtp.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=IDn5DbpA7HMLFhX6UkJOZeRntz/j2Gcf77KezWdDn10=; b=cdL0RWS30aB79vj0rwZnLmudfnbMiBoTFxZ32z1rmII2XmRYDbmR+A+rpEVtbri9Y3 atVqWBCctFxNGXnrmxSXkaMNVFKthp8e18hcIInshX7BqNNSlu8tT+bxkXNImpdfN368 YFdYpM7dobVcz45rxdkG+QOSOX5PdmEqTHxrndx5VDOd5ilBRo8+L3HmAhgOhGVgLfZz J4/KrM9MFEG42VzrazjJoKwLx7rDAIRqzBEhpGYzzI2prKEE+Gn0BFJQ/eUucqwE66VW NUB0LVqksi1bHlDILxUasxK85UqSK39/w9hlyDCu1F3MgRiznfPBlQjzL5k1DQ0/rThs Xc0Q== 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=IDn5DbpA7HMLFhX6UkJOZeRntz/j2Gcf77KezWdDn10=; b=LneFEo99+dQlg3HuDZTOUNZ6w0nFh53AdEQY2VHgf4W8n+g2EE3kDNir0UjDkYDWm1 pTIrctedfPV++f+NjuaEWaVXmgVYjR5Y+xhUp6L5kBd0lyHSmxc95sKoKhWdHD/+2YMQ Y9X6h9Gimxj5AzayCRaZabUMEqk8dx5ltHwTKkNf+yB9SvFC/haObyTNNL5jkV8giLC3 ctaruYAqm4GZSYGtVwvgncDYdkV99FHJwBJwMfVhF70tgYdQb1NVIz+rENlcqe/yWXrK BLju5C5yQveLmWbsRIQdc5QO+LwnkuSdbc2Df5fCjGcUYeocEvFW4MsmAki2OpStQ0yc cSCw== X-Gm-Message-State: AFqh2kq978IkqrJOX4ThwTnjkB0WgjlI5uHFA0arMyf3msDMB2LHMV28 f4RPVvs3PA6ummZIOCMUoJfVmI0f0wsFTbNBPlVq/A== X-Google-Smtp-Source: AMrXdXvTQjqtCo7hYAxf9xq/7S3+KwvrE3NsQQJ+rmzf4KiZvr7L/9fRiFGQJv62oVIPQApfS5GCb3NICFjTP3Kc+Dc= X-Received: by 2002:a50:ee95:0:b0:46b:5c9f:52e with SMTP id f21-20020a50ee95000000b0046b5c9f052emr580277edr.416.1673991297094; Tue, 17 Jan 2023 13:34:57 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Bart Schaefer Date: Tue, 17 Jan 2023 13:34:45 -0800 Message-ID: Subject: Re: order of sourcing To: Roman Perepelitsa Cc: Ray Andrews , Zsh Users Content-Type: text/plain; charset="UTF-8" X-Seq: 28649 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 1:24 PM Roman Perepelitsa wrote: > > The standard solution is to autoload functions. It solves a bunch of > other problems that you get when sourcing files with function > definitions One complication here is that, if Ray is able to use "source" to load a function's definition, then he's not writing the file in the ordinary autoload format -- that is, the file must in fact contain the full funcname() { # funcbody } whereas an autoload would normally be a file named "funcname" containing only the function body. To make autoloading work with files designed to be sourced, one must employ additional tricks, such as using "autoload -k". Also, this remark -- > > run into 'not found' issues, like some subsidiary function has been > > 'lost'. -- also makes me suspect that Ray has more than one function per file, which further messes with autoload. > - You can rely on there being no aliases when the function is parsed. That needs "autoload -U" I think?