From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/97083 Path: news.gmane.org!.POSTED!not-for-mail From: Sergey Slyusarev Newsgroups: gmane.comp.tex.context Subject: Re: Bug: \textext inside \*MPinclusions causes error Date: Mon, 16 Jan 2017 22:31:39 +0300 Message-ID: Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============3372517369595586507==" X-Trace: blaine.gmane.org 1484636833 2299 195.159.176.226 (17 Jan 2017 07:07:13 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 17 Jan 2017 07:07:13 +0000 (UTC) To: ntg-context@ntg.nl Original-X-From: ntg-context-bounces@ntg.nl Tue Jan 17 08:07:09 2017 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from zapf.boekplan.nl ([5.39.185.232] helo=zapf.ntg.nl) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cTNr8-0007gl-1I for gctc-ntg-context-518@m.gmane.org; Tue, 17 Jan 2017 08:06:58 +0100 Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 30AF512404A7; Tue, 17 Jan 2017 08:06:47 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at zapf.boekplan.nl Original-Received: from zapf.ntg.nl ([127.0.0.1]) by localhost (zapf.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id AgZvqgjCb5dH; Tue, 17 Jan 2017 08:06:46 +0100 (CET) Original-Received: from zapf.ntg.nl (localhost [IPv6:::1]) by zapf.ntg.nl (Postfix) with ESMTP id 66E16124049C; Tue, 17 Jan 2017 08:06:46 +0100 (CET) Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id CC0A812403FB for ; Mon, 16 Jan 2017 20:31:52 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at zapf.boekplan.nl Original-Received: from zapf.ntg.nl ([127.0.0.1]) by localhost (zapf.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id SVwclnSTx__O for ; Mon, 16 Jan 2017 20:31:51 +0100 (CET) Original-Received: from mail-yw0-f175.google.com (mail-yw0-f175.google.com [209.85.161.175]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by zapf.ntg.nl (Postfix) with ESMTPS id ACA3612403E4 for ; Mon, 16 Jan 2017 20:31:41 +0100 (CET) Original-Received: by mail-yw0-f175.google.com with SMTP id w75so74544485ywg.1 for ; Mon, 16 Jan 2017 11:31:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=wPvSWdXpzQalbRCO2xnGckhvW09a3DHUgSZXxtTjxNQ=; b=hXHyMRzryDD718cqOSkW9cADxZ2fW5+leGPEj3wRnGB07s4+IFmGnX/XcWlcZFWl2Y GYGrwe1+NlCXy1hdJj7rjZFHGhWVA/rPROFg/mqO5Ev2ZMxYlsyNHCDHcDnom2F5B81q LC8HyWrmULGbbxkM1uJ71zT2bWHN3C0j4ykLOt/xUBNK/GEsvk+FR9FvtIXn7onu43io 282x6tgrd5fCp8ei2IcqsSbRil4+RcHb29PEiSnqhlGklb7ayXf6yoBX8BMK7EgHpyb3 2SmHccgDOeMT1G1oMWiGHHwNFWp6j3+8dQBoqbkpC+b1TzFKgfQUMI1ZgEZRy3dBG4Py cr8w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=wPvSWdXpzQalbRCO2xnGckhvW09a3DHUgSZXxtTjxNQ=; b=HiTkIvt5lT8Qdk0tEQIFeEWg3wPHGqZKx2EehwRLcH/THevYMUIyyZoBrGLAsVtSV/ 9XdW5QbslgaA3uo7saKsJ5hz2UsUTAUmziBTh+cBfIFuf+5n/ePX5JVr2trcDkg2JHa0 8zow9Ab+Ihv4GT8r0PIptCmHdWIDe+h92oE70FhbhAHiWpQ1Gp2+qBn7cPZ1OJjXiGwg NOQ0yF+bvB1CcfPpdca8OwiNPViItx2Mz3YOsLdsRQK8n1ohwD5dzYUCOIFwZVdjqaMV b2LSMm5FwKrVvyTzOrPs+UTt6LVnLUsRsMfv1/GyZrPBxrqkstXy5i/AV1p9twLQoCZf wwGA== X-Gm-Message-State: AIkVDXKPbSUttvBTOU2hcJ6z53L9as9UNO3wKcGU2SRB1qcz6bXocV9Lgsskvs+gvESCybDt4bpC3efi/zqCWA== X-Received: by 10.13.232.201 with SMTP id r192mr13240078ywe.232.1484595100104; Mon, 16 Jan 2017 11:31:40 -0800 (PST) Original-Received: by 10.37.181.137 with HTTP; Mon, 16 Jan 2017 11:31:39 -0800 (PST) X-Mailman-Approved-At: Tue, 17 Jan 2017 08:06:45 +0100 X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.16 Precedence: list List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ntg-context-bounces@ntg.nl Original-Sender: "ntg-context" Xref: news.gmane.org gmane.comp.tex.context:97083 Archived-At: --===============3372517369595586507== Content-Type: multipart/alternative; boundary=94eb2c086f2293bef405463b3bf4 --94eb2c086f2293bef405463b3bf4 Content-Type: text/plain; charset=UTF-8 > the (subtle) difference between the two [*MPinclusions and **MPinitializations*] is not a bug but a feature If I understood correctly, *MPinitializations affects everything and can't be assigned to a specific instance (or can it?), in some cases (like mine) this difference is not so subtle. Look at the following example (not so minimal): \startMPinitializations picture p; p := image( draw fullsquare scaled 1cm; draw textext("1"); ); \stopMPinitializations \startMPinitializations picture s; s := image( draw (fullsquare rotated 45) scaled 1cm; draw textext("2"); ); \stopMPinitializations \defineMPinstance[foo][initializations=yes] \startMPcode{foo} picture q; q := image( draw fullcircle scaled 1cm; draw textext("3"); ); draw q; \stopMPcode \startMPcode{foo} draw p; draw q shifted (2cm, 0); draw s shifted (4cm, 0); \stopMPcode \defineMPinstance[bar][initializations=yes] \startMPcode{bar} picture r; r := image( draw fullcircle scaled 1cm; draw textext("4"); ); draw r; \stopMPcode \startMPcode{bar} draw p; draw r shifted (2cm, 0); draw s shifted (4cm, 0); \stopMPcode First, it shows why *MPinitializations can't replace *MPinclusions for me (it affects all instances), and second, it silently produces produces some really unexpected results: It looks like it should produce (by line) A circle with "3" inside (yes) A square with "1" inside (yes); A circle with "3" inside again (no, instead it produces circle with "2" inside); A rhombus with "2" inside (no, instead it produces a rhombus with "1") and so on. (tested on http://live.contextgarden.net/) In fact, I failed to declare picture variable inside with text inside one *MPcode environment and pass it to another safely (text either disappears or changes to other text, and this time ConTeXt returns no error), that surely is a bug? Sergey --94eb2c086f2293bef405463b3bf4 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
> the (subtle) difference between the two [*MPincl=
usions and *MPinitializations] is not a bug but a feature

If I understood correctly, *MPinitializations affects everything an=
d can't be assigned to a specific instance (or can it?), 
in some ca= ses (like mine) this difference is not so subtle.
Look at the=
 following example (not so minimal):

\startMPinitializations

picture p;

p :=3D image(

draw fullsquare scaled 1cm;

draw textext("1");

);

\stopMPinitializations

\startMPinitializations

picture s;

s :=3D image(

draw (fullsquare rotated 45) scal= ed 1cm;

draw textext("2");

);

\stopMPinitializations

\defineMPinstance[foo][initializati= ons=3Dyes]

\startMPcode{foo}

picture q;

q :=3D image(

draw fullcircle scaled 1cm;

draw textext("3");

);

draw q;

\stopMPcode

\startMPcode{foo}

draw p;

draw q shifted (2cm, 0);

draw s shifted (4cm, 0);

\stopMPcode

\defineMPinstance[bar][initializati= ons=3Dyes]

\startMPcode{bar}

picture r;

r :=3D image(

draw fullcircle scaled 1cm;

draw textext("4");

);

draw r;

\stopMPcode

\startMPcode{bar}

draw p;

draw r shifted (2cm, 0);

draw s shifted (4cm, 0);

\stopMPcode


First, = it shows why *MPinitializations can't replace *MPinclusions for me (it = affects all instances),

and= second, it silently produces produces some really unexpected results:

<= p style=3D"margin:0px;text-indent:0px">It looks like it should produce (by = line)

A circle with "3"= ; inside (yes)

A square with &qu= ot;1" inside (yes); A circle with "3" inside again (no, inst= ead it produces circle with "2" inside); A rhombus with "2&q= uot; inside (no, instead it produces a rhombus with "1")

<= p style=3D"margin:0px;text-indent:0px">and so on.

(tested on htt= p://live.contextgarden.net/)

In fact, I failed to declare picture variable inside with text inside = one *MPcode environment and pass it to another safely

(text either disappears or changes to other text= , and this time ConTeXt returns no error), that surely is a bug?


Sergey

--94eb2c086f2293bef405463b3bf4-- --===============3372517369595586507== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f X19fX19fX19fX19fX19fX19fX19fX19fX18KSWYgeW91ciBxdWVzdGlvbiBpcyBvZiBpbnRlcmVz dCB0byBvdGhlcnMgYXMgd2VsbCwgcGxlYXNlIGFkZCBhbiBlbnRyeSB0byB0aGUgV2lraSEKCm1h aWxsaXN0IDogbnRnLWNvbnRleHRAbnRnLm5sIC8gaHR0cDovL3d3dy5udGcubmwvbWFpbG1hbi9s aXN0aW5mby9udGctY29udGV4dAp3ZWJwYWdlICA6IGh0dHA6Ly93d3cucHJhZ21hLWFkZS5ubCAv IGh0dHA6Ly9jb250ZXh0LmFhbmhldC5uZXQKYXJjaGl2ZSAgOiBodHRwczovL2JpdGJ1Y2tldC5v cmcvcGhnL2NvbnRleHQtbWlycm9yL2NvbW1pdHMvCndpa2kgICAgIDogaHR0cDovL2NvbnRleHRn YXJkZW4ubmV0Cl9fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f --===============3372517369595586507==--