jed: slsh load path settings

G. Milde g.milde at web.de
Mon May 15 16:29:40 UTC 2006


Before the release of the jed 0.99.18 package (or maybe afterwards if we
do a follow up soon), we should have a look at the setting of the path
for slsh scripts.

The current site.sl contains:


#ifdef UNIX
if (is_defined ("import"))
{
   foreach ([
#ifexists _slang_install_prefix
	     _slang_install_prefix,
#endif
	     path_dirname(path_dirname(__argv[0]))])
     {
	$1 = ();
	$1 = path_concat ($1, "share/slsh/local-packages");
	if (2 != file_status ($1))
	  continue;
	set_jed_library_path (strcat (get_jed_library_path (), ",", path_dirname ($1)));
	set_jed_library_path (strcat (get_jed_library_path (), ",", $1));
	break;
     }
}
#endif

which fails due to a bug in the S-Lang Version: 2.0.5 package

  String_Type `_slang_install_prefix' == "/" % should be "/usr/";
  
   DESCRIPTION
    The value of this variable is set at the S-Lang library's
    compilation time.  On Unix systems, the value corresponds to the
    value of the `prefix' variable in the Makefile.  For normal
    installations, the library itself will be located in the `lib'
    subdirectory of the `prefix' directory.

if jed|xjed is started with just the command name.

It works, if jed|xjed is started with full path (due to the __argv[0]
part).

The pain is, that we do not know in forehand whether it works or not as
this depends on the end users choice.

A simple patch would be

    foreach ([
 #ifexists _slang_install_prefix
 	     _slang_install_prefix,
 #endif
+            "/usr/",
  	     path_dirname(path_dirname(__argv[0]))])

but I currently do not have the time to produce a proper dpatch.


Currently, we compensate for this bug by code in defaults.sl. However
this code uses
  set_slang_load_path()
while, unfortunately, the slang-load-path is not used by evalfile() or
autoload() in jed (or is this fixed in 0.99.18).

The above patch makes the 
  set_slang_load_path( () + dir );
in defaults.sl obsolete. However, it does not yet care for the second
part of the code in defaults.sl, the setting of the doc path with
add_doc_files. Maybe this should be transferred to a patch to site.sl as
well (once we are at it) so that the code is in one place again.

Günter
  
  
-- 
Milde ife.et.tu-dresden.de



More information about the Pkg-jed-devel mailing list