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,UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 25535 invoked from network); 11 Aug 2021 18:58:05 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 11 Aug 2021 18:58:05 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1628708285; b=bRJyOmTjaRnmaw8q2CuoVuCcx4UDgtEK3Ps+TbJdGkQi2vibVElOJFLpaqaaheTkERnZHtC1xB qlApqzkU0Fpg3xzujyUgpQeYjZKii3k3/A9c3vMlARgGmp1ZA+3Au4yZtztcQC1HKZs9aCm7na HhHhg5mDVZ5tsUEHg8xj5+MiW7Mt+xg2ayB5Czw9oIxHctFiOYJ5TNONODGxu80pjv+Whdh0hC djhM/f+NKXbvZrVN83ZfiLnMp34F9gp+Db0iP7T/Jv5y4RFHXJyf7kAp/9gcldeh7YgjioTYVG OCOKM0uPTomKrGvc3+BkjGm3GvKdL2KyhGtkPyKmIUq6Dg==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mail-yb1-f180.google.com) smtp.remote-ip=209.85.219.180; dkim=pass header.d=brasslantern-com.20150623.gappssmtp.com header.s=20150623 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=1628708285; bh=OiBnv3HYfdiXJLwW58BEHEqR/LigFGsVHyhVZrlJ630=; 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=FWaXshsWOFoGR5ApimwMAjJN7zrAy9OKT3tfD1e2b9yM4kQMMfJkw3qHKrn21YGgAgp4Mr7y0/ Vzpjz/sOq7VMsKw7H/t+TmIQ7inrafkfVqdTiXTs5Q5Y8GX3+EPbkkzrg1LaGA++Ar+xfdvyHA fc4dg8wtTtDGVi868SUOgYkmaQbbhVk/orOocA88GsPVri6EKUmEL59AfkEJlWMABwK6oq8uB0 LnKvWwPUGzuEtCXEMXe15cUItY+JyQ228GB4J/9ZdhbszJXGKE8TYFq+XYdjdr2LIT/aHQ02Te CBVxpWyJFcgzCKDESbxAhs+/OU/3k1tW9wJO6GIMEDFWDw==; 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=EtA9kprZ08kQPEkq1WUEQx/ujJ9mx/LEpW8yny/UwJM=; b=jIln65fy2VKOzgn28mGXNXu6YB VO1X3MkJtgOasbod0B0IpCNyQHi/mR3kQXBewNLAZFKcoDc0Nt0uVsunZ2PXEk11ak9Wr5joU/0rM qVayNt6Jm5zVbDGoSzcAzj5tqMvhW0Z/Gdylvif+QuLyf5u0cfi6p/QWOjcmdlJ8tdKDxfTBJR1u1 1IPGhJA7dmKff0t7HY2l39MSbPpXs6B1+QU8wVz0tsbc7MN38iHyKvGwLAqIZzoBvYaeCAg9WtRkk SMXf0GGkFvJpDMbVI6wMY7OdukC274DIIy7YhT9kArYibP5iwYHxV2KF2eG3y2W8VC66ALIHflANF cBoM7Ayw==; Received: from authenticated user by zero.zsh.org with local id 1mDtQT-000Jhz-0o; Wed, 11 Aug 2021 18:58:05 +0000 Authentication-Results: zsh.org; iprev=pass (mail-yb1-f180.google.com) smtp.remote-ip=209.85.219.180; dkim=pass header.d=brasslantern-com.20150623.gappssmtp.com header.s=20150623 header.a=rsa-sha256; dmarc=none header.from=brasslantern.com; arc=none Received: from mail-yb1-f180.google.com ([209.85.219.180]:33345) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_128_GCM_SHA256:128) id 1mDtPU-000IxI-5Y; Wed, 11 Aug 2021 18:57:05 +0000 Received: by mail-yb1-f180.google.com with SMTP id y16so6707318yby.0 for ; Wed, 11 Aug 2021 11:57:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brasslantern-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=EtA9kprZ08kQPEkq1WUEQx/ujJ9mx/LEpW8yny/UwJM=; b=B8QNvyswjOFg1aqWWDvEz1uW/zXA358boR++mFlGewMTHxTtQgmeYdAD7EDsmJm7YR VOTcpvqVxC3cwJm00jXAf2owAhiMZ7haK5DisqTZU1OQZhPII0oSf7XSXwFhx1YV2wGb l8KiOEAi47nUUaIvctsn00l9ZmexW/emjUJu8KduXB6PcDM3eAEsC5t3uwgGzTNSUMUL 7b0r0GpAet4RFNeE6XlbrLBzsC9wNka0fHOhAhFhVx9X4AoH8GkBukygwpi7K28xGFmi LUVDVY9x9AFih7f8pCZODAOVG1krSduZcaEdTIkb4YKYwNipMUfWxliGnUA6KPlbbJVQ ppCg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=EtA9kprZ08kQPEkq1WUEQx/ujJ9mx/LEpW8yny/UwJM=; b=P2dTqjb9rO1NeiCeGThvKHS119cQ/rEX9W3QbVXsLPeN504rjcpptpIIf3I7dzHxs5 MSOgqOQ7gaKQ8iZI8xCzSOw56FAaBA2t0oImuMejHYt6zYfMXJbW6JWei4G5xIDYYrqM HeG/5R7gzeaWGWvizFPhyhRY8dvFUSRwkifOFh0ha0L6YV9RiuOd5c5rQGbIUrS0ntl0 n1qQmkmmpTE5A6dAeAM/NU0eRp5H002YboiWgW9XfUhKJAuc7bBj3b8vdROHPhcof5hD vulllEq2rtloK7mKVG8fhxNyeLr+ZJZWurMmhkrmWC1xREUNM75fUJN7VktFIhYLh2tz 9KgQ== X-Gm-Message-State: AOAM530OvkojTVIby/yVIuTpWnSQ6sW4XYqb1F6puwadMjjjGKQQfvHP 9Ap8IDZmdZFdKPAGaSC4vHttlwQ2A93aG/C/+6ULnA== X-Google-Smtp-Source: ABdhPJybSGUyyrMYcUXju/7fR5QJyaawc/9K6ZiWkoP3LodTYpd0lyDSowbCdd3rdFkYlcyAfzISY0QBi+4JaSHZDeY= X-Received: by 2002:a25:9201:: with SMTP id b1mr46378744ybo.354.1628708222775; Wed, 11 Aug 2021 11:57:02 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Bart Schaefer Date: Wed, 11 Aug 2021 11:56:51 -0700 Message-ID: Subject: Re: Re-loading files loaded via "autoload" To: Mikael Magnusson Cc: Zach Riggle , Zsh Users Content-Type: text/plain; charset="UTF-8" X-Seq: 26914 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 Wed, Aug 11, 2021 at 11:25 AM Mikael Magnusson wrote: > > On 8/11/21, Zach Riggle wrote: > > > > Thanks in advance for my spam. I recently spent some time spelunking > > in the Zsh docs for how to get an "autoload"ed module (sorry if the > > terminology is incorrect) to be re-loaded. A "module" usually refers to a binary object managed by "zmodload". There really isn't a consistent shorthand terminology for an "autoload" function that happens to define multiple helpers in its source file. > It is implied in some places that you can do this, but perhaps it is > worth mentioning explicitly somewhere? Given that we have an entire section dedicated to "Autoloading functions" it would seem reasonable to mention it there. > eg, we have this, which mentions it in a comment of the example code: > It is also possible to create a function that is not marked > as autoloaded, > but which loads its own definition by searching fpath, by using > `autoload -X' > within a shell function. For example, the following are equivalent: Those are no longer entirely equivalent, for one thing as you noted about loading from absolute paths. There's no way to attach this metadata to the function definition when wrapping up an "autoload -X" command yourself. Some update of that example is probably worthwhile. (This shortcoming does not apply to "autoload +X" as far as I know.)