jed-users mailing list

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

Re: Jörg's LaTeX mode r100


On  7.05.07, Jörg Sommer wrote:
> G. Milde schrieb am Mon 07. May, 10:56 (+0200):
> > 
> > > Unfortunately, evaluating latex.sl now breaks my jed.
> > > 
> > >   > xjed -l latex.sl
> > >   Speicherzugriffsfehler
> For all they don't speak german, this is a segmentation fault.

> > occurs after preparsing latex_cmds.sl and disappears after
> > latex_cmds.slc is removed again.

> It sounds like a problem of Jed or SLang. Which version do you use? 

Jed Version: 0.99.18
S-Lang Version: 2.0.6

> And can you reproduce this bug?

chdir("/home/milde/.jed/lib"); % the dir, latex_cmds.sl is in
% alternatively, start (x)jed in this directory

% byte-compile the file
byte_compile_file("latex_cmds.sl", 0);

% evaluate latex.sl
() = evalfile("latex.sl");

% Output here is

loading /usr/share/slsh/stkcheck.slSpeicherzugriffsfehler

% or `jed -l latex.sl`, which resulted here in

loading /home/milde/.jed/lib/latex_cmds.slcSpeicherzugriffsfehler

% Remove the byte compiled file:

`jed -l latex.sl`

-> no segmentation foult.


I do not know what the reason is, but the presence of the preparsed
file triggers the segmentation foult.



> > It turns out that latex_cmds.sl is a very special file, that only works
> > if evaluated from the middle of latex.sl in the "latex" namespace.

> Yes, it's a part I've sourced out from the main file, because it's big
> and mainly configuration stuff. It needs the function cmd_add() and it
> must be ???local???. 

It needs:

static define cmd_insert(), 
private variable MODE, 

and may be more (I stopped after finding out about the private MODE.)

Also, latex.sl evaluates this file in the "latex" namespace, while

>    () = evalfile("latex_cmds");

would eval it in the Global namespace.

I could use

 () = evalfile("latex_cmds", "latex"))

to evaluate in the "latex" namespace, however this doesnot exist before
I evaluate latex.sl...

Chicken and egg problem, neither file loads (as intended) without the
other.


> > OTOH, latex.sl will not evaluate, if latex_cmds.sl is not in the Jed
> > library path.

> Yes. ?? Ahhm, I don't see the problem.

To see whether my personal configuration contributes to the problem, I
start jed with -n. This prevents the set-up of my local ~/.jed/lib
library path element. 
Adding the path is tedious (as it needs to be done again and again
after every crash) and might contribute to the problem (as there are
modes overriding the default ones).

Evaluationg files one-by-one is easily possible with find_file() and
evalbuffer() -- as long as there is no circular dependency.

> > Considering this mutual dependency, I wonder if it wouldn't be simpler and
> > less error prone to merge it into latex.sl.

> No, not simpler.
...
> And I'm planing to outsource more parts. latex.sl is really big and I
> don't want to have all code in one file.

Why not. I see the point for smaller modules if

* not all code needs to be loaded if the main mode is used (autoloads)
* code can be used from different modes (cmisc.sl etc.)

I see not advantage (from the end-users point of view) if the
"outsourced" files are evaluated at some point during the evaluation of
the main mode.



Günter

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


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