Received: from mout.gmx.net (mout.gmx.net [212.227.15.15]) by h1439878.stratoserver.net (8.14.4/8.14.4/Debian-2ubuntu2.1) with ESMTP id s9CFAED4029395 for ; Sun, 12 Oct 2014 17:10:15 +0200 Received: from relay.uni-heidelberg.de ([129.206.100.212]) by mx-ha.gmx.net (mxgmx008) with ESMTPS (Nemesis) id 0MWwi4-1XivLQ3lJs-00W1qC for ; Sun, 12 Oct 2014 17:10:09 +0200 Received: from listserv.uni-heidelberg.de (listserv.uni-heidelberg.de [129.206.100.94]) by relay.uni-heidelberg.de (8.14.1/8.14.1) with ESMTP id s9CF6Djt023947 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sun, 12 Oct 2014 17:06:13 +0200 Received: from listserv.uni-heidelberg.de (listserv.uni-heidelberg.de [127.0.0.1]) by listserv.uni-heidelberg.de (8.13.8/8.13.8) with ESMTP id s9BM13kP030050; Sun, 12 Oct 2014 17:06:13 +0200 Received: by LISTSERV.UNI-HEIDELBERG.DE (LISTSERV-TCP/IP release 16.0) with spool id 11368614 for LATEX-L@LISTSERV.UNI-HEIDELBERG.DE; Sun, 12 Oct 2014 17:06:12 +0200 Received: from relay.uni-heidelberg.de (relay.uni-heidelberg.de [129.206.100.212]) by listserv.uni-heidelberg.de (8.13.8/8.13.8) with ESMTP id s9CF6CNF012847 for ; Sun, 12 Oct 2014 17:06:12 +0200 Received: from smtp3.easily.co.uk (smtp3.easily.co.uk [91.194.151.18]) by relay.uni-heidelberg.de (8.14.1/8.14.1) with ESMTP id s9CF630c023919 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Sun, 12 Oct 2014 17:06:06 +0200 Received: from [86.184.171.119] (port=63786 helo=palladium.local) by smtp3.easily.co.uk with esmtpa (Exim 4.43) id 1XdJ0Y-0008OS-Gh for LATEX-L@LISTSERV.UNI-HEIDELBERG.DE; Sun, 12 Oct 2014 14:16:22 +0100 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:24.0) Gecko/20100101 Thunderbird/24.6.0 MIME-Version: 1.0 References: <541F658C.2000007@clear.net.nz> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Message-ID: <543A7F27.8050708@morningstar2.co.uk> Date: Sun, 12 Oct 2014 14:16:23 +0100 Reply-To: Mailing list for the LaTeX3 project Sender: Mailing list for the LaTeX3 project From: Joseph Wright Subject: Re: Capturing messages in a token list variable? To: LATEX-L@LISTSERV.UNI-HEIDELBERG.DE In-Reply-To: <541F658C.2000007@clear.net.nz> 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-GMX-Antivirus: 0 (no virus found) X-UI-Filterresults: notjunk:1;V01:K0:rdlTitkIJwE=:idroSDpA7tN0uBC07Zm8tRkrRQ FPmGwGnJml82pXzuFierLzSr8F3eqEz9iavUnd+Ya9fiUV77+0Rpb92SCaiIaaogmn0MFgu0Z KcSseccLQFcULe9C84xVmGkIx8qOGnpgtEx0NgaNmDykVs7QFBNbwKBvMVXOo+9y503ocuq6U BW9xkqS28VVWh8TgqxCy/XuCriUpE8oahvEBw1c6kZOvlgSQi7HbXBtnA2om0EUbC2YblzNbe n2K0ZAmK5DyZTDlvndiONrj467q2cZFKuiT9Vej1XtQ0AyTio/KgzFAe9clY23y63z4fn3fZc PbiCT8y99kzKp4+k+hTMYAe79BFimU7X7R+0rY3qop8V/lOBWiAzMBSN2iHtlTEyUE8/1LE0z UfQ0booqSifrKxOecIP6bf+U+OvITRrX5pWuaVv/bXAv95RXTu5UEZXo9/Cg4G9YyM8jo4LRU +dN/FwVkECNa0ZERi1mv0CE8Oeghe/kbPsbgPVboecQAPgJJY61uaWKDv0hEIu121uZBzQxtP Kgl20LRzfBfkhH2NrmfCtxskxAoTJQuwNPEH9bVxfDKd4A5PpXeldut4Dp7ndkUB/PBydEJdq MwukK7EEWGipJaSx/52npaK4SEPUAKLHKA/J4eehHGpeBAV3YjHyZmfiio8ju/22mbHVvJloT tXZF2QROz2QmXT1pVIKuijmgp1LwmEY0IQrWk6WduQtTka2USxhp/rkoe0y3zRBSzOcBZt2CM 7/tPcm094f1d2rWd3Ew4Mr7HB6ZkVRShReHEBmNMscZPYqlCKkL+PvueCoveNJGrlublHKPbr U2y3TZPhR2m2EerP70F4hAEVcWtxvCs9CFGbF9vjdPAL+EY9hXfLu/FI9VlYO7n+ri24Z9UE8 Qq18fLghNYJXqY1r4FEpa6kLDqJeKSd+uyDdF77drCvdtVpS/7OKjkVfosB2rE1+CKbmKZ9CG NcS9lMKYjzz6bbTQG2RPSMY833aSf3tTJhLcWiQQa74t7i5LoOaSDx3T69P3DSWyRKju8lA5/ bQMxOof3Khn9EcbqxFTkwBmJ3H3QnnrylYQwyOvqRJpCUJfWSriw7q5o2ZTZvphVufTHXc3oj eALm0H91Av4VYZc7JP70GpA4tbWPHifvBTkN+TumZSj8f29nOR0AFbth8oWbltI3rLxYyhNlg tByKC1Jup01g5Ns7ANKq4kDeaRTvb27WcMJVUB7MpwMPozSSRVtau+laFDI/VmM+mCJ8NwfPA /NrQc4aVwRmNbNlqEoEU2ciMP7n0+3ci7Mv6HltpgpX2JhoUS5LD78Dy1U3DM5wZXKeyg2t7a GhxFZbae4h9rS92p6fUwc/UVAmsAzcBCoARXE+DQ601+b2DVDmSJB45RH5gnV4gZfD9xRHBnT yam98rn6CB8ieOF7SGkFeEUF0b2YsbH8k91Xpxge9fL6JBw6kwQgq7JNIKPeAkr8yaI5UUxkR rlsGb0mgYuNwRPTz50SeRwhFIwmBJ2PsDzstoQOrGVG0KmoTODpdFV11ZJCFkWV26vwItgKg= = X-UI-Loop:V01:w2yGR+tsepw=:Uy+o6rGwmqUmb24FvqfNBPPrF05iOtMQDf/M8I31nSg= X-UI-Out-Filterresults: notjunk:1; X-Scanned-By: MIMEDefang 2.71 on 85.214.41.38 Status: R X-Status: X-Keywords: X-UID: 7617 On 22/09/2014 00:55, aparsloe wrote: > Is there any way to capture the expanded content of a message (in the > sense of l3msg) in a token list variable? As I understand it, messages > at present go either to the terminal or the log file. To use a message > in some other way, doesn't seem to be allowed for. > > The question arises from the following context. I've been writing a > program that takes mathematical expressions constructed in LyX's math > editor, changes them into a form that can be digested by l3fp, and uses > the mini-LaTeX runs of LyX's instant preview facility to evaluate and > display the result. Each preview run creates a LaTeX log but that is > buried in the temporary directory where LyX does its previewing and is > not easily accessed by the LyX user, unlike the LaTeX log for the whole > document which can be displayed in a LyX window. I've put in an > enhancement request to make the preview log similarly available but that > has attracted no interest whatever. Hence the wish to make at least some > messages available to be displayed in the preview inset (where the > calculated result would otherwise have gone). > > Certainly I can capture errors that occur at the level of what I've > programmed and display an appropriate message in the preview inset, > although it's frustrating not being able to use the l3msg machinery for > this purpose. But errors that occur at the level of l3fp seem > frustratingly inaccessible. Many of these errors are not fatal or > critical. (For instance an extra, or absent, parenthesis is often > harmless: try \fp_eval:n { 3((1+1) }. It will flag an error, "Missing ) > inserted." but one press of the key and the correct answer, 6, > is displayed.) A more appropriate response than the preview never > compiling, which is what happens now, would be to let compilation > continue if it can, and display the message in the preview inset. > > I write in happy ignorance of kernel internals, but envisage (for > instance) a new class of message, "display" perhaps, to which certain > errors could be redirected. This class, like "warning" and "info", > would not stop compilation, although subsequent cumulating errors might > have that consequence, but try to 'blunder on' (like the "r" option in > TeX) and, unlike the other classes, would load the message into a > tl-variable and set a boolean. The higher level program would check for > the boolean and branch to display the tl-variable (in my case, in the > preview inset displayed within the larger LyX document). The "display" > class, with the associated l3msg machinery, would also be available to > the higher level program for its own messages. > > Andrew There are at least a couple of issues here. The first is that (TeX) messages are tied pretty closely to the log/terminal. Thus the usual approach to dealing with any automation is to parse the log after a run and extract the information. The l3msg system is designed to work with this as the messages all have 'names' and can be set to display just that information in the log. Capturing in a token list is for 'standard' messages doable but not something built-in. The bigger issue in the context given is that we are talking about expandable messaging. Floating point calcs are expandable, and we can't issue 'normal' messages there. Nor can we set any variables, and that is an issue with the requested functionality: it's not doable in TeX. -- Joseph Wright