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 3563 invoked from network); 13 Mar 2023 18:19:47 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 13 Mar 2023 18:19:47 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1678731587; b=dw/RMB/xgRyo3qCYx8vjlCo1kU1XDiFSWfgo0pfVWDCYx8s6IcmxJ3aWpXAgjYLQQNgIdiwIkj q+VMYYZwRqprLbMtuO1lXwl7WaDv9Ikj1lRCRLMV+VkEQ5lYFSepQKWJltYbH8w/gEKUOm8FFN CkO4t+RZwijzJZNgGWhjnlGwZFl1pkUb+FxAPIEd/jgT6aw2176c0YjhlXkSHOHF4IZq9s+Mah zcnmHlUHAHb74oA5Mz5gvsBxR7Bo3PVzoq2L/EfFnzTT7jNgmk6cBsqVwvK8onNl7ZmMbLCVFN 52ZTqu/mailb5kDR1yNN8AMvHEf9RIZw4UyE7Dxt66murA==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mail-ed1-f42.google.com) smtp.remote-ip=209.85.208.42; 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=1678731587; bh=VoitxG55owNatqWgeO2l5r6ikTDCnI4caTt06AH85Vg=; 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:References:In-Reply-To:MIME-Version:DKIM-Signature: DKIM-Signature; b=ePwohG39eNxow6er5NkAKi4ZPjrvSDnda4h/NPsJ/DwFirzBgT43eNh+7Fsj6TUNybLrylNoTR CR7vmdTyoYh5jg5OWtPEffSePEQTs0YFqN9UVowPUY2fW5cFB8jSDBEXlMQ2Eh5MC5SUMC5z8S z/VUV4A8nUxgn4DEb5haxgbQBr8Cmx3lFUqmSiu0XqzNM8mtBjBQxhgPBaSOxGSj7pSDoKJ0Ez 3uDs/Vq/crIsIv9xuYob8selBXCU8K7Pc6m188LXR9hV4RJjxvqClY+mC6nA0DvPnTrtRXmQGH 9dfdL6uWmG+Lmp56jTAOeQ9iDYdhYd9hnVb0K2LZXF/ZbA==; 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-Transfer-Encoding: Content-Type:Cc:To:Subject:Message-ID:Date:From:References:In-Reply-To: MIME-Version:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=8U1SFBNbgyEFUnuyLip/+Wkjor5KU7AXnP79CHONuZY=; b=Nc2mNWltlRXDMczc41g+WhC7XS tOJWC8yOBTvt8rsDByOz56ICsvulzvMFkRerwJFvXlKe7D4dpJCVEfAjjHA3u9gAPxTaUOHk7wIcM 1e683aNxKgC7r/kel3l6diyusqDHQL5i7Dc6HiEqwy9fnDPTRfjAvLYosLFlsvysFXjQgpvT5Ze7d jt02Na9LEY6pfDC7ODTlwpD+r9iYUNyLojuSBYAf4oMz+jKuo87L/MIf9fNdrjjKLW08C0g3/2P1r j8ZZmLWA/ebexsZydnoHMs5UQtQ0OK5INmELaGH8nw4f/NA2gheEB4eHvDawaXvjHeWRKxFWlfxs+ NiEnRoPQ==; Received: by zero.zsh.org with local id 1pbmlv-000BNE-9S; Mon, 13 Mar 2023 18:19:47 +0000 Authentication-Results: zsh.org; iprev=pass (mail-ed1-f42.google.com) smtp.remote-ip=209.85.208.42; dkim=pass header.d=gmail.com header.s=20210112 header.a=rsa-sha256; dmarc=pass header.from=gmail.com; arc=none Received: from mail-ed1-f42.google.com ([209.85.208.42]:40945) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_128_GCM_SHA256:128) id 1pbmli-000B3d-Nt; Mon, 13 Mar 2023 18:19:35 +0000 Received: by mail-ed1-f42.google.com with SMTP id fd5so18462978edb.7 for ; Mon, 13 Mar 2023 11:19:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1678731574; h=content-transfer-encoding:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=8U1SFBNbgyEFUnuyLip/+Wkjor5KU7AXnP79CHONuZY=; b=Lt6xzWRaWzvzW05ElS/yR4PUlKVJ2/uZ7vosQrfwxDbXYXG9T3YHCvlusX53KtD7bv nP5yT6LU1rYPMDdmbpnuQBikQt+CdLxSxxA0MKvif3I4AGWiDnilo6/t7Ky//WpuW+1g iGbo4yn3sHrut73Jzox76JovzINuLMjGzjsipPWCKlYQXh6rRiuSvOEWsxI7NMTCnvCu Vb/0fW8VBBT6T6U84YNWmVLN7Fd4NsIxuibD8ZquF03DYtV4mYT45xKoqBcI8VRUgTz2 2p+euVKTQUHBoPXDgY4BjBSex0g2e4DiVn9lVx/Tm3NsHiPHgYne7LWJDEqGwQ+8RMeL 39mQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678731574; h=content-transfer-encoding:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=8U1SFBNbgyEFUnuyLip/+Wkjor5KU7AXnP79CHONuZY=; b=2vZbZyJ/xeItADaG4Gmf/l6shenSoxN9wpF37XrbYWDzvLkOrDUpuOS5JuivRUNs63 zC8bYUWbv6c1mB1XDsN9WELga0gUWTaSrZH+xtehbowRwt1/H3pkqbJQSGoA91yBzbSO 9lfLscmY0mjqukYSSksASq2oDddKfzz1Hdrw2TwbyX99KfL9XliWOZY7dQPaR172ZAeA 2QN9rHV4Fh+P6gO6ftUOwYKv1I5O0CIizlIOrjhVZpHdVKwqZbrTkHAuTfQyuFBrnaID 7zKgiNTXyxXdwjlIHhAeNLnYnPf7VDfkw79tivtOeY+bqGFtl42FUucKRbxWPKAd0xdg oaRg== X-Gm-Message-State: AO0yUKXvRZwJt0WGXHU/4oRzi4YlTKpN3IrWN/tqhIIadcAfbRSkNCo6 nt5hNE5sFLOxfM8skQytpq5k785NNMQzCXxzUVOgGhl1 X-Google-Smtp-Source: AK7set85tYRKBpCtBMeyft+MbFZzXtSho4SeytZxBL/RPDgK6UvgmZ6cXZe5Uz1YskXXhlLMkZtM4hPNUfUWsRW8VSs= X-Received: by 2002:a17:906:3141:b0:8e5:411d:4d09 with SMTP id e1-20020a170906314100b008e5411d4d09mr18020701eje.15.1678731574107; Mon, 13 Mar 2023 11:19:34 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a17:906:fd84:b0:91f:5f9c:5da7 with HTTP; Mon, 13 Mar 2023 11:19:33 -0700 (PDT) In-Reply-To: References: <1454747193.3405418.1678210315384@mail.virginmedia.com> From: Mikael Magnusson Date: Mon, 13 Mar 2023 19:19:33 +0100 Message-ID: Subject: Re: How to fix run-help-* functions? To: Bart Schaefer Cc: Michele Venturi , Peter Stephenson , zsh-workers@zsh.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Seq: 51570 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 3/13/23, Bart Schaefer wrote: > On Mon, Mar 13, 2023 at 4:14=E2=80=AFAM Michele Venturi wrote: >> >> On Tue, Mar 7, 2023, 18:41 Bart Schaefer >> wrote: >>> >>> If you don't do the "make install" part, you get an error about a >>> "shift" count being wrong, which probably looks like a bug rather than >>> a usage problem. >> >> I've tried this but it doesn't make any difference, > > When you "configure" or by passing an environment variable to "make" > you can specify a custom location for the help files. > > Because run-help is a shell function, it doesn't have a "source file" > and an "object file" so the source itself contains a replacement > string @runhelpdir@ which is updated by the installfns.sh script > during "make install". Yes, we could have put a "run-help.in" file > somewhere and processed that at a different build step to create > run-help, but that complicates installing the rest of the functions. > > The help directory is populated by the Util/helpfiles script, which is > run by "make install" in the Doc subdirectory (but I do not recommend > attempting to run make in individual subdirectories rather than > letting the top-level Makefile drive it.) > > However, all of that turns out to be necessary but secondary, because > the real problem is that you're using run-help wrong. [moved this part to after] > Question for the audience is whether we want to consider this a bug > and make it possible to use run-help as a standalone function. It could/should at least output some diagnostic, because it is very easy for an end-user (or very confused developer) to do this: % git [git manpage is shown] # above prompt has now changed to this: % run-help git % git % run-help git git is /usr/bin/git run-help:shift:106: shift count must be <=3D $# > You're not intended to type out "run-help sudo" and hit enter, you're > intended to type "sudo" and then invoke the run-help ZLE widget > (normally ESC h or Alt+h), which then calls the run-help function with > some preliminary setup having been done. Looking at the code for processcmd it seems to literally only insert the string "run-help git" on the command line, so what exactly is this preliminary setup? I can't find it. The comment for the function is: /* Run '$WIDGET $commandword' and then restore the command-line using push-line. */ which is missing some key piece of information. --=20 Mikael Magnusson