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,T_SCC_BODY_TEXT_LINE, UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 16107 invoked from network); 21 May 2022 20:19:56 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 21 May 2022 20:19:56 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1653164396; b=C/DjAQ1CASkQCRrmP/xwvXmKGNStTv86noh8rGir9PDGLtES4Fm0R8W70ir9gVJPmaV1yOB4T7 dDqur6UTrqRQBhoxHiU3JoDjscSkeO+B7IFC67821wi9cQyeoHv2DlVA438avWuNTRWevFroDR PLC4LyX6r7vVVVA1HjaB03auNMJNJ88vpXP3cPLzDfjldk1cJd/WsDbOT0rFI+2q6VA+XGsjPe SibMfoQqY85vyVgWD31im/EQgSI3rBPVdekf09C3FDOAxyuRt1sbOZ/wuko5i2TcpfYz7noRVf Ova7YDt4lISGBco6JVjE8OvtQ6NL1qVZWgSoUIHeHK1xAQ==; 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=1653164396; bh=XaezW2Ig2IWKF0RHiFqxOKMlv2+wSmOYC7mPHd4pocU=; 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=YDFuVnOypkXf0X7qmw5upTWcK8hHrBuIV+vT1ps42epqoabaEiOD6FYTasl5lPXmZiW6pgpF29 QGnk0U22kySwcJl6pN0q23wvArzIrxGZAs7Z4hpOWJHyk9ruuup0bCeqbgSTZRbEcbcb54OYrm /73jxyAa/mqKi184umeHgOQhkama3vA0ySnE3zPa+F6Bwf0k6syCzgwlxiNFAFyTusOndQ18LX zc6vg5o0BVRShckUH4u6E2gQ1thlh/Yo7HO1DYRVw/pQjIvTeib181muk8EAkA4WaI9RzMrsmA yxC1POdMAEi40r7QTpLc13B9OSEVeyl0OEikiiS7U20Ccg==; 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=ULgg1CUDmtbX+LYiuUoqTZb4LtVRsV/4seMyRvxD2tg=; b=dpWgN5BAxElE+7am+uLusNw0Nu jUtUDGxrt77T/dDREfNTwOoWpvpE4ciYubxt2deCjqTqGdn4Dc7rofQFjfwfn20f0Gf5nRnIq3UKR TbvwAhDJUb2gEzrOW2u7SyZImlim9MI+EGTivLapSMqEmNZ/d8L5gzOwxMLba4UTN7B+zDZmRPznn 8ZpcEJFEXZ2P0HW2VQD9o0K2miAD+sccL2v/K+45OxpgAiw3OcySCQc/hKuJQ3exIBWr5b5US4eDU AVNbQdEK0Ql3/huYna39jPbYm5ikfZ/kfnfNsOFCk49m6FNGvkAF8oiE9U0by8mYRvB3d/EedPNFm Tkk3Cmuw==; Received: from authenticated user by zero.zsh.org with local id 1nsVZr-0007BL-Oj; Sat, 21 May 2022 20:19:55 +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]:44010) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_128_GCM_SHA256:128) id 1nsVXF-0006Pi-Qg; Sat, 21 May 2022 20:17:14 +0000 Received: by mail-ed1-f48.google.com with SMTP id c12so14528808eds.10 for ; Sat, 21 May 2022 13:17:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brasslantern-com.20210112.gappssmtp.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=ULgg1CUDmtbX+LYiuUoqTZb4LtVRsV/4seMyRvxD2tg=; b=3TqmyYdTjWDEVq7wT166Pg6H3qsxG+VoQnZYfKFewqUL1ExXFLLYMpb+8B49bXN6/5 ERt7WW7yXOc10QUuijCD+www+qEaEdQ6ATlDEdkGfIeO/+YfqU8PNJXKlRyoibiRdILJ 4wqYsmcLkF3FcKKAwb3pRSpySRiddWfdRelWIW90Ya4rtIJolPngnzyqxWoA9qCBfUw1 BYFwUtQWeesBmSLIaQ9SIjz39whAsZ5HuCnTj7p+Bu1SDZ/AkXFwY3fIhf9zbXM8MJ05 T6BHzyaSHvB4iGPuLHUUoKegN/RLGIwMTH1sINDydbj8zGR3IBFYb0k1en4cTSw5Jhb8 AGzA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=ULgg1CUDmtbX+LYiuUoqTZb4LtVRsV/4seMyRvxD2tg=; b=p/whUSVNrN0vLffBVz9CRUfnQBtZxcNeQIddp0J+RPo525EWa0E+2pnOND96x+pDA/ jEuf7dCcMtWEH/JO80FIc+m9oB+A1Jgy7FZK2QI2A3VR2fx9pukr0qIA+paaOkJNLL8y towbUMlRI60+xb8CL3RGyerGjPEleZglA4xA9c+rBeyXlZFK3mKO/lscS8DwK7GBakfO tvYf+qjPTsSsRelaoRTmT22ZIg3BE/D9DyO9F3P+fVZ5amjVNqd5Q6+W6S9BfLOVRzPG mL17KX8ZKG6YjhX2lla3ZYbODaIT4ScFar0fVE+QnfDMFsv2I28Ur2cimTiFlQCm9Ym5 HMhQ== X-Gm-Message-State: AOAM53282fL6zOzGa5HeDyQuqZH5HJBxQ2ieudTgeqMvxMY6R2h4fpRk SvKtP4UXHIApmHheoh1JpqZuzJle7r54R+zU1Os70g== X-Google-Smtp-Source: ABdhPJxmwdYblT2f/VpmWCIgYEyc82u/Cvm+O8M9MQ6sDvTKNNeaUTIb4Yp6scCYBPMU2iO6uxl6HRuqrG65zNIdQS4= X-Received: by 2002:a05:6402:34d4:b0:42b:35e5:fc78 with SMTP id w20-20020a05640234d400b0042b35e5fc78mr7221142edc.372.1653164233518; Sat, 21 May 2022 13:17:13 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Bart Schaefer Date: Sat, 21 May 2022 13:17:02 -0700 Message-ID: Subject: Re: Finding the file offsets for functions To: Zach Riggle Cc: Zsh Users Content-Type: text/plain; charset="UTF-8" X-Seq: 27781 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 Fri, May 20, 2022 at 11:27 PM Zach Riggle wrote: > > Autoloadable functions show up differently. > > $ whence -v zztop > zztop is an autoload shell function In recent zsh you can use autoload -r zztop and then whence -v output and $functions_source will include the path (but you also can't change that path later by changing $fpath). > $ cat /Users/zachriggle/.zprezto/modules/zach-riggle/functions/zztop > #!/usr/bin/env zsh# > zztop() { > echo This is zztop > } > echo Zztop module loaded That pretty much obliterates the whole reason for "autoload". If you don't like "autoload -r" at the time of declaring all the autoloads, you can use "autoload +X" at the time you want the source of a particular function. The flag +X attempts to load each NAME as an autoloaded function, but does _not_ execute it. ... ... This does _not_ replace any existing definition ... > I've run into issues where I'd like to create a path/to/autoloadable:$lineno such that I can easily pass it to vim or another editor. This saves a lot of time on my end Wouldn't vim "+/function $name\\|$name *()" $functions_source[$name] be sufficient in nearly all cases?