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 12807 invoked from network); 14 Feb 2022 11:14:03 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 14 Feb 2022 11:14:03 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1644837243; b=HZZ9bKFhSfpysAx10eJyfWogpBGDqXF9rAJoyFnWPSMRjXsWVALByHc47BSSdXi00Vvo1vGfRF BnGxkbdDYH5THh09WBlKEIxy3/fm7Lp+eF7/aJTPOl1v2mpkStmcd5xEoTubztVIXIU8dKSPZR i6BdHOkDSfjSLtV85/C4gYP7dfR88NeymexMnaT1TyteuHt3eQuPJuQqFmeo9YzuBxac9Pnb3K OjNs0JqhEP3N13wkllKgCQTKDWwX/HYYSJqkLkz2mXRF2MxrA4s/VFzgzb3Pcd4i2N94mEh0wp g3iB73tJSQE5mblPe5MwB9cPFqtQLOBsMICrLUzlOUnsFw==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (snd01003-bg.im.kddi.ne.jp) smtp.remote-ip=27.86.113.19; dmarc=none header.from=kba.biglobe.ne.jp; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20210803; t=1644837243; bh=1ItrQ+NTb6jejsvqqAKft3pdfVQX2vwQ0VZ9mkOlY4Y=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:Message-ID:In-Reply-To:To:References:Date:Subject: MIME-Version:Content-Transfer-Encoding:Content-Type:From:DKIM-Signature; b=AkIKk1kfgDiBoG4rRwZP7t8mMiYzGMYEOe4CGl+4bMWoDtpUcGjwgR5HzX+F2tFzV+a35l44kE qSM89oxiwUh/mRsgOJw2EcDScrskuaunHQs3F69Tt984AgY6CGQPOIqKQJj/yaKaOeMOb+gDsQ Nzdo6/ACKEApxQ6fET/yOm8TDbnVQ/vQCoMtfiCcVoGI3m/wiEK6+yv+m7scUl5xdOdG08G6Qu TyXK59XaArqCPZ81ZtO6D2tSTDzacsaqPceTfSEof+d1fM+BxT3QSFUAzvr05Ujbj8WLMHdQp1 7SpeErr0tJeix/SqsTQnPCscMrnQxWJ2ZGHzPlIsD/d8lQ==; 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:Message-Id:In-Reply-To:To:References: Date:Subject:Mime-Version:Content-Transfer-Encoding:Content-Type:From: Reply-To:Cc:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=IovF++ZFLwrSiopxsoBerxB+bz9UxFZlAt/t90eYjZU=; b=UePYX3w301GAFONKB6vfsMNe+F Hs0JKtLaGraOxK57PK6FTXQEWzJSl/8m/Oemc+dpiKs/QZGR8i1cj30ss5S4wPhq6f9a1wzWROE3E 06f0nkMHuvRX+IheJ2xEsIuH2k8dnVsAJdq0+EkzRvQ3M4OfHoxRD6VR+wMB2UkfoLfhgs19MBx7s /hP/x9NhvkTPAncV/h3j2bmVJLboXwkDjzVR7kyMbVn+ijbIz/uaOGVsNMTK/pG23mICNwUnKwV9K CwQs70P3YQEHO2F7k3vZ0NlRkLq0t8VS2CRQsm4i0pqiSnQaRM2kaO30s0WD4z+tYrKlMfdiaJIMd cxPTzMZw==; Received: from authenticated user by zero.zsh.org with local id 1nJZIv-0000yx-LW; Mon, 14 Feb 2022 11:14:01 +0000 Authentication-Results: zsh.org; iprev=pass (snd01003-bg.im.kddi.ne.jp) smtp.remote-ip=27.86.113.19; dmarc=none header.from=kba.biglobe.ne.jp; arc=none Received: from snd01003-bg.im.kddi.ne.jp ([27.86.113.19]:58945 helo=dfmta1009.biglobe.ne.jp) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_256_GCM_SHA384:256) id 1nJZIJ-0000cO-4M; Mon, 14 Feb 2022 11:13:25 +0000 Received: from mail.biglobe.ne.jp by omta1009.biglobe.ne.jp with ESMTP id <20220214111316544.YXTR.13671.mail.biglobe.ne.jp@biglobe.ne.jp> for ; Mon, 14 Feb 2022 20:13:16 +0900 From: Jun-T Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.21\)) Subject: Re: [docs bug] FAQ contains yodl macros in generated HTML Date: Mon, 14 Feb 2022 20:13:16 +0900 References: <20220212185248.GA23578@tarpaulin.shahaf.local2> To: zsh-workers@zsh.org In-Reply-To: <20220212185248.GA23578@tarpaulin.shahaf.local2> Message-Id: X-Mailer: Apple Mail (2.3445.104.21) X-Biglobe-Sender: takimoto-j@kba.biglobe.ne.jp X-Seq: 49756 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: > 2022/02/13 3:52=E3=80=81Daniel Shahaf wrote: > The manual build defines LPAR() in Doc/zmacros.yo. Perhaps that > definition is not seen by the FAQ build. FAQ.yo defines its own LPAR()/RPAR() at the top of FAQ.yo. But they (or = any other macros) do not work in the mytt() macro (also defined at the top = of FAQ.yo). mytt() calls tt(), but this tt() is a yodl builtin macro, and it = intentionally protects its ARG1 by NOEXPAND(ARG1). In the case of the zsh main documents (in Doc/ directory), zman.yo or = ztexi.yo defines the macro tt() that does not use NOEXPAND(ARG1), so tt(LPAR()) = works. There may be many ways to fix the problem. The patch below uses SUBST(_LPAR_)(CHAR(40)) instead of def(LPAR)(0)(CHAR(40)), because the = substitution works even in NOEXPAND(). diff --git a/Etc/FAQ.yo b/Etc/FAQ.yo index d000f00c5..886883b3e 100644 --- a/Etc/FAQ.yo +++ b/Etc/FAQ.yo @@ -55,8 +55,8 @@ def(emdash)(0)(\ whenhtml(---)\ whenman(--)whenms(--)whensgml(--)\ whentxt(--))\ -def(LPAR)(0)(CHAR(40))\ -def(RPAR)(1)(CHAR(41)) +SUBST(_LPAR_)(CHAR(40))\ +SUBST(_RPAR_)(CHAR(41)) myreport(Z-Shell Frequently-Asked Questions)(Peter = Stephenson)(2010/02/15) COMMENT(-- the following are for Usenet and must appear first)\ description(\ @@ -706,7 +706,7 @@ label(23) cd() { builtin cd "$@"; print -D $PWD; } ) (which converts your home directory to a tt(~)). In fact, this = problem is - better solved by defining the special function chpwd+LPAR()RPAR() = (see + better solved by defining the special function chpwd+_LPAR__RPAR_ = (see the manual). Note also that the mytt(;) at the end of the function is optional in zsh, but not in ksh or sh (for sh's where it exists). =20 @@ -790,7 +790,7 @@ label(23) function l { /bin/ls -la "$@" | more } ) The mytt(l) after mytt(function) is not expanded. Note you don't = need - the mytt(LPAR()RPAR()) in this case, although it's harmless. + the mytt(_LPAR__RPAR_) in this case, although it's harmless. =20 You need to be careful if you are defining a function with multiple names; most people don't need to do this, so it's an unusual problem, @@ -803,7 +803,7 @@ label(23) This oddity was fixed in version 5.1. =20 The rest of this item assumes you use the (more common, - but equivalent) mytt(LPAR()RPAR()) definitions. + but equivalent) mytt(_LPAR__RPAR_) definitions. =20 Bart Schaefer's rule is: Define first those aliases you expect to use in the body of a function, but define the function first if the @@ -1986,7 +1986,7 @@ label(327) mytt(something) mustn't contain tt(/) if the pattern is being used = for globbing. =20 - Likewise, mytt(abc+LPAR()<->~<10-100>RPAR().txt) matches a file = consisting of + Likewise, mytt(abc+_LPAR_<->~<10-100>_RPAR_.txt) matches a file = consisting of tt(abc), then some digits, then tt(.txt), unless the digits happen to match a number from 10 to 100 inclusive (remember the handy mytt(<->) pattern for matching integers with optional limits to the range). So @@ -2109,7 +2109,7 @@ sect(Why doesn't the expansion = mytt(*.{tex,aux,pdf}) do what I expect?) =20 This use of parentheses is special to zsh. Modern Bourne-like shells have a syntax like this, too, but with an mytt(@) in front of the - parentheses: again, see link(2.1)(21), and search for mytt(@+LPAR()). + parentheses: again, see link(2.1)(21), and search for mytt(@_LPAR_). This is harder for the user to remember but easier for the shell to parse! =20