mailing-list for TeXmacs Users

Text archives Help


Strange bug with <with> and <indent>


Chronological Thread 
  • From: David Allouche <address@hidden>
  • To: address@hidden
  • Subject: Strange bug with <with> and <indent>
  • Date: Wed, 3 Oct 2001 01:19:10 +0200

Hello to all (?) structured typesetting junkies out there. I have found a
strange bug you may find preoccuping. Other, sane people, do not need to
worry about this bug, they will never run into it.

To reproduce it follow the steps. You can just copy-paste the macro
definitions in the TeXmacs buffer, they are in TeXmacs native document
format.

1. Define a macro wich puts its argument in a <with> block that locally
define another macro
<assign|miw|<macro|x|<indent|<with|m2|<macro|y|<arg|y>>|<arg|x>>>>>

2. Now apply miw, inside it, apply m2.
\ m i w RET \ m 2 RET
Strangely the m2 macro is not evaluated.

If the macro does not use ident, the bug does not appear.
Let us show it. Of course you must move back to the document root before
pasting the following definitions.

3. Define an alternate macro
<assign|mw|<macro|x|<with|m2|<macro|y|<arg|y>>|<arg|x>>>>
4. Apply mw, inside it, apply m3.
\ m w RET \ m 2 RET
The macros are expanded correctly, you can type text and it is shown.

Also if the macro uses <assign> instead of <with>, thus sacrificing the
locality of assignement, it works.

5. Define an alternate macro
<assign|ma|<macro|x|<indent|<assign|m2|<macro|y|<arg|y>>><arg|x>>>>
6. Apply mia, and m2.
The macros are expanded correctly, you can type text and it is shown.

I seems that <indent> somehow inactivates the symbols defined locally its
subtree...

You will get the same result as for miw with:
<assign|miwa|<macro|x|<indent|<with|m2||<assign|m2|<macro|y|<arg|y>>><arg|x>>>>>

Be sure to remove any invocation of mia before trying this, or the
non-local definition of m2 will make it appear to work.

If you define mif like this:
<assign|mif|<macro|x|<indent|<with|f|<func|y|<value|y>>|<arg|x>>>>>
You will not be able to activate f inside mif.

But, again, if you omit ident:
<assign|mf|<macro|x|<with|f|<func|y|<value|y>>|<arg|x>>>>
You will be able to activate f inside mf.

Okay these constructions are hardly practical at all, but they are epured
versions of something really useful that occurs in a real world document. I
have spent a lot of time isolating the bug, making the example completely
useless as a side effect.

I have no idea of the origin of the problem. I believe you may reproduce it
using other constructs than <ident> but I have no evidence.
--
-- David --




Archive powered by MHonArc 2.6.19.

Top of page