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 18122 invoked from network); 28 Jul 2021 02:03:45 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 28 Jul 2021 02:03:45 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20200801; t=1627437825; b=mftHSzjG6Hn7Um8iXiNnm7R4j6oHs33+Dw6zYydDtRQnJDf/rUhlFlWJ61fpvV8IMin+O7aumf U7iwApuP4m5i5+rk3Sx/B1Jb8UaA0hR968yqEvYVsPaez9SmuNlDJRXTwkn2AvR7gkkPkubwuF FCHQrYxlM0mcQu674C9l1vLJKcKP87ih5ce5uAZE7J8dtXBWbWEHPQ3ptj2aDixAWCn6cFqPmC gcpJZ5NZ405aXuz3ilwZ7FBJYPVRbSWJsfIDk7U0srnL4XFngmJCetP4PwxqKeiDeCR6ty2oSW grQ68T6u5xVGRTfmYv/yCyvUvo+C2Q8CVLLb9y4Kfl2r7Q==; 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-20200801; t=1627437825; bh=xh9GgLfux5XC3hBtutstBY4evPYl/rHRZFtQe2UZRJc=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:Content-Transfer-Encoding:Content-Type:Cc:To:Subject: Message-ID:Date:From:In-Reply-To:References:MIME-Version:DKIM-Signature: DKIM-Signature; b=KNOKW4Gmx+eiH9VnFK5/mir2bANyGnMdOpfG+SOuGUePXTwfpuCkWAyxO1oCIdmNzn8RgjdK3d XPqpHnvSchH9NncISev/VY4F5t6/CmwyGlAvHQALEdHM4McgWQxJQlXnJ8WF9yzH4ijYBCx2g6 r59aHSCz9q6MqJwAA/fD5kaTt89t67wSasB5B8h8+R0kzkbtI0Uv5Ut8vsCLNFcva7CI+7u00r Lbvt62BJcPGszSIWG0HOq0Z0RQjk4O1BsWmlqb+zObHubx0dBV7j536Q2FTMuNPyms3W+tHA2H TRZLWKKQl+AhE2IjvKl5JSFPY5nvsBnmH/4g362jOn3Fvw==; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=zsh.org; s=rsa-20200801; h=List-Archive:List-Owner:List-Post:List-Unsubscribe: List-Subscribe:List-Help:List-Id:Sender:Content-Transfer-Encoding: Content-Type:Cc:To:Subject:Message-ID:Date:From:In-Reply-To:References: MIME-Version:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=h8t+JLmNTN0XgnLySRouLhGA+Ha4G+THKxSMYYb69VU=; b=JnekdwtqlV4uK5tgp1u9BHiiM3 Z37QW1iffCr3iEdDHLWgwENz1LoSo7Az5QjBZN2sfACMzJj4rEFNglKDIXSHc+YKAPRpGaoI5WSHI ZlRsfavXde+nLKuCXIHzh5Y1flIogx//ycA/w1FEY+8Q81yrtKI8tsTsjXCPn+XbmUKfmjx4tu4rb Prp/h9OAcC2rYQanQCtdeA4XzAWR7Yh33pbZwtC4f4QllODe1xcZV8PRJE6ZeZ+h7MPDkHTER49HW gsHSX6C/sfiALOD9IKsReDmtXtY8V9CP1eNRwpn0T78f+QQWjpBdWHLlkQn01vfBDWZj0iPw/8xdD m5QxhoKQ==; Received: from authenticated user by zero.zsh.org with local id 1m8YvA-000OWR-ST; Wed, 28 Jul 2021 02:03:44 +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]:33690) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_128_GCM_SHA256:128) id 1m8Yur-000ODb-LU; Wed, 28 Jul 2021 02:03:26 +0000 Received: by mail-yb1-f180.google.com with SMTP id x192so1434843ybe.0 for ; Tue, 27 Jul 2021 19:03:25 -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:content-transfer-encoding; bh=h8t+JLmNTN0XgnLySRouLhGA+Ha4G+THKxSMYYb69VU=; b=LLjEL/T73/g2YmRzPnb6uhWuSSW+GPzhaM20P7NkyAxLurGH9/PSVycINPszhIPplf U618NCpMd+4JjUZl428mPOCVEkKUaNqiJ6/agZp83WZl2klHLhfrSGOaEnmTegarKI57 g+kPfuy71EgWELom+8u/31QDDx0nn9sn9dnqGP7DH34sETogSVqaal7DXsQs5rSxbUMe d1NYzDRgQ18WltWHC2cJLTjTGkWOf57JmqZBeR9rYKdpvmXAHc7C2fqMLT3zagrciFW1 K2oiA+EEdmD2Lp7nqSinKoLgt1zOuJ9lp9JqwU7De4EWa9rCQnprxS2rbwwm2DW/2lSx sATg== 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:content-transfer-encoding; bh=h8t+JLmNTN0XgnLySRouLhGA+Ha4G+THKxSMYYb69VU=; b=uYVMZ0fvH7+AphQGpwcZD61/K5V2WgOGtBpc7f5ts7FRPw2hhnMVgBxl/fuac7Id5+ e3fos0r9czHW2RwQP+sgOjJmwHFV3ocPBK2jhHsFt4DoFr7Gu8HdDHUdjYJaTMRZIApS BRl37V0ECT60fmfV11s8YvQCNbEiGzUtlL3GoQJ10TFeaUJyoXBF2O/loXNOizGwjy1j XGMMkc2P9t9/p+iC2dQ7N+BZC72q5g2U0vSwv7vkaLxJsHictGgPrxQsb6uAZuF9SwhQ dqKrErZGmTgHpO3+hDFSTnauogXW644ytaX67InHVpxJ7zgXfeQHzj0RBnQbbYqnIPJx 6ALg== X-Gm-Message-State: AOAM530K4XKTWLJ7rI3Mgxxxzkj+VHsZtl6Jq9WTOuVBNzmqGvuSuhU3 vMHL+SHhgQ0nq/aQSePEwjIGXsfczJfns6RZqQdCZw== X-Google-Smtp-Source: ABdhPJx7hX8h5d5PTk2VgmFUnJxShiR2D4VXCfZ6AlmdeH8WDdqsNkjMt2BHDgR0LuZwz1DkRwqd9J1QrdW+Rx435Pg= X-Received: by 2002:a25:31c5:: with SMTP id x188mr35837802ybx.291.1627437804568; Tue, 27 Jul 2021 19:03:24 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Bart Schaefer Date: Tue, 27 Jul 2021 19:03:12 -0700 Message-ID: Subject: Re: [PATCH] Let run-help try to show function source from file (was Re: [RFC][PATCH] Try calling command with help flags in run-help) To: =?UTF-8?Q?Lawrence_Vel=C3=A1zquez?= Cc: Zsh hackers list , Marlon Richert Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Seq: 49203 Archived-At: X-Loop: zsh-workers@zsh.org Errors-To: zsh-workers-owner@zsh.org Precedence: list Precedence: bulk Sender: zsh-workers-request@zsh.org X-no-archive: yes List-Id: List-Help: List-Subscribe: List-Unsubscribe: List-Post: List-Owner: List-Archive: On Sun, Jun 20, 2021 at 2:24 PM Lawrence Vel=C3=A1zquez wr= ote: > > On Wed, Jun 2, 2021, at 2:26 PM, Marlon Richert wrote: > > Here's part of workers 48926 as a separate patch. > > > > Attachments: > > * 0001-Let-run-help-try-to-show-function-source-from-file.txt > > ping, needs review Finally looked a little more closely at this. I don't think we can allow it to unconditionally run autoload +X -Uz $func because for example it's always possible that $func should be autoloaded with -k instead. Further, even if we grab the correct autoload flags, it's possible that loading the function will have some side-effects, or that loading it with +X will omit some necessary side-effects. Also, if the function was loaded from a zcompile file, displaying $functions_source[$func] with the pager will either fail or be a mess. There's also the minor point that if the function came from a file containing multiple other functions, you get way more than you asked for.