[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

New Features, More Bugs



I've been playing with the file-manager lately, and have some
interesting new features. During my exploration I also noticed a few
bugs/quirks. And last but not least, I have some more info on the
regex patch.

FEATURES:
1.)
	The default xterm command name has been moved to a #define in WeXterm.h
This could be over-ridden with a compiler -DXtermCommand="path" flag.
2.)
	The File-Manager can now have it's initial file search pattern
specified
at compile time with a -DFM_DEFAULT="pattern" command. The #define is in
unixkeys.h.
3.)
	The File-Manager can also have the initial file search pattern drop
down
list pre loaded with a combination of #defines(located in unixkeys.h):
-DFM_DEFAULT_STR="string of tokens"
-DFM_DEFAULT_NUM=3
The first, -DFM_DEFAULT_STR declares a string which will be broken up
into tokens
based on white space. The second, -DFM_DEFAULT_NUM is an integer
specifying the number
of tokens in the FM_DEAFULT_STR.

BUGS:
1.)
	In the Project menu there are some strange interactions
when there is no project file open. You're allowed to add
files, which then don't appear on the project window. When you
close this window you get an error message.
2.)
FIXED:---V
	Also in the Options window there are two buttons, Variables..
and Install..  Each of these buttons leads to a menu which has
an Add feature. When you select the Add window it is initialized
with garbage.
FIXED:---^

REGEX UPDATE:
	The regex patch on the ftp site seems to work fine on my system with
the new versions (6a and 7a).
The best expression I could come up with to cover *.C, *.cpp, *.cc,
*.cxx, *.h, *.hpp, and *.hxx
is ugly but specific
'^.*\.C$|^.*\.cpp$|^.*\.cc$|^.*\.cxx$|^.*\.h$|^.*\.hpp$|^.*\.hxx$'
(Note: This is the literal sequence that needs to be passed to the
regcomp() function
If a printf type function parses the string first, be sure to escape '\'
the \. "^.*\\.C$|...")

	I've also noticed the string "Messages" being used as the
struct->file_name when opening the Message Window. This
would allow you to define a color syntax for your compiler
messages using the regex patch.

	The new features above are not immediatly compatible with the
current regex-patch. One of the hunks for the Makefile.in fails. This
hunk contained the new ECFLAGS which are also modified by the new
features described below. To make these work together simply examine
the Makefile.in.rej file and add the additional variables manually.
----
                Mark Loftis<mloftis@lanminds.com>

Diff Follows:
-------------
diff --unified --recursive --new-file 1.5.7a/Makefile.in
1.5.7b/Makefile.in
--- 1.5.7a/Makefile.in	Sun Apr  5 12:44:26 1998
+++ 1.5.7b/Makefile.in	Mon Apr  6 15:41:51 1998
@@ -21,6 +21,20 @@
 
 #If You like or need uncomment the following Statements:
 
+#Default executable for the shell command
+# XTERM_COMMAND= -DXtermCommand=\"/usr/X11R6/bin/color_xterm\"
+
+#Default search pattern for files in the initial filer-manager
+#file-pattern entry dialog.
+# FM_SEARCH= -DFM_DEFAULT=\"*.[ch]\"
+
+#the FM_STR will be broken into word tokens and used to
+#pre-fill the initial file-manager file-pattern browse window
+#the FM_NUM should be the count of tokens in the FM_STR
+#both of these must be defined as a pair
+#FM_STR= -DFM_DEFAULT_STR=\"* Makefile* configure*\"
+#FM_NUM= -DFM_DEFAULT_NUM=3
+
 # Put in here special Flags if you like
 # SPFLAGS=	-DALTMASK=Mod3Mask -DDEF_SHELL=\"/bin/ksh\" \
 #        	-DINFO_FILE=\"/usr/local/info/dir\" \
@@ -98,7 +112,8 @@
 ECFLAGS=	$(IXWINDOW) $(LXWINDOW) $(ISYSV) $(NOGNU) \
 		$(DTERMCAP) $(NOXWINDOW) $(NOPROG) $(NODEBUGGER) \
 		$(DEFPGC) $(NOSTRSTR) $(NOVSWTCH) $(RANLIB) $(EXTDEFS) \
-		$(PRNTCMD) $(NOSYMBLNKS) $(NONEWSTYLE) $(DEFXDB) $(SPFLAGS)
+		$(PRNTCMD) $(NOSYMBLNKS) $(NONEWSTYLE) $(DEFXDB) $(SPFLAGS) \
+		$(XTERM_COMMAND) $(FM_SEARCH) $(FM_STR) $(FM_NUM)
 
 ELIBFLAGS=	$(LSYSV) $(LXWINDOW) $(TLIB) $(LPOSIX) $(XWINLIB) $(LNET)
$(EXTLIBS)
 
@@ -110,15 +125,15 @@
 		we_edit.o we_fl_fkt.o we_fl_unix.o we_hfkt.o \
 		we_menue.o we_mouse.o we_opt.o we_wind.o we_term.o \
 		we_prog.o we_progn.o we_debug.o we_xterm.o WeString.o \
-		WeXterm.o WeSyntax.o WeExpArr.o
+		WeXterm.o WeSyntax.o WeExpArr.o vector.o
 
 CFILES=		we_main.c we_block.c we_unix.c we_e_aus.c \
 		we_edit.c we_fl_fkt.c we_fl_unix.c we_hfkt.c \
 		we_menue.c we_mouse.c we_opt.c we_wind.c we_term.c \
 		we_prog.c we_progn.c we_debug.c we_xterm.c WeString.c \
-		WeXterm.c WeSyntax.c WeExpArr.c
+		WeXterm.c WeSyntax.c WeExpArr.c vector.c
 
-HFILES=		attrb.h edit.h keys.h \
+HFILES=		attrb.h edit.h keys.h vector.h \
 		model.h progr.h unixkeys.h unixmakr.h \
 		Xwpe.h WeString.h WeXterm.h WeProg.h WeExpArr.h
 
diff --unified --recursive --new-file 1.5.7a/WeXterm.c 1.5.7b/WeXterm.c
--- 1.5.7a/WeXterm.c	Sun Apr  5 12:44:26 1998
+++ 1.5.7b/WeXterm.c	Mon Apr  6 15:34:34 1998
@@ -482,5 +482,25 @@
    WpeXMouseCursor[WpeXInfo.shape_list[0]]);
 }
 
+/*needed for this vectorize call*/
+#include "vector.h"
+struct dirfile * WpeSetFMDefaultExt(struct dirfile * df,char *
default_str,int num_def)
+{
+char ** def_v;
+int i;
+
+def_v=WpeMalloc( (sizeof(char *) * num_def) + 1);
+
+vectorize(default_str,def_v,num_def+1);
+for (i=0;def_v[i]!=NULL;i++)
+   {
+   df=e_add_df(def_v[i],df);
+   WpeFree(def_v[i]);
+   }
+
+WpeFree(def_v);
+
+return(df);
+}
 #endif
 
diff --unified --recursive --new-file 1.5.7a/WeXterm.h 1.5.7b/WeXterm.h
--- 1.5.7a/WeXterm.h	Sun Apr  5 12:44:26 1998
+++ 1.5.7b/WeXterm.h	Sun Apr  5 21:02:29 1998
@@ -17,6 +17,10 @@
 #include <X11/Xlib.h>
 #include "Xwpe.h"
 
+#ifndef XtermCommand
+	#define XtermCommand	"/usr/X11R6/bin/color_xterm"
+#endif
+
 /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - *\
   New Types
 \* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - */
diff --unified --recursive --new-file 1.5.7a/edit.h 1.5.7b/edit.h
--- 1.5.7a/edit.h	Sun Apr  5 12:44:26 1998
+++ 1.5.7b/edit.h	Mon Apr  6 15:35:41 1998
@@ -33,6 +33,11 @@
 #define MAXLINES 10
 #define MAXCOLUM 120
 
+/*this defines an easy reference for the struct*/
+/*dirfile in the file manager*/
+#define FM_FILE_DIRFILE		(f->ed->fdf)
+#define FM_DIR_DIRFILE		(f->ed->ddf)
+
 #if  MOUSE
 struct mouse {
  int x;
@@ -634,7 +639,14 @@
 extern int (*e_u_sys_end)(void);
 extern void (*WpeMouseChangeShape)(WpeMouseShape new_shape);
 extern void (*WpeMouseRestoreShape)(void);
+extern struct dirfile * WpeSetFMDefaultExt(struct dirfile *df,char *
default_str,int num_def);
+
 
+/* WpePrintDirFile.c */
+/*
+extern void WpePrintDirFile(struct dirfile *df,char * fstr,...);
+extern void WpePrintAllDirFiles(ECNT * cn,char * fstr,...);
+*/
 
 /*    we_term.c    */
 
diff --unified --recursive --new-file 1.5.7a/unixkeys.h
1.5.7b/unixkeys.h
--- 1.5.7a/unixkeys.h	Sun Apr  5 12:44:26 1998
+++ 1.5.7b/unixkeys.h	Mon Apr  6 05:38:43 1998
@@ -5,35 +5,53 @@
 /* GNU General Public License, see the file COPYING.      */
 
 #ifndef DJGPP
-#define SYNTAX_FILE "syntax_def"
-#define HELP_FILE   "help.xwpe"
-#define OPTION_FILE "xwperc"
-#define LIBRARY_DIR "/usr/local/lib/xwpe"
-#define XWPE_HOME   ".xwpe"
+	#define SYNTAX_FILE "syntax_def"
+	#define HELP_FILE   "help.xwpe"
+	#define OPTION_FILE "xwperc"
+	#define LIBRARY_DIR "/usr/local/lib/xwpe"
+	#define XWPE_HOME   ".xwpe"
 
-#define WASTEBASKET ".wastebasket"
-#define BUFFER_NAME "Buffer"   /*  Clipboard in Buffer geaendert  */
-#define SUDIR "*"
-#define MAXREC 15
-#ifndef INFO_FILE
-#define INFO_FILE "/usr/info"
-#endif
-#ifndef DEF_SHELL
-#define DEF_SHELL "sh"
-#endif
+	#define WASTEBASKET ".wastebasket"
+	#define BUFFER_NAME "Buffer"   /*  Clipboard in Buffer geaendert  */
+	#define SUDIR "*"
+	#ifndef FM_DEFAULT
+		#define FM_DEFAULT "*.[ch]"
+	#endif
+	#ifndef FM_DEFAULT_STR
+		#define FM_DEFAULT_STR "*.[CH] Makefile* *"
+	#endif
+	#ifndef FM_DEFAULT_NUM
+		#define FM_DEFAULT_NUM 3
+	#endif
+	#define MAXREC 15
+	#ifndef INFO_FILE
+		#define INFO_FILE "/usr/info"
+	#endif
+	#ifndef DEF_SHELL
+		#define DEF_SHELL "sh"
+	#endif
 #else
-#define WE_HELP_ED  "we.hlp"
-#define SYNFILE     "syntax.def"
-#define WASTEBASKET "waste.tmp"
-#define BUFFER_NAME "Buffer"   /*  Clipboard in Buffer geaendert  */
-#define WPE_LIB_DIR "lib/wpe"
-#define OPTFILE  "wpe.opt"
-#define SYSOPTFILE  "wpe.opt"
-#define SUDIR "*"
-#define MAXREC 15
-#ifndef INFO_FILE
-#define INFO_FILE "/djgpp/info"
-#endif
+	#define WE_HELP_ED  "we.hlp"
+	#define SYNFILE     "syntax.def"
+	#define WASTEBASKET "waste.tmp"
+	#define BUFFER_NAME "Buffer"   /*  Clipboard in Buffer geaendert  */
+	#define WPE_LIB_DIR "lib/wpe"
+	#define OPTFILE  "wpe.opt"
+	#define SYSOPTFILE  "wpe.opt"
+	#define SUDIR "*"
+	#ifndef FM_DEFAULT
+		#define FM_DEFAULT "*.[ch]"
+	#endif
+	#ifndef FM_DEFAULT_STR
+		#define FM_DEFAULT_STR "*.[CH] Makefile* *"
+	#endif
+	#ifndef FM_DEFAULT_NUM
+		#define FM_DEFAULT_NUM 3
+	#endif
+	#define MAXREC 15
+	#ifndef INFO_FILE
+		#define INFO_FILE "/djgpp/info"
+	#endif
 #endif
 
 /*   Zeichen  */
diff --unified --recursive --new-file 1.5.7a/vector.c 1.5.7b/vector.c
--- 1.5.7a/vector.c	Wed Dec 31 16:00:00 1969
+++ 1.5.7b/vector.c	Mon Apr  6 15:12:33 1998
@@ -0,0 +1,48 @@
+#include "vector.h"
+
+/*vectorize will return max_args if new_vector is filled*/
+/*or else the number of conversion*/
+int vectorize ( char * line_buf, char ** new_vector, int max_args )
+{
+int c1,c2,c3;
+char current;
+char new_arg[1024];
+
+new_arg[1023]=0;
+c1=0;
+c2=0;
+c3=0;
+
+while ( (current=line_buf[c1]) != 0 )/*while not at end of line*/
+	{
+	if ( current==' ' || current =='\t' || current == '\n')
+		{
+		c1++;/*skip spaces,tabs and newlines*/
+		if ( c2 != 0 )/*word terminator*/
+			{
+			new_arg[c2]=0;/*add the null*/
+			new_vector[c3]=strdup(new_arg);/*copy into vect*/
+			c2=0;/*set local word buff ptr back to zero*/
+                        c3++;/*increment new vect ptr*/
+                        if (c3 + 1 ==max_args)
+                           break;
+                        }
+		}
+	else
+		{/*we're in a word*/
+		new_arg[c2]=current;/*put current char into local buf*/
+		c2++;/*increment local buff ptr*/
+		c1++;/*increment line buf ptr*/
+		}
+	}
+if ( c2 != 0 )/*in case we reached eol while still in a word*/
+	{
+	new_arg[c2]=0;/*add the null*/
+	new_vector[c3]=strdup(new_arg);/*copy into vect*/
+	c3++;/*increment new vect ptr*/
+	}
+        
+new_vector[c3]=(char *)0;/*terminate the new vector*/
+
+return c3;
+}
diff --unified --recursive --new-file 1.5.7a/vector.h 1.5.7b/vector.h
--- 1.5.7a/vector.h	Wed Dec 31 16:00:00 1969
+++ 1.5.7b/vector.h	Mon Apr  6 15:13:06 1998
@@ -0,0 +1,7 @@
+#ifndef __VECTOR_H__
+#define __VECTOR_H__
+
+#include <strings.h>
+
+extern int vectorize ( char * line_buf, char ** new_vector, int
max_args );
+#endif
diff --unified --recursive --new-file 1.5.7a/we_block.c
1.5.7b/we_block.c
--- 1.5.7a/we_block.c	Sun Apr  5 12:44:26 1998
+++ 1.5.7b/we_block.c	Sun Apr  5 19:02:23 1998
@@ -974,8 +974,8 @@
    o->crsw = AltO;
    e_add_txtstr(4, 4, "Options:", o);
    e_add_wrstr(4, 2, 18, 2, 35, 128, 0, AltT, "Text to Find:",
fd->search, &f->ed->sdf, o);
-   e_add_wrstr(4, 10, 17, 10, 36, 128, 0, AltF, "File:", fd->file,
&f->ed->fdf, o);
-   e_add_wrstr(4, 12, 17, 12, 36, 128, 0, AltD, "Directory:",
fd->dirct, &f->ed->ddf, o);
+   e_add_wrstr(4, 10, 17, 10, 36, 128, 0, AltF, "File:", fd->file,
&FM_FILE_DIRFILE, o);
+   e_add_wrstr(4, 12, 17, 12, 36, 128, 0, AltD, "Directory:",
fd->dirct, &FM_DIR_DIRFILE, o);
    e_add_sswstr(5, 5, 0, AltC, fd->sw & 128 ? 1 : 0, "Case sensative   
", o);
    e_add_sswstr(5, 6, 0, AltW, fd->sw & 64 ? 1 : 0, "Whole words only 
", o);
    e_add_sswstr(5, 7, 0, AltR, fd->sw & 32 ? 1 : 0, "Regular
expression", o);
@@ -1008,8 +1008,8 @@
    o->name = "Find File";
    o->crsw = AltO;
    e_add_txtstr(4, 6, "Options:", o);
-   e_add_wrstr(4, 2, 15, 2, 36, 128, 0, AltF, "File:", fd->file,
&f->ed->fdf, o);
-   e_add_wrstr(4, 4, 15, 4, 36, 128, 0, AltD, "Directory:", fd->dirct,
&f->ed->ddf, o);
+   e_add_wrstr(4, 2, 15, 2, 36, 128, 0, AltF, "File:", fd->file,
&FM_FILE_DIRFILE, o);
+   e_add_wrstr(4, 4, 15, 4, 36, 128, 0, AltD, "Directory:", fd->dirct,
&FM_DIR_DIRFILE, o);
    e_add_sswstr(5, 7, 0, AltS, 1, "Search Recursive  ", o);
    e_add_bttstr(13, 9, 1, AltO, " Ok ", NULL, o);
    e_add_bttstr(33, 9, -1, ESC, "Cancel", NULL, o);
diff --unified --recursive --new-file 1.5.7a/we_debug.c
1.5.7b/we_debug.c
--- 1.5.7a/we_debug.c	Sun Apr  5 12:44:26 1998
+++ 1.5.7b/we_debug.c	Mon Apr  6 15:47:30 1998
@@ -7,6 +7,10 @@
 #include "messages.h"
 #include "edit.h"
 
+#ifndef NO_XWINDOWS
+	#include "WeXterm.h"
+#endif
+
 #ifdef DEBUGGER
 
 #define D_CBREAK -2
@@ -494,7 +498,9 @@
    int ret;
    if((ret = e_add_arguments(str, "Add Watch",
       f, 0, AltA, &f->ed->wdf)) != ESC)
+      {
       f->ed->wdf = e_add_df(str, f->ed->wdf);
+      }
    fk_cursor(1);
    return(ret);
 }
@@ -1311,9 +1317,13 @@
       fprintf(fp, "rm -f %s\n", file);
       fclose(fp);
       chmod(file, 0755);
-
-      execlp("xterm", "xterm", "+sb",
-	 "-geometry", "80x25-0-0", "-e", user_shell, "-c", file, NULL);
+#ifndef NO_XWINDOWS
+     
execl(XtermCommand,XtermCommand,"+sb","-geometry","80x25-0-0","-e",user_shell,"-c",file,NULL);
+#else
+/*this will probably break compilation with an undefined reference to*/
+/*the #define XtermCommand */
+     
execl(XtermCommand,XtermCommand,"+sb","-geometry","80x25-0-0","-e",user_shell,"-c",file,NULL);
+#endif
       remove(file);
    }
    else
diff --unified --recursive --new-file 1.5.7a/we_edit.c 1.5.7b/we_edit.c
--- 1.5.7a/we_edit.c	Sun Apr  5 12:44:26 1998
+++ 1.5.7b/we_edit.c	Mon Apr  6 15:27:26 1998
@@ -1376,25 +1376,20 @@
       s->c.y = b->b.y - (f->e.y - f->a.y)/2;*/
 	if (b->b.y - s->c.y < -1)
         {
-         /*WeDebugPrint(f,"(b->b.y - s->c.y < 5)==TRUE");*/
          s->c.y = b->b.y - (NUM_LINES_ON_SCREEN)/2;
         }
       	else if (b->b.y - s->c.y == -1)
         {
-	 /*WeDebugPrint(f,"(b->b.y - s->c.y < 0)==TRUE");*/
          s->c.y -= 1;
         }
 	else if (b->b.y - s->c.y > NUM_LINES_ON_SCREEN -1)
       	{
-	 /*WeDebugPrint(f,"(b->b.y - s->c.y >= NUM_LINES_ON_SCREEN -1 + 5
)==TRUE");*/
          s->c.y = b->b.y - (NUM_LINES_ON_SCREEN)/2;
         }
       	else if (b->b.y - s->c.y == NUM_LINES_ON_SCREEN -1)
 	{
-	 /*WeDebugPrint(f,"(b->b.y - s->c.y >= NUM_LINES_ON_SCREEN
-1)==TRUE");*/
 	 s->c.y += 1;
       	}
-	/*WeDebugPrint(f,"s->c.y after effects");*/
 #else
       if(b->b.y - s->c.y < 0) s->c.y = b->b.y;
       else if(b->b.y - s->c.y >= NUM_LINES_ON_SCREEN -1)
diff --unified --recursive --new-file 1.5.7a/we_fl_fkt.c
1.5.7b/we_fl_fkt.c
--- 1.5.7a/we_fl_fkt.c	Sun Apr  5 12:44:26 1998
+++ 1.5.7b/we_fl_fkt.c	Mon Apr  6 04:53:11 1998
@@ -514,7 +514,6 @@
    int xrt = 0;
 #endif
    int i = fw->ia, len;
-   if(fw->df != NULL)
    {  for(; i < fw->df->anz && i-fw->ia < fw->ye-fw->ya; i++)
       {  if((len=strlen(*(fw->df->name+i))) < 0) len = 0;
 	 if(i == fw->nf && c && len >= fw->ja)
@@ -544,7 +543,7 @@
 			fw->f->fb->em.fb, len, fw->nxfo, fw->ja);
 	 }
       }
-   }
+   }/*fw->df != NULL*/
    for(; i-fw->ia < fw->ye-fw->ya; i++)
    e_blk(fw->xe-fw->xa, fw->xa, fw->ya+i-fw->ia, ft);
 #ifdef NEWSTYLE
diff --unified --recursive --new-file 1.5.7a/we_fl_unix.c
1.5.7b/we_fl_unix.c
--- 1.5.7a/we_fl_unix.c	Sun Apr  5 12:44:26 1998
+++ 1.5.7b/we_fl_unix.c	Mon Apr  6 15:50:58 1998
@@ -64,6 +64,7 @@
    f->save = 0;
    f->zoom = 0;
    f->ed = cn;
+   FM_FILE_DIRFILE =
WpeSetFMDefaultExt(FM_FILE_DIRFILE,FM_DEFAULT_STR,FM_DEFAULT_NUM);
    f->c_sw = NULL;
    f->c_st = NULL;
    f->pic = NULL;
@@ -105,6 +106,9 @@
    
    i = f->ed->flopt & FM_SHOW_HIDDEN_FILES ? 1 : 0;
    if(sw == 3) i |= 2;
+
+   /*b->fw->df will end up with the long listing of files in b->df*/
+   /*b->df gets the file names matching b->rdfile*/
    b->fw->df = e_ext_dirfile(b->df = e_find_files(b->rdfile, i),
f->ed->flopt >> 9);
    
    b->fw->mxa = f->a.x; b->fw->mxe = f->e.x; b->fw->mya = f->a.y;
b->fw->mye = f->e.y;
@@ -382,7 +386,7 @@
 	    cold = c;
 	    fk_cursor(1);
 	    c = e_schr_lst_wsv(b->rdfile, f->a.x+b->xfa, f->a.y+3,
-		   b->xfd+1, 80, f->fb->fr.fb, f->fb->fz.fb, &f->ed->fdf, f);
+		   b->xfd+1, 80, f->fb->fr.fb, f->fb->fz.fb, &FM_FILE_DIRFILE, f);
 #ifdef DJGPP
 	    for(i = strlen(b->rdfile); i>=0 && b->rdfile[i] != DIRC &&
 		     b->rdfile[i] != '/' && b->rdfile[i] != ':'; i--);
@@ -443,7 +447,7 @@
 	    cold = c;
 	    fk_cursor(1);
 	    c = e_schr_lst_wsv(f->dirct, f->a.x+b->xda, f->a.y+3,
-		    b->xdd+1, 80, f->fb->fr.fb, f->fb->fz.fb, &f->ed->ddf, f);
+		    b->xdd+1, 80, f->fb->fr.fb, f->fb->fz.fb, &FM_DIR_DIRFILE, f);
 #if  MOUSE
 	    if(c == -1) c = e_mng_mouse(f);
 #endif
@@ -472,7 +476,7 @@
 		  {  e_ret_wastefile("", f->dirct);
 		     e_schr_nchar_wsv(f->dirct, f->a.x+b->xda, f->a.y+3, 0,
 			b->xdd+1, f->fb->fr.fb, f->fb->fz.fb);
-		     f->ed->ddf = e_add_df(f->dirct, f->ed->ddf);
+		     FM_DIR_DIRFILE = e_add_df(f->dirct, FM_DIR_DIRFILE);
 		     c = AltC;
 		  }
 		  else
@@ -509,7 +513,7 @@
 		  e_mk_path(f->dirct, b->cd, b->dd, b->dw->nf);
 		  e_schr_nchar_wsv(f->dirct, f->a.x+b->xda, f->a.y+3, 0,
 			b->xdd+1, f->fb->fr.fb, f->fb->fz.fb);
-		  f->ed->ddf = e_add_df(f->dirct, f->ed->ddf);
+		  FM_DIR_DIRFILE = e_add_df(f->dirct, FM_DIR_DIRFILE);
 		  c = AltC;
 	       }
 #else
@@ -518,7 +522,7 @@
 	       e_mk_path(f->dirct, b->cd, b->dd, b->dw->nf);
 	       e_schr_nchar_wsv(f->dirct, f->a.x+b->xda, f->a.y+3, 0,
 			b->xdd+1, f->fb->fr.fb, f->fb->fz.fb);
-	       f->ed->ddf = e_add_df(f->dirct, f->ed->ddf);
+	       FM_DIR_DIRFILE = e_add_df(f->dirct, FM_DIR_DIRFILE);
 	       c = AltC;
 #endif
 	    }
@@ -1896,7 +1900,8 @@
    if(f->ed->hdf && f->ed->hdf->anz > 0) strcpy(str,
f->ed->hdf->name[0]);
    else str[0] = '\0';
    if(e_add_arguments(str, "Function", f, 0, AltF, &f->ed->hdf))
-   {  f->ed->hdf = e_add_df(str, f->ed->hdf);
+   {
+      f->ed->hdf = e_add_df(str, f->ed->hdf);
       e_ed_man(str, f);
    }
    return(0);
@@ -1990,9 +1995,12 @@
 	return(-1);
     }
     for (j = 1; j <= MAXEDT; j++)
-    {   for (i = 1; i <= cn->mxedt && cn->edt[i] != j; i++);
-	if( i > cn->mxedt) break;
-    }
+       {
+       for (i = 1; i <= cn->mxedt && cn->edt[i] != j; i++);
+
+       if( i > cn->mxedt)
+          break;
+       }
     cn->curedt=j;
     (cn->mxedt)++;
     cn->edt[cn->mxedt]=j;
diff --unified --recursive --new-file 1.5.7a/we_main.c 1.5.7b/we_main.c
--- 1.5.7a/we_main.c	Sun Apr  5 12:44:26 1998
+++ 1.5.7b/we_main.c	Mon Apr  6 05:03:18 1998
@@ -296,14 +296,14 @@
    getcwd(cn->dirct, 80);
    strcpy(cn->fd.search, "");
    strcpy(cn->fd.replace, "");
-   strcpy(cn->fd.file, SUDIR);
+   strcpy(cn->fd.file, FM_DEFAULT);
    strcpy(cn->fd.dirct, cn->dirct);
    cn->fd.sw = 16;
    cn->fd.sn = 0;
    cn->fd.rn = 0;
    cn->sdf = cn->rdf = cn->fdf = cn->ddf = cn->wdf = cn->hdf = cn->shdf
= NULL;
    uhr.cn = h_error.cn = cn;
-   
+      
                        /*   Standard Einstellungen    */
    cn->dtmd = 'n';
    cn->autosv = 0;
@@ -420,14 +420,15 @@
       }
       else  e_edit(cn, argv[i]);
    }
-   if(cn->mxedt == 0) e_manager(cn->f[cn->mxedt]);
+   if(cn->mxedt == 0)
+      e_manager(cn->f[cn->mxedt]);
    do
-   {
+      {
       if(cn->f[cn->mxedt]->dtmd == 'F') i = e_file_eingabe(cn);
       else if(cn->f[cn->mxedt]->dtmd == 'D') i = e_data_eingabe(cn);
       else i = e_eingabe(cn);
       if(i == AltX) i = e_quit(cn->f[cn->mxedt]);
-   }
+      }
    while ( i != AltX );
    WpeExit(0);
    return 0;
diff --unified --recursive --new-file 1.5.7a/we_prog.c 1.5.7b/we_prog.c
--- 1.5.7a/we_prog.c	Sun Apr  5 12:44:26 1998
+++ 1.5.7b/we_prog.c	Sun Apr  5 19:02:23 1998
@@ -1016,8 +1016,12 @@
    FLWND *fw;
    e_data_first(sw+4, f->ed, f->ed->dirct);
    if(sw > 0)
-   {  if(!(f->ed->edopt & 1)) while(e_data_eingabe(f->ed) != AF3);
-      else while(e_data_eingabe(f->ed) != CF4);
+      {
+      if(!(f->ed->edopt & 1))
+         while(e_data_eingabe(f->ed) != AF3);
+      else
+         while(e_data_eingabe(f->ed) != CF4);
+
       fw = (FLWND *)f->ed->f[f->ed->mxedt]->b;
       fw->df = NULL;
       e_close_window(f->ed->f[f->ed->mxedt]);
@@ -2280,6 +2284,7 @@
    if(sw == 4) title = "Add File";
    else if(sw == 5) title = "Add Variable";
    else if(sw == 6) title = "Add Command";
+   str[0]='\0';/*terminate new string to prevent garbage in display*/
    if(e_add_arguments(str, title, fw->f, 0, AltA, NULL))
    {  fw->df->anz++;
       fw->df->name = REALLOC(fw->df->name, fw->df->anz * sizeof(char
*));
@@ -2299,8 +2304,9 @@
    else if(sw == 5) title = "Change Variable";
    else if(sw == 6) title = "Change Command";
    if(fw->nf < fw->df->anz-1 && fw->df->name[fw->nf])
-   strcpy(str, fw->df->name[fw->nf]);
-   else new = 1;
+      strcpy(str, fw->df->name[fw->nf]);
+   else
+      { new = 1; str[0] = '\0'; }
    if(e_add_arguments(str, title, fw->f, 0, AltA, NULL))
    {  if(fw->nf > fw->df->anz-2)
       {  fw->nf = fw->df->anz-1;
diff --unified --recursive --new-file 1.5.7a/we_wind.c 1.5.7b/we_wind.c
--- 1.5.7a/we_wind.c	Sun Apr  5 12:44:26 1998
+++ 1.5.7b/we_wind.c	Mon Apr  6 05:06:14 1998
@@ -1226,7 +1226,7 @@
       }
       else df->name[0] = tmp;
    }
-   return(df);
+  return(df);
 }
 
 int e_sv_window(int xa, int ya, int *n, struct dirfile *df, FENSTER *f)
@@ -1291,7 +1291,7 @@
 				&& e_mouse.x <= xa+n-1) ret = CDO;
 #endif
       if(ret == CDO && e_sv_window(xa+n, ya, &num, *df, f) == CR)
-      strcpy(str, (*df)->name[num]);
+	strcpy(str, (*df)->name[num]);
    }  while(ret == CDO);
    return(ret);
 }
diff --unified --recursive --new-file 1.5.7a/we_xterm.c
1.5.7b/we_xterm.c
--- 1.5.7a/we_xterm.c	Sun Apr  5 12:44:26 1998
+++ 1.5.7b/we_xterm.c	Sun Apr  5 19:02:24 1998
@@ -754,16 +754,16 @@
    char file[80];
    char *string;
    sprintf(file, "%s/we_sys_tmp", e_tmp_dir);
-   string = MALLOC(strlen(exe) + strlen(file) + strlen(user_shell) +
40);
+   string = MALLOC(strlen(XtermCommand) + strlen(exe) + strlen(file) +
strlen(user_shell) + 36);
    if( !(fp = fopen(file, "w+") ) )
    {  FREE(string);  return(-1);  }
    fputs("$*\necho type \\<Return\\> to continue\nread i\n", fp);
    fclose(fp);
    chmod(file, 0700);
    if(exe[0] == '/')
-   sprintf(string, "xterm -geometry 80x25-0-0 +sb -e %s %s %s",
user_shell, file, exe);
+   sprintf(string, "%s -geometry 80x25-0-0 +sb -e %s %s %s",
XtermCommand, user_shell, file, exe);
    else
-   sprintf(string, "xterm -geometry 80x25-0-0 +sb -e %s %s ./%s",
user_shell, file, exe);
+   sprintf(string, "%s -geometry 80x25-0-0 +sb -e %s %s ./%s",
XtermCommand, user_shell, file, exe);
    ret = system(string);
    remove(file);
    FREE(string);