jed-users mailing list

[2004 Date Index] [2004 Thread Index] [Other years]
[Thread Prev] [Thread Next]      [Date Prev] [Date Next]

Re: jed 0.99-17 looks good


On 24.11.04, Dave Kuhlman wrote:
> On Tue, Nov 23, 2004 at 10:12:39PM -0500, John E. Davis wrote:
> > Dave Kuhlman <dkuhlman@xxxxxxxxxxxxxxx> wrote:
> > >Yesterday, I compiled and started using Jed B0.99.17-49U.  Here are
> > >a few comments:
> > 
> > Thanks for the feedback.
> > 
> > >1. When I first started using it, I saw this message.
> > >
> > >       Excess junk left on stack by .../.jedrc
> > >
> > >   A little editing in my .jedrc eliminated it.  I'm not an Slang
> > >   expert.  It took some groping fix this.  It would be helpful if
> > >   someone could give a few comments on what SLang statements are
> > >   likely to cause that message.

Generally, all functions that return a value which is not used by calling
code, e.g.
   find_file("filename");
as opposed to 
  () = find_file("filename");   

If there is online help for a function, the USAGE also states whether
there is a return value. 

Sometimes it is really tedious to find the offender. Evaluating files
one-by-one and looking at the stack (e.g. with show_stack from
http://jedmodes.sf.net/mode/diagnose/ ) can narrow the search space.  

> > The main offenders that I have seen have involved the use of the
> > right, left, up, and down functions instead of the go_* versions.

> I also found that filelist.sl (which I downloaded from Jed modes on
> 11/22/04) produces this message.  

So it is my fault.

> In a separate message Paul Boekholt <paul@xxxxxxxxxxxx> mentioned that
> enable_dfa_syntax_for_mode() leaves something on the stack.  His hint
> made fixing filelist.sl easy. 

Uh.  The Help>Describe_Function> says:

   enable_dfa_syntax_for_mode: library function  Undocumented)

The source in site.sl says

   \usage{enable_dfa_syntax_for_mode (String_Type mode, ...)}

and a test did not show a return value.
Nor did I find something on the stack after evaluating filelist 1.2

However, after opening a directory, there was a 0 on the
stack. I could track this down to find_uri() of uri.sl which should not
return a value. The patch is

@@ -149,7 +158,7 @@
      message("No scheme found to open URI " + uri);
    % fallback
    !if(is_substr(uri, ":"))
-     find_file(uri);
+     () = find_file(uri);
 }


So why did the patch

> -enable_dfa_syntax_for_mode(mode);
> +() = enable_dfa_syntax_for_mode(mode);

work? Probabely, something else put exess junk on the stack, before the
evaluation of filelist.sl. The 
  () = ...
construct simply tells SLang to discard one stack value. If you try 
  M-X () = enable_dfa_syntax_for_mode("foo");
you will get a stack underflow error.


> Nope.  I replaced my .jedrc with jed.rc from the distribution. 

There is an easier way: the -n command option tells jed to ignore ~/.jedrc 

Günter

-- 
G.Milde web.de

--------------------------
To unsubscribe send email to <jed-users-request@xxxxxxxxxxx> with
the word "unsubscribe" in the message body.
Need help? Email <jed-users-owner@xxxxxxxxxxx>.


[2004 date index] [2004 thread index]
[Thread Prev] [Thread Next]      [Date Prev] [Date Next]