Return-Path: Received: from mout.gmx.net (mout.gmx.net [212.227.17.20]) by h2774747.stratoserver.net (8.15.2/8.15.2/Debian-3) with ESMTP id x31B5W5a011179 for ; Mon, 1 Apr 2019 13:05:34 +0200 Received: from relay.uni-heidelberg.de ([129.206.100.212]) by mx-ha.gmx.net (mxgmx110 [212.227.17.5]) with ESMTP (Nemesis) id 0Lascu-1gUxDz2LxQ-00kMzG for ; Mon, 01 Apr 2019 13:05:27 +0200 IronPort-SDR: PvhAgc0pk2q8KM2KS8ziw7mEbe5SP7BOHN63iXqBztDF7L9PCLmUPxQZaAXuEVCy4qQky7a0Pn uev0UYW5OQ28Uz2P1UA1LFW+wvPTuhny7kg3UD7G33II5YKOCZoexlOrs8NtnJzg8nEFUmCBQT s8BFgPs4RZUTnDRbKPDPKlw2hciJA0GyXixozZo1/miBlDaVA/Qm1WUxw1BzNR+iNk4v39gB1o 7h13AagXp0x7Nb+zyuJsstB6F7F9qUi5L6qOxd7dYSh/mckT9phBhYfbMkG2Bz4wY9W9tmaiKC JBc= Received: from listserv.uni-heidelberg.de ([129.206.100.94]) by relay.uni-heidelberg.de with ESMTP; 01 Apr 2019 13:05:27 +0200 Received: from listserv (localhost [127.0.0.1]) by listserv.uni-heidelberg.de (Postfix) with ESMTP id B81AA128050; Mon, 1 Apr 2019 13:05:25 +0200 (CEST) Received: by LISTSERV.UNI-HEIDELBERG.DE (LISTSERV-TCP/IP release 16.0) with spool id 34681772 for LATEX-L@LISTSERV.UNI-HEIDELBERG.DE; Mon, 1 Apr 2019 13:05:25 +0200 Delivered-To: LATEX-L@listserv.uni-heidelberg.de Received: from relay.uni-heidelberg.de (relay.uni-heidelberg.de [129.206.100.212]) by listserv.uni-heidelberg.de (Postfix) with ESMTP id BBE53122137 for ; Mon, 1 Apr 2019 13:05:24 +0200 (CEST) IronPort-SDR: Ipj53BPf8bJJw+DqGIDsOCtDsDkPmnynUqpC3UXIy9G3ajebtzEMjmj+K+C1CoQTktT8DFU+Cm Zi7cdv7aG3nn1t7vdk3dRN5mfLIgEX5sZIChYv3axo9P0rXVdAcwEL6ZLgOBDdNCMOZj2svcV3 lCyuzqcK74CtvIdLMdFq+qgBgAVupuRtuvHEjJevKy3aoqYfDpyFbp5VCC9SArHt9Kpmsbnzav DeUauwrUtZ5pzfHUwP/abGRW7vGsTABtFD0KQBtZeC99RY4MaRPLq1SlVr1W+k+EZYTuyDdROV tOm80TM2aFEsy4/KGrY4RHuI X-IronPort-MID: 17495967 X-IronPort-RemoteIP: 209.85.221.66 X-IronPort-SenderGroup: UNKNOWNLIST X-IronPort-MailFlowPolicy: $ACCEPTED X-IronPort-Reputation: -0.3 IronPort-PHdr: =?us-ascii?q?9a23=3AA29echbcm7R0Y9EY84rND2f/LSx94efdIxIV55?= =?us-ascii?q?w7irlHbqWk+dHYMVfC4el21QKYD5/W7/tVzffQsuXgVG0M7JKLvWoNNpBBBF?= =?us-ascii?q?cekctDuQsmDYaeDFHjaubwZnkwGMpGXUNo71m0NEFUHID1YFiB6maq42sqEw?= =?us-ascii?q?7kfRFwOvyzH4fTi8qt0OXn8ZndZwxUiSqVbrZ7LRHwpgLU5YENmYU3DKE3x1?= =?us-ascii?q?PSp2dQPeRbwWQ9PVWIgxP1/du95rZm+iVU/u07rotOD/u8cKM/QrhVSj8hNj?= =?us-ascii?q?lvtvfmvhTCUwaDo0AkfD9Hz0huBA7IpFHgU5P4o23nsOs42CSbMcDyR70uVn?= =?us-ascii?q?Ku4vUjThigkyoBOzMjlQOfwsVtkKJWpg6grB1j0sbVZo+SLv93YqLae5sTW2?= =?us-ascii?q?NAWs9bUyEJDJm7asMDCO8IPOAQqIeYxRNGpx+wAQCwCfPHxTpBh3uw1qo/kq?= =?us-ascii?q?wgHQzAwA08DocWqn2H5N7xNaoUTaW01PySlWSFP64Qg22krtaWIXVD6bmWUL?= =?us-ascii?q?l9cNTc0xw1GgfMnxONr42gPz6U2ukJuWWB4KxsWLHK6SZvpgdvrzyo3spphJ?= =?us-ascii?q?POg9dfwFTK8SxlzZYdKtixSUo9atmhWsg11WnSJ85tT8UuTns98iw+xLkPpZ?= =?us-ascii?q?OrVCcPwZUjgRXYbrbUO5jN6RXlWuGLJD5+j38wY7OziSG59k24w/H9XM25iQ?= =?us-ascii?q?wYlCdOn9jSu3xI7CT9t5faGMN05VzpmSyC0wnCrPxCIAU0mKvXJporz6Q/0J?= =?us-ascii?q?Ye4wzPGSr/mUO+i6HzFA1s8Oym7+37b6XOqZqVNosygQb7eqgjgc2wB+0kPx?= =?us-ascii?q?NGBTDKv7Thkue5pAunHv1DlbUun7PcsYzGKMh+xObxGAJT3os5ql6+AzqgzN?= =?us-ascii?q?UEjCwCJVNBdgiAituhMFXPLfbkSPan1g70wXE7mracZOSnXMueSxqL2K3sdr?= =?us-ascii?q?t89UNGnRA+ydlOoY9SC/QBLfP/V0v7ucbXSBM0YGnWi67qDstw0oQGVCeBGK?= =?us-ascii?q?icZenYtVGM7/4iM8GDYYYUvHD2LP1vtJuMxTcp3EQQe6Wkx85dYnS2Gv16Ll?= =?us-ascii?q?Wxbn/lg9NHGmAP9Fl2XKnhj1uMViRWbnC5Uvcn5z01P4mhCJ/KWoGnhLHSuU?= =?us-ascii?q?XzVo0TfG1NDUqAVGv5b4jREelZczqce4Uy2ixBT7WqTJUtkA2jpBOvgaQyNf?= =?us-ascii?q?Lao0h6/drizIQnvLCVzEBqs2YoUILFlDvRB2BswjFWG3lsh/s5+BIljA/EiP?= =?us-ascii?q?kwguQER4INoaoRCEFic8ablbQfaZi6WxqdLInXDgz6E5P2WXdpCYhpi94WPx?= =?us-ascii?q?QiQZP70laajnDsW/hMx/SKHMBmrf6ahiKsYZ47kzGfisxDxxEnWpcdbDX2wP?= =?us-ascii?q?cgqE6DQdaOyRzRlr72J/1Dh2iUpTvFlSzW+xgGGA9oDfefBSFZNhaQ9I6poB?= =?us-ascii?q?uFFuDLa/xvMxMdm5TbdO0XOpuw3A8AHLC6aZzfez7jwT7uQ0zTl/XXNsyyPD?= =?us-ascii?q?xMlDPUDExOylpBx3uNOAkgCyvkmFrwV2c3R3ToZU6ksfNzrHqqCFIyzkSKYk?= =?us-ascii?q?xt2r6/9wQaw/CRGbsV2foftSEtpi8Rfh711s/KC9eGuwtqfblNKdI77lBd0G?= =?us-ascii?q?vFtgt7dpW+JqFmj1Qafkx5pUTrnxlwD4xBl4AtohZIhEJqLrmE1Vpaaz6C9Z?= =?us-ascii?q?X5O7mSNXOruR7xNejZ3VbR1NvQ8aAKqbw5p1jloAC1Bx8i/nFggLw3mzOX4p?= =?us-ascii?q?THChZXUIqkCB5msUgn4euAO29judCcz3BnPKiqvyWXwd8tDfpj1xChOtdSMa?= =?us-ascii?q?+JEAX/CcJcC8X9TY5i01WvcB8AO/hfsaAuOMbzPfGC1qqiIOtwtD2jhGVDpo?= =?us-ascii?q?t61wjfkkg0Av6NxJsDz/yCi0GfUCzgiV66rs3tsYVNZDVXAXDmjCa6WsheYa?= =?us-ascii?q?p9eYtNAmCraZ7SpJ02l9vmXHhW80SmDlUN1ZqyeBacWFf62BVZyUUdpXH+yH?= =?us-ascii?q?mIigdsmjRslZKxmSnHwuDsbh0CYzcZS2xrjFOqKo+x3YlDABqYKjMxnR7g3n?= =?us-ascii?q?7UgrBBrf0mfWbWSEZMOSPxKjM6C/bihv+5e8dKragQn2BXXeC7Ow3IT7f8p1?= =?us-ascii?q?4FyXqmETUAgj88cD6ut9PymBko0G8=3D?= X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: =?us-ascii?q?A0B4EQA876FcYULdVdFjHAEBAQQBAQc?= =?us-ascii?q?EAQGBVAQBAQsBgg0DJTeBAAQyhA5igxmPS0wBAQEBAQEGgTWDXYVsco99DwE?= =?us-ascii?q?YhFQChUMaBwEEMwYNAQEDAQEJAQMBAQcYCgwIGwwlDIVLAQEEAQEhHQEbHgM?= =?us-ascii?q?MBgULDQICJgICIxEBBQEcBQENBgIBAYMegV0BAwgNnXE8ix2BEgUBF4J6BYJ?= =?us-ascii?q?HgWkKGScNX4E4AgYJAQh5JAGLMhEGeIEHgTiCPS4+hFmCdYJXA4pHh0mTOgm?= =?us-ascii?q?TWgYaiywNBYhuiEOWSgIEAgQFAgYPIYFCgXhNIxVsgjuCCgwXg0uKVT0zkFs?= =?us-ascii?q?BAQ?= X-IronPort-AV: E=Sophos;i="5.60,296,1549926000"; d="scan'208";a="17495967" X-MGA-submission: =?us-ascii?q?MDGmNgRg/GaQvhh5X1ajeCMPOBA64DskBryX0q?= =?us-ascii?q?hkGdV5EiFst0j8VJ5hsujzhIe3MHNrOJIcfpQ/WRAh4wrX0yXe7AtdIU?= =?us-ascii?q?S4R8yHrFlOsh89TSbyrM1G2eJPtN/1dNvm3/QamMnoqFvFheDWMgE6h+?= =?us-ascii?q?N3ZviVlLA9oRuT/Swj/LSrBQ=3D=3D?= Received: from mail-wr1-f66.google.com ([209.85.221.66]) by relay.uni-heidelberg.de with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Apr 2019 13:05:24 +0200 Received: by mail-wr1-f66.google.com with SMTP id r4so11421370wrq.8 for ; Mon, 01 Apr 2019 04:05:24 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=2J9rIm7CGOww5/AcBXH8WZ/kU/YaC5t7Csv6H/2ekZI=; b=N8NqdSQZI35YGUL3pXP1n1VKEfTNYftp53s61MyVMT46sYWMkLUBnC/Ic1O1scmoNV IopaV+WWCI1gX01masw3EwZKtfZrBNY5tfRGItQQfybw2t+TMyywGF9tFCCpNhwxDBtu DzZRMB/EvuGkGO6eDIjAnuaWM6YTF+rFG/fkT3kvEDwI4GbVi5so3/BCqxATcGRvXOSE 2L67ZhWOLrNR+3ZzjVzqXKQYKR1EcEMU7V1N2MErr0d01rx3IrzX+WiCimvsa19rON1Q LGcTT+2Zv1i0gnr4R9n2JquC13hPVdCZ3LQ72yYEpD6PnHFmq6WHk4B5Vl9VpeHSP77k +rtg== X-Gm-Message-State: APjAAAXv8c4dzCvpWEDg56vf0iMu+Rsdn9XoJHbWjgJtX0IOu0ymnWbt uyArMLHaDG1BE8X1RFSHfFfnuneN X-Google-Smtp-Source: APXvYqydof4a+YgL3Ybm3n2Jl8l7KEpTeuIphujqvfEMLl//ZjUbxwyFoG9DDoQFNnZZrwxNkcV5eQ== X-Received: by 2002:adf:ea82:: with SMTP id s2mr42705341wrm.302.1554116723842; Mon, 01 Apr 2019 04:05:23 -0700 (PDT) Received: from [129.199.123.108] ([129.199.123.108]) by smtp.gmail.com with ESMTPSA id x18sm11596348wrw.14.2019.04.01.04.05.23 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 01 Apr 2019 04:05:23 -0700 (PDT) References: <856ff273317abf46dda9ce8c6fb0d6bd8d22472b.camel@sipsolutions.net> <85c344a1672db33f48cda03ab5438ddedf4664ad.camel@sipsolutions.net> <8736n2894o.fsf@fencepost.gnu.org> <7d3bbc2fc1d5f54510c7ffebd8d5260ff396d920.camel@sipsolutions.net> User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Message-ID: Date: Mon, 1 Apr 2019 13:05:22 +0200 Reply-To: Mailing list for the LaTeX3 project Sender: Mailing list for the LaTeX3 project From: Bruno Le Floch Subject: Re: Rescanning first token of environment when no optional argument is given To: LATEX-L@LISTSERV.UNI-HEIDELBERG.DE In-Reply-To: <7d3bbc2fc1d5f54510c7ffebd8d5260ff396d920.camel@sipsolutions.net> Precedence: list List-Help: , List-Unsubscribe: List-Subscribe: List-Owner: List-Archive: Envelope-To: X-GMX-Antispam: 0 (Mail was not recognized as spam); Detail=V3; X-Spam-Flag: NO X-UI-Filterresults: notjunk:1;V03:K0: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1Iigsw34z5ByGl1wri/ld/JPlv6fb7aqWvEs3tCyaFInlPXNElAFw== X-UI-Loop:V01:xXN06xkFaUo=:/U4R1aRvuTQZO3btFJJLSBMly84xrZi8dyiEg0SQtT8= X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:VfUMc5jGtcg=:5WZmTueKbFapt4/ymM+H7A voAsdjXk0/Ag2a6hOirD/kBAW0r2Ygn9kq74XbzghjOvE4wu7hH2TtfFwQ8ReqyXH5PAQAi6W KHBnQgHTvFiVw24c2nSY+05mnI53eag6MEgCgQRRTG3Noy9aA5q35vLAtYMSvJ/1ieJTK8Eta RhasE0fCi/SKSDe7qkL92u252pqU/n4XLkbgetT9ufj84VE1FabGqR/3DzqoAaFqPY9TthuCH FvAUakREspPR3adb4TDZzV0ZEBt0wRlUh7RN1JA1fH1qqb0BBlaUhxzrfLwiuuCnMaPui4rhs 5TkE+E3spfI73hKN4IyykzA4clh3rbXtLnaZ89W1sv3OYTXobyemcMAT9z/dRIDJc7+piLR2D rfcsDTxsXazKNrnmupUPN4qsdPA/tKSAeZquUGEnlnswpVZguwGvFaKUTJ+rbwPzsxvuM+9HY fx6mtA9StA== X-Scanned-By: MIMEDefang 2.78 on 81.169.212.23 Status: R X-Status: X-Keywords: X-UID: 8174 On 4/1/19 12:52, Benjamin Berg wrote: > On Mon, 2019-04-01 at 09:41 +0200, David Kastrup wrote: >> Benjamin Berg writes: >> >>> Hi, >>> >>> On Sun, 2019-03-31 at 18:57 -0300, Phelype Oleinik wrote: >>>> If you can't switch the catcode of & before looking for the >>>> optional argument, as David suggests >>> >>> David has a good point, I could handle the optional argument parsing >>> myself and ensure that the case works correctly. It may not be trivial, >>> but it should be reasonably easy. >> >> It should be trivial. You just use the provided mechanism exactly as >> you did before (though naming it differently) and call it last thing in >> your argumentless wrapper environment after setting up catcodes. That >> way the argument scanning only commences once catcodes are settled. > > Well, I do have an optional parameter that disables the catcode changes > (which I know realize might have been a bad idea). That said, it would > still be rather safe to make the change, parse the optional parameter > and undo the change again afterwards when desired. > > Or maybe I should just bite the bullet and create two almost identical > environments for this. > > Benjamin > Other option: use an xparse environment with "o" signature as you are doing, then end the code with \peek_charcode:NT & { ... } { ... } to detect "&" and replace it by an active "&" (or rather by the definition you have for it. Bruno