jed-users mailing list

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

Re: More patches


Hallo G.,

"G. Milde" <milde@xxxxxxxxxxxxxxxxxxxxx> wrote:
> On 25.05.08, J�rg Sommer wrote:
>> "G. Milde" <milde@xxxxxxxxxxxxxxxxxxxxx> wrote:
>> > On 20.05.08, J�rg Sommer wrote:
>
>> > Then this issue should be solved. (There might be others.)
>
>> No, it doesn't. I've forgot I'm using this patch for 50jed-extra.sl
>
>> diff --git a/jed.d/50jed-extra.sl b/jed.d/50jed-extra.sl
>> index b4e547b..e00a95d 100644
>> --- a/jed.d/50jed-extra.sl
>> +++ b/jed.d/50jed-extra.sl
>> @@ -13,6 +13,8 @@ $2 = path_concat($1, "libdir.sl");
>>  #stop
>>  #endif
>
>> +set_slang_load_path($1 + "drop-in:" + get_slang_load_path() + ":$1/utils:$1"$);
>> +
>>  % Add (and initialize) library directories
>>  % ----------------------------------------
>
>> Without it the jed-extra directories aren't in the load path.
>
> Could it be that your installed version of Jed still misses this:
>
>> > * a patch in site.sl will alias (s|g)et_jed_library_path() to
>> >   (s|g)et_slang_load_path().
>
> ?

No.

% debsums -s jed{,-{common,extra}} xjed
[no output]

% dpkg -l jed-{common,extra} G ^ii |cut -c 58-100
 1:0.99.19~pre138-1
 2.4.3-1

The bug is at your site. You should really not use these ugly variables
$1, $2, ….

diff --git a/jed.d/50jed-extra.sl b/jed.d/50jed-extra.sl
index e00a95d..fa5b3fb 100644
--- a/jed.d/50jed-extra.sl
+++ b/jed.d/50jed-extra.sl
@@ -18,7 +18,9 @@ set_slang_load_path($1 + "drop-in:" + get_slang_load_path() + 
 % Add (and initialize) library directories
 % ----------------------------------------
 
+() = fprintf(stderr, "$1\n"$);
 () = evalfile($2);
+() = fprintf(stderr, "$1\n"$);
 
 % Utilities (required by the other modes)
 % append_libdir($1 + "utils/", 1);    % append and initialize

With this patch I get:

% xjed -f 'exit(0)'
/usr/share/jed/jed-extra/
/usr/share/slsh/help/require.hlp

Patch:
diff --git a/jed.d/50jed-extra.sl b/jed.d/50jed-extra.sl
index e00a95d..781cd9f 100644
--- a/jed.d/50jed-extra.sl
+++ b/jed.d/50jed-extra.sl
@@ -4,39 +4,41 @@
 %  Released under the terms of the GNU General Public License (v. 2 or later)
 
 % Location of the jed-extra package's library dir
-$1 = "/usr/share/jed/jed-extra/";
+private variable top_dir = "/usr/share/jed/jed-extra/";
 
 % if jed-extra is removed (not purged), this file (and possibly the
 % jed-extra library dir) exist, but nothing else it expects --> abort
-$2 = path_concat($1, "libdir.sl");
-#if (file_status($2) != 1)
+private variable tmp = path_concat(top_dir, "libdir.sl");
+$1 = tmp;
+#if (file_status($1) != 1)
 #stop
 #endif
 
-set_slang_load_path($1 + "drop-in:" + get_slang_load_path() + ":$1/utils:$1"$);
+% set_slang_load_path(top_dir + "drop-in:" + get_slang_load_path() +
+%                     ":$top_dir/utils:$top_dir"$);
 
 % Add (and initialize) library directories
 % ----------------------------------------
 
-() = evalfile($2);
+() = evalfile(tmp);
 
 % Utilities (required by the other modes)
-% append_libdir($1 + "utils/", 1);    % append and initialize
-append_libdir($1 + "utils/", 0);  % append but do not initialize
+% append_libdir(top_dir + "utils/", 1);    % append and initialize
+append_libdir(top_dir + "utils/", 0);  % append but do not initialize
 
 % "Normal" modes
-append_libdir($1, 1);   	    % append and initialize
-% append_libdir($1, 0);             % append but do not initialize
+append_libdir(top_dir, 1);   	    % append and initialize
+% append_libdir(top_dir, 0);             % append but do not initialize
 
 % Drop-In Modes (recent, help, man, ...) need to be prepended
 % (comment out if you want to keep the original behaviour)
-add_libdir($1 + "drop-in/", 1);     % append and initialize
-% add_libdir($1 + "drop-in/", 0);   % append but do not initialize
+add_libdir(top_dir + "drop-in/", 1);     % append and initialize
+% add_libdir(top_dir + "drop-in/", 0);   % append but do not initialize
 
 % Experimental and exotic modes
 % (uncomment to initalize, maybe better on a per user basis in ~/jed.rc)
-% append_libdir($1 + "extra/", 0);  % append but do not initialize
-% append_libdir($1 + "extra/", 1);  % append and initialize
+% append_libdir(top_dir + "extra/", 0);  % append but do not initialize
+% append_libdir(top_dir + "extra/", 1);  % append and initialize
 
 
 % "Manual" initialization of stuff not handled by the ini.sl files
@@ -47,7 +49,7 @@ autoload("push_defaults", "sl_utils");    % needed by ispell_init.sl, complete,
 autoload("string_nth_match", "strutils"); % needed by hyperman.sl
 autoload("get_keystring", "strutils");    % needed by snake.sl
 % alternatively evaluate the utils/ini.sl file (or set the "initialize"
-% argument to 1 in append_libdir($1 + "utils/", 1) above)
+% argument to 1 in append_libdir(top_dir + "utils/", 1) above)
 % () = evalfile("utils/ini.sl");          % autoloads for all utilit functions
 
 % Set modes for known filename extensions
@@ -56,8 +58,9 @@ add_mode_for_extension ("css1", "css1");
 add_mode_for_extension ("gnuplot", "gnuplot");  % gnuplot plotting program
 add_mode_for_extension ("gnuplot", "gp");
 foreach (["man", "1", "2", "3", "4", "5", "6", "7", "8"]) {
-  $2 = ();
-  add_mode_for_extension ("manedit", $2);
+  "manedit";
+  exch;
+  add_mode_for_extension ((), ());
 }
 add_mode_for_extension ("mupad", "mu"); % mode for mupad files
 add_mode_for_extension ("ruby", "rb");

>> >> > Could you run the jedmodes unit tests with 0.99 and tell me about any
>> >> > errors (or just mail a testreport)? There is a utility script in
>> >> > jed-extra/trunk/utils/do-unittests.sh.
>
>> I've added this patch and now the test exits with the return value 20.
>
> Which means that there are still 20 errors in the test. Could you mail me
> the generated testreport.txt?

2008-05-25 16:46 Jed 0.99.19-138 (utf8), S-Lang 2.1.3, Emulation 'emacs'
test_files in '/usr/share/jed/jed-extra/tests' matching '^[^.].*\.sl$': testing 20 files|dirs 
 ch_table-test.sl: 
  E: 'Open failed' Unable to load /usr/share/jed/jed-extra/unittest.slc in require() /usr/share/slsh/require.sl
 csvutils-test.sl: 
  E: 'Open failed' Unable to load /usr/share/jed/jed-extra/unittest.slc in require() /usr/share/slsh/require.sl
 cuamark-test.sl: 
  E: 'Open failed' Unable to load /usr/share/jed/jed-extra/unittest.slc in require() /usr/share/slsh/require.sl
 cuamouse-test.sl: 
  E: 'Open failed' Unable to load /usr/share/jed/jed-extra/unittest.slc in require() /usr/share/slsh/require.sl
 datutils-test.sl: 

and so on.

With this patch, I get the following output:
Index: do-unittests.sh
===================================================================
--- do-unittests.sh     (Revision 1112)
+++ do-unittests.sh     (Arbeitskopie)
@@ -21,7 +21,7 @@
 TESTFUN='test_files_and_exit("/usr/share/jed/jed-extra/tests/*.sl")'
 
 # jed (without X)
-LANG=en_US; jed -n -l extra/unittest.sl -f $TESTFUN
+LANG=en_US; jed -batch -n -l extra/unittest.sl -f $TESTFUN
 
 # xjed and standard emulation (usually emacs)   
 LANG=en_US; xjed -n -l extra/unittest.sl -f $TESTFUN

% sh do-unittests.sh
loading /usr/share/jed/lib/site.slc
loading /usr/share/jed/lib/os.sl
loading /usr/share/jed/lib/menus.slc
loading /usr/share/jed/lib/defaults.sl
loading /etc/jed.d/05jed-common.sl
loading /etc/jed.d/50jed-extra.sl
loading /usr/share/jed/jed-extra/libdir.sl
loading /usr/share/slsh/require.sl
loading /usr/share/jed/lib/compat.sl
loading /usr/share/jed/jed-extra/ini.sl
loading /usr/share/jed/jed-extra/drop-in/ini.sl
loading /etc/jed.d/50local.sl
loading /usr/share/jed/jed-extra/extra/unittest.sl
loading /usr/share/jed/jed-extra/utils/sl_utils.slc
loading /usr/share/jed/jed-extra/utils/bufutils.slc
loading /usr/share/jed/lib/keydefs.slc
 2008-05-26 12:36 
Unable to typecast Null_Type to String_Type
Traceback: Sprintf
/usr/share/jed/lib/site.sl:304:vinsert:Type Mismatch
/usr/share/jed/jed-extra/extra/unittest.sl:154:testmessage:Type Mismatch
  Local variables for testmessage:
        String_Type buf = "*scratch*"
        List_Type args = List_Type with 5 elements
/usr/share/jed/jed-extra/extra/unittest.sl:462:test_files:Type Mismatch
  Local variables for test_files:
        String_Type path = "/usr/share/jed/jed-extra/tests/*.sl"
        String_Type dir = "/usr/share/jed/jed-extra/tests"
        String_Type pattern = "*.sl"
        Array_Type files = String_Type[22]
        String_Type setup_file = "/usr/share/jed/jed-extra/tests/setup.sl"
        String_Type teardown_file = "/usr/share/jed/jed-extra/tests/teardown.sl"
        Undefined_Type file = Undefined_Type
        Undefined_Type match = Undefined_Type
        Integer_Type no_of_errors = 0
        Undefined_Type no_of_files = Undefined_Type
        Struct_Type time_struct = Struct_Type with 9 fields
        Array_Type utf8support = String_Type[2]
        Undefined_Type plural = Undefined_Type
/usr/share/jed/jed-extra/extra/unittest.sl:518:test_files_and_exit:Type Mismatch
  Local variables for test_files_and_exit:
        List_Type args = List_Type with 1 elements
        Undefined_Type no_of_errors = Undefined_Type
***string***:1:<top-level>:Type Mismatch
Traceback: called from eval: test_files_and_exit("/usr/share/jed/jed-extra/tests
/*.sl")
Traceback: eval
/usr/share/jed/lib/site.sl:3184:command_line_hook:Type Mismatch
  Local variables for command_line_hook:
        Integer_Type n = 1
        Integer_Type i = 6
        String_Type file = "-f"
        Undefined_Type depth = Undefined_Type
        String_Type next_file = "test_files_and_exit("/usr/share/jed/jed-extra/t
ests/*.sl")"
        Undefined_Type tmp = Undefined_Type
        Null_Type init_file = NULL
        String_Type next_file_arg = "test_files_and_exit("/usr/share/jed/jed-ext
ra/tests/*.sl")"
        Undefined_Type hookfun = Undefined_Type
Error encountered while executing command_line_hook

Now, I get this:
loading /usr/share/jed/lib/site.slc
loading /usr/share/jed/lib/os.sl
loading /usr/share/jed/lib/menus.slc
loading /usr/share/jed/lib/defaults.sl
loading /etc/jed.d/05jed-common.sl
loading /etc/jed.d/50jed-extra.sl
loading /usr/share/jed/jed-extra/libdir.sl
loading /usr/share/slsh/require.sl
loading /usr/share/jed/lib/compat.sl
loading /usr/share/jed/jed-extra/ini.sl
loading /usr/share/jed/jed-extra/drop-in/ini.sl
loading /etc/jed.d/50local.sl
loading /usr/share/jed/jed-extra/extra/unittest.sl
loading /usr/share/jed/jed-extra/utils/sl_utils.slc
loading /usr/share/jed/jed-extra/utils/bufutils.slc
loading /usr/share/jed/lib/keydefs.slc
 2008-05-26 12:57 
Jed 0.99.19-138 (utf8), S-Lang 2.1.3, Emulation 'NULL'
 test_files in '/usr/share/jed/jed-extra/tests' matching '^[^.].*\.sl$': 
testing 20 files|dirs 
  ch_table-test.sl: 
loading /usr/share/jed/jed-extra/tests/ch_table-test.sl
loading /usr/share/jed/jed-extra/unittest.slc
   E: 'Open failed' Unable to load /usr/share/jed/jed-extra/unittest.slc in require() /usr/share/slsh/require.s
  csvutils-test.sl: 
loading /usr/share/jed/jed-extra/tests/csvutils-test.sl
loading /usr/share/jed/jed-extra/unittest.slc
   E: 'Open failed' Unable to load /usr/share/jed/jed-extra/unittest.slc in require() /usr/share/slsh/require.s
  cuamark-test.sl: 
loading /usr/share/jed/jed-extra/tests/cuamark-test.sl

Patch:
% diff /tmp/ch_table-test.sl /usr/share/jed/jed-extra/tests/ch_table-test.sl
--- /tmp/ch_table-test.sl       2008-05-26 12:56:13.557827573 +0200
+++ /usr/share/jed/jed-extra/tests/ch_table-test.sl     2008-05-26 12:57:47.000000000 +0200
@@ -11,7 +11,7 @@
 % private namespace: `ch_table'
 
 % set fixture:
-require("unittest");
+require("unittest", "Global");
 
 private variable teststring = "bar\n";
 private variable testbuf = "*bar*";

New output:
loading /usr/share/jed/lib/site.slc
loading /usr/share/jed/lib/os.sl
loading /usr/share/jed/lib/menus.slc
loading /usr/share/jed/lib/defaults.sl
loading /etc/jed.d/05jed-common.sl
loading /etc/jed.d/50jed-extra.sl
loading /usr/share/jed/jed-extra/libdir.sl
loading /usr/share/slsh/require.sl
loading /usr/share/jed/lib/compat.sl
loading /usr/share/jed/jed-extra/ini.sl
loading /usr/share/jed/jed-extra/drop-in/ini.sl
loading /etc/jed.d/50local.sl
loading /usr/share/jed/jed-extra/extra/unittest.sl
loading /usr/share/jed/jed-extra/utils/sl_utils.slc
loading /usr/share/jed/jed-extra/utils/bufutils.slc
loading /usr/share/jed/lib/keydefs.slc
 2008-05-26 12:58 
Jed 0.99.19-138 (utf8), S-Lang 2.1.3, Emulation 'NULL'
 test_files in '/usr/share/jed/jed-extra/tests' matching '^[^.].*\.sl$': 
testing 20 files|dirs 
  ch_table-test.sl: 
loading /usr/share/jed/jed-extra/tests/ch_table-test.sl
loading /usr/share/jed/jed-extra/ch_table.slc
loading /usr/share/jed/jed-extra/view.slc
loading /usr/share/jed/lib/keydefs.slc
loading /usr/share/jed/jed-extra/utils/bufutils.slc
   E: 'Duplicate Definition' close_buffer already has static or private linkage in this unit in <top-level>() /
  
  1 error
  csvutils-test.sl: 
loading /usr/share/jed/jed-extra/tests/csvutils-test.sl

Schöne Grüße, Jörg.
-- 
Geld allein macht nicht glücklich, aber es ist besser in einem Taxi zu
weinen, als in der Straßenbahn.
	       	   	       			(Marcel Reich‐Ranicki)

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


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