[prev in list] [next in list] [prev in thread] [next in thread] 

List:       nedit-develop
Subject:    [ nedit-Bugs-622291 ] barking macro sequence bug
From:       "SourceForge.net" <noreply () sourceforge ! net>
Date:       2006-02-11 10:38:26
Message-ID: E1F7s94-0007hY-4E () sc8-sf-web5 ! sourceforge ! net
[Download RAW message or body]

Bugs item #622291, was opened at 2002-10-12 13:17
Message generated for change (Settings changed) made by yooden
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=111005&aid=622291&group_id=11005

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: None
Group: None
>Status: Closed
Resolution: Fixed
Priority: 5
Submitted By: Joachim Lous (jlous)
Assigned to: Thorsten Haude (yooden)
Summary: barking macro sequence bug

Initial Comment:
when using read_macro_file(), if the file contains
&quot;define&quot;s, the code blocks between the defines are
executed _in_reverse_order_!

To reproduce, save the following as bug.nm:
    dialog(&quot;dialog 1.1&quot;)
    dialog(&quot;dialog 1.2&quot;)
    define dummy1{}
    dialog(&quot;dialog 2.1&quot;)
    dialog(&quot;dialog 2.2&quot;)
    define dummy2{}
    dialog(&quot;dialog 3.1&quot;)
    dialog(&quot;dialog 3.2&quot;)
then add a macro menu item containing: 
    load_macro_file(&quot;bug.nm&quot;)
Then run the macro. I get this sequence:
    dialog 3.1
    dialog 3.2
    dialog 2.1
    dialog 2.2
    dialog 1.1
    dialog 1.2

Apart from being just plain wrong, it is particularly
infuriating in the quite respectable case of defining
variables and  constants at the start of the file.

NEdit release of Oct 12, 2002

     Built on: Linux, 386, GNU C
     Built at: Oct 12 2002, 12:50:49
   With Motif: 2.1.30 [@(#)Motif Version 2.1.30]
Running Motif: 2.1
       Server: Linux Mandrake (XFree86 3.3.6, X-TT 1.3,
patch level 21mdk) 3360
       Visual: Id 0x20 TrueColor 16 bit (Default)


----------------------------------------------------------------------

Comment By: Thorsten Haude (yooden)
Date: 2006-02-05 14:12

Message:
Logged In: YES 
user_id=119143

Cleaned-up version of the patch.

I also moved the stack to util/utils.c.

----------------------------------------------------------------------

Comment By: Thorsten Haude (yooden)
Date: 2006-02-05 03:29

Message:
Logged In: YES 
user_id=119143

Please have a look at my preliminary patch.

The problem seems to be that the code segments are pushed
onto a stack while they are read in. After everything is
read in the stack is processed, of course now in reverse
order. I am not at all familiar with the interpreter's
internals, so I had to bolt something to the outside:
Another stack to reverse the order once more. Is there a
better way sto solve the problem?

My stack implementation is just patched together to solve
the problem at hand, so there will be bugs. Do you know a
simple but solid, BSD-licensed or public domain stack
implementation?

I just did a quick test, so prepare for crashes. You will
also see a lot of debug prints.

----------------------------------------------------------------------

Comment By: Tony Balinski (ajbj)
Date: 2006-01-17 15:42

Message:
Logged In: YES 
user_id=618141

Oops! That bit I didn't catch. (You mean use
load_macro_file() though.) Well, tried that and indeed
things do come out backwards as described. I had been using
the "File>Load Macro File..." menu only, and that does
execute a single load properly. Sorry!

----------------------------------------------------------------------

Comment By: Thorsten Haude (yooden)
Date: 2006-01-16 14:02

Message:
Logged In: YES 
user_id=119143

Did you use read_macro_file()?

----------------------------------------------------------------------

Comment By: Tony Balinski (ajbj)
Date: 2006-01-16 13:42

Message:
Logged In: YES 
user_id=618141

That's odd. I downloaded the source traball from nedit.org
(dated 16-Jan-2006 04:00), and built on my work windows box
under cygwin, with none of the patches I usually add. I
moved autoload.nm and loaded the file "bug.nm" as described
in the report. The dialogs appeared in the correct order:
  dialog 1.1
  dialog 1.2
  dialog 2.1
  dialog 2.2
  dialog 3.1
  dialog 3.2

I then copied the content of "bug.nm" to autoload.nm and
tried again. Still well behaved.

I downloaded the cygwin executable from nedit.org. This
would not run - it expects to find libICE.dll, libSM.dll and
libX11.dll. It seems that Cygwin now calls these cygICE,
cygSM and cygX11.

Here's the version info: --------------------------

5.6 [Under Development] HEAD
Jan 16, 2006

     Built on: Win32, 386, GNU C
     Built at: Jan 16 2006, 11:53:40
   With Motif: 2.1.0 [@(#)GNU/LessTif Version 2.1 Release
0.93.94]
Running Motif: 2.1 [unknown]
       Server: The Cygwin/X Project 60802000
       Visual: 24-bit TrueColor (ID 0x22, Default)
       Locale: C


----------------------------------------------------------------------

Comment By: Thorsten Haude (yooden)
Date: 2006-01-15 19:22

Message:
Logged In: YES 
user_id=119143

Website's binary also has the bug:

NEdit 5.5
Sep 30, 2004

     Built on: Linux, 386, GNU C
     Built at: Oct  1 2004, 15:55:40
   With Motif: 2.1.30 [@(#)Motif Version 2.1.30]
Running Motif: 2.1 [unknown]
       Server: The XFree86 Project, Inc 40300001
       Visual: 24-bit TrueColor (ID 0x23, Default)
       Locale: de_DE@euro


----------------------------------------------------------------------

Comment By: Thorsten Haude (yooden)
Date: 2006-01-15 19:20

Message:
Logged In: YES 
user_id=119143

Scratch that last part, the bug is visible in any case.

----------------------------------------------------------------------

Comment By: Thorsten Haude (yooden)
Date: 2006-01-15 19:14

Message:
Logged In: YES 
user_id=119143

Nope, I'm still seeing it:
NEdit 5.5
Sep 30, 2004

     Built on: Linux, 486, GNU C
     Built at: Apr 17 2005, 17:38:00
   With Motif: 2.1.0 [@(#)GNU/LessTif Version 2.1 Release
0.93.94] (UNTESTED)
Running Motif: 2.1 [unknown]
       Server: The XFree86 Project, Inc 40300001
       Visual: 24-bit TrueColor (ID 0x23, Default)
       Locale: de_DE@euro

However, I only see it once I run my autoload.nm (and all
that's included within it).

----------------------------------------------------------------------

Comment By: Thorsten Haude (yooden)
Date: 2006-01-14 13:14

Message:
Logged In: YES 
user_id=119143

Oops. I started looking into the code, but I never really
tested it in the first place. What change make it go away?

----------------------------------------------------------------------

Comment By: Tony Balinski (ajbj)
Date: 2006-01-14 13:12

Message:
Logged In: YES 
user_id=618141

This is no longer true. The dialogs appear in order.

----------------------------------------------------------------------

Comment By: TK Soh (tksoh)
Date: 2002-10-13 04:44

Message:
Logged In: YES 
user_id=411637

it's a known bug,  per comment in readCheckMacroString()

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=111005&aid=622291&group_id=11005
-- 
NEdit Develop mailing list - Develop@nedit.org
http://www.nedit.org/mailman/listinfo/develop
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic