jed-users mailing list

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

Replace Jed_Doc_Files


Hi,

I think Jed_Doc_Files is obsolated, because SLang has a more generic
bundle of function: add_doc_file(), set_doc_files(), get_doc_files() and
get_doc_string_from_file().

Here is a patch:
#v+
Index: lib/site.sl
===================================================================
--- lib/site.sl	(Revision 23)
+++ lib/site.sl	(Arbeitskopie)
@@ -72,7 +72,6 @@
 %!%-
 variable Info_Directory;
 variable Jed_Bin_Dir;
-variable Jed_Doc_Files;
 
 %!%+
 %\variable{Jed_Highlight_Cache_Path}
@@ -561,35 +560,28 @@
 Jed_Highlight_Cache_Path = get_jed_library_path ();
 Jed_Highlight_Cache_Dir = extract_element (Jed_Highlight_Cache_Path, 0, ',');
 
-variable Jed_Doc_Files = "";
+foreach (
 #ifdef VMS
-$1 = JED_ROOT;
+         "[doc.hlp]"
 #else
-$1 = dircat (JED_ROOT, "doc/hlp");
+         "doc/hlp/"
 #endif
-
-foreach (["jedfuns.hlp", "libfuns.hlp"])
+         + ["jedfuns.hlp", "libfuns.hlp"])
 {
-   $2 = ();
-#ifdef VMS
-   $2 = "[doc.hlp]" + $2;
-#endif
-   $2 = dircat ($1, $2);
-
-   if (strlen (Jed_Doc_Files))
-     Jed_Doc_Files += ",";
-   Jed_Doc_Files += $2;
+    JED_ROOT;
+    exch();
+    path_concat( (), () );  % JED_ROOT + ()
+    add_doc_file( () );
 }
 
 #ifexists _slang_doc_dir
 if (strlen(_slang_doc_dir) > 0)
-  $1 = _slang_doc_dir;
+  add_doc_file( path_concat(_slang_doc_dir, "slangfun.txt") );
 # ifdef VMS
 else
-  $1 = path_concat ($1, "[doc.txt]");
+  add_doc_file( path_concat(path_concat (_slang_doc_dir, "[doc.txt]"),
+                            "slangfun.txt") );
 # endif
-Jed_Doc_Files = strcat (Jed_Doc_Files, ",",
-			path_concat ($1, "slangfun.txt"));
 #endif
 
 __uninitialize (&$1);
Index: lib/help.sl
===================================================================
--- lib/help.sl	(Revision 23)
+++ lib/help.sl	(Arbeitskopie)
@@ -205,23 +205,14 @@
 
 define help_get_doc_string (f)
 {
-   variable file;
-   variable n, str;
-   
-   n = 0;
-   str = NULL;
-   do
-     {
-	file = extract_element (Jed_Doc_Files, n, ',');
-	if (file == NULL)
-	  break;
-	
-	str = get_doc_string_from_file (file, f);
-	n++;
-     }
-   while (str == NULL);
-   
-   return (file, str);
+    foreach ( get_doc_files() )
+    {
+        variable file = ();
+        variable str = get_doc_string_from_file(file, f);
+        if (str != NULL)
+          return (file, str);
+    }
+    return (NULL, NULL);
 }
 
 define help_for_function (f)
#v-

Bye, Jörg.
-- 
Je planmäßiger ein Mensch vorgeht,
desto stärker mag ihn der Zufall treffen.
		    Erich Krunau "Die Physiker"

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


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