Hi folks,

I stumbled on something odd about the "copy" command, which is used in a
"layout". Normally, commands in a layout are interpreted in sequence, so
if you hide something with one command, then show it with a subsequent
command, it will use the second one, and show it:

symbol-hide point stalactite
symbol-show point stalactite #this one wins

If two copy commands copy conflicting information, the first one is
used, not the second. Assume the following .thconfig:

layout first
  symbol-hide point stalactite
  symbol-hide point water-flow
  symbol-hide point dig
  code metapost
    let l_wall_bedrock = l_pit;
  endcode
endlayout
layout second
  symbol-show point stalactite
  code metapost
    let l_wall_bedrock = l_wall_debris;
  endcode
endlayout
layout third
  symbol-show point water-flow #overrides the copy below
  copy first #first one wins with copy
  copy second
  symbol-show point dig #overrides the copy above
  symbol-hide point anchor
  symbol-show point anchor #second one wins normally
endlayout
source "copy.th"
select copyMP@copy
export map -proj plan -layout third -o "copy.pdf"

Use a basic survey with a default (bedrock) wall, stalactite, anchor,
water-flow. I would expect the wall to look like debris, the stalactite
to be visible, the anchor to be visible, the dig to be visible, and the
water-flow to be hidden. But instead, the wall looks like a pitch, the
stalactite is hidden (!), the anchor is visible, the dig is visible, and
the water-flow is visible (!).

It seems very inconsistent that the anchor and stalactite are visible at
the same time, because it means most commands are executed sequentially,
but copy commands are executed in reverse. It also seems inconsistent,
but understandable, that both the water-flow and dig are visible. My
understanding is therefore that:

* All copy commands get moved to the top of the layout that they are
inside, no matter where you put them in the layout. (Understandable but
weird.)
* Copy commands get executed in the opposite order from how they are
specified (inconsistent with other commands).

I couldn't find anything in the Therion book or wiki describing this, so
is it a bug or expected behaviour?

The book just says "copy <source layout id> . set properties here that
are not modified based on the given source layout". That wording is
really minimal, but it seems to suggest that commands in "third" will
override anything in "first" and "second", which rather poorly explains
the first bullet point. It does not explain the second.

Therion 6.1.0, Windows 10.

Cheers,

Tarquin
_______________________________________________
Therion mailing list
Therion@speleo.sk
https://mailman.speleo.sk/listinfo/therion

Reply via email to