diff -ur joe-2.9.8-pre1.orig/Makefile.in joe-2.9.8-pre1/Makefile.in --- joe-2.9.8-pre1.orig/Makefile.in Fri Dec 14 11:59:55 2001 +++ joe-2.9.8-pre1/Makefile.in Sat May 18 20:20:40 2002 @@ -156,7 +156,7 @@ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ -CFLAGS = @CFLAGS@ +CFLAGS = @CFLAGS@ -DIMOVEMENT DIST_SOURCES = $(joe_SOURCES) $(termidx_SOURCES) NROFF = nroff diff -ur joe-2.9.8-pre1.orig/cmd.c joe-2.9.8-pre1/cmd.c --- joe-2.9.8-pre1.orig/cmd.c Mon Dec 10 19:48:53 2001 +++ joe-2.9.8-pre1/cmd.c Sun May 19 23:36:14 2002 @@ -69,7 +69,9 @@ 0, 0, 0}, {"blkmove", TYPETW + TYPEPW + EFIXXCOL + EMOD, ublkmove, 0, 0, 0}, {"blksave", TYPETW + TYPEPW + 0, ublksave, 0, 0, 0}, - {"bof", TYPETW + TYPEPW + EMOVE + EFIXXCOL, u_goto_bof, 0, 0, 0}, +/* {"bof", TYPETW + TYPEPW + EMOVE + EFIXXCOL, u_goto_bof, 0, 0, 0}, */ + {"bof", TYPETW + TYPEPW + EMOVE + EMID + EFIXXCOL, u_goto_bof, 0, 0, 0}, + {"utest", TYPETW + TYPEPW + EMOVE + EFIXXCOL, u_test, 0, 0, 0}, {"bofmenu", TYPEMENU, umbof, 0, 0, 0}, {"bol", TYPETW + TYPEPW + EFIXXCOL, u_goto_bol, 0, 0, 0}, {"bolmenu", TYPEMENU, umbol, 0, 0, 0}, @@ -107,7 +109,8 @@ {"drop", TYPETW + TYPEPW, udrop, 0, 0, 0}, {"dupw", TYPETW, uduptw, 0, 0, 0}, {"edit", TYPETW + TYPEPW, uedit, 0, 0, 0}, - {"eof", TYPETW + TYPEPW + EFIXXCOL + EMOVE, u_goto_eof, 0, 0, 0}, +/* {"eof", TYPETW + TYPEPW + EFIXXCOL + EMOVE, u_goto_eof, 0, 0, 0}, */ + {"eof", TYPETW + TYPEPW + EPOS + EMID + EFIXXCOL, u_goto_eof, 0, 0, 0}, {"eofmenu", TYPEMENU, umeof, 0, 0, 0}, {"eol", TYPETW + TYPEPW + EFIXXCOL, u_goto_eol, 0, 0, 0}, {"eolmenu", TYPEMENU, umeol, 0, 0, 0}, @@ -121,7 +124,8 @@ {"format", TYPETW + TYPEPW + EFIXXCOL + EMOD, uformat, 0, 1, 0}, {"fmtblk", TYPETW + EMOD + EFIXXCOL, ufmtblk, 0, 1, 0}, {"fwrdc", TYPETW + TYPEPW, ufwrdc, 0, 1, "bkwdc"}, - {"gomark", TYPETW + TYPEPW + EMOVE, ugomark, 0, 0, 0}, +/* {"gomark", TYPETW + TYPEPW + EMOVE, ugomark, 0, 0, 0}, */ + {"gomark", TYPETW + TYPEPW + EPOS + EMOVE, ugomark, 0, 0, 0}, {"groww", TYPETW, ugroww, 0, 1, "shrinkw"}, {"isrch", TYPETW + TYPEPW, uisrch, 0, 0, 0}, {"killproc", TYPETW + TYPEPW, ukillpid, 0, 0, 0}, @@ -143,6 +147,7 @@ {"markb", TYPETW + TYPEPW + 0, umarkb, 0, 0, 0}, {"markk", TYPETW + TYPEPW + 0, umarkk, 0, 0, 0}, {"markl", TYPETW + TYPEPW, umarkl, 0, 0, 0}, + {"dupl", TYPETW + TYPEPW, udupl, 0, 0, 0}, {"math", TYPETW + TYPEPW, umath, 0, 0, 0}, {"mode", TYPETW + TYPEPW + TYPEQW, umode, 0, 0, 0}, {"msg", TYPETW + TYPEPW + TYPEQW + TYPEMENU, umsg, 0, 0, 0}, diff -ur joe-2.9.8-pre1.orig/joerc.in joe-2.9.8-pre1/joerc.in --- joe-2.9.8-pre1.orig/joerc.in Mon Dec 10 19:48:54 2001 +++ joe-2.9.8-pre1/joerc.in Sat May 18 20:31:20 2002 @@ -305,6 +305,7 @@ To define a command foo which will goto the beginning of the last line. + :windows Bindings common to all windows type ^@ TO ÿ Type a character abort ^C Abort window @@ -347,7 +348,6 @@ shell ^K ^Z shell ^K z stop ^K ] Stop recording - :main Text editing window :inherit windows @@ -517,7 +517,7 @@ mode ^T Options menu nextpos ^K = Goto next position in position history nextword ^X Goto next word -open ^] Split line + open ^] Split line prevpos ^K - Previous position in history prevword ^Z Previous word redo ^^ Redo changes @@ -547,6 +547,11 @@ uparw ^P uparw ^[ O A uparw ^[ [ A + + + Private macros +dupl ^] Duplicate line + :prompt Prompt windows :inherit main diff -ur joe-2.9.8-pre1.orig/types.h joe-2.9.8-pre1/types.h --- joe-2.9.8-pre1.orig/types.h Mon Dec 3 16:18:54 2001 +++ joe-2.9.8-pre1/types.h Fri May 17 18:55:51 2002 @@ -156,7 +156,11 @@ int changed; int backup; void *undo; +#ifdef IMOVEMENT + P *marks[11]; /* Bookmarks */ +#else P *marks[10]; /* Bookmarks */ +#endif OPTIONS o; /* Options */ P *oldcur; /* Last cursor position before orphaning */ P *oldtop; /* Last top screen position before orphaning */ diff -ur joe-2.9.8-pre1.orig/ublock.c joe-2.9.8-pre1/ublock.c --- joe-2.9.8-pre1.orig/ublock.c Mon Dec 10 19:48:55 2001 +++ joe-2.9.8-pre1/ublock.c Mon May 20 00:56:53 2002 @@ -288,6 +288,20 @@ return 0; } +/* Duplicate line */ + +int udupl(BW *bw) +{ + if (pisbol(bw->cursor) && piseol(bw->cursor)) return 0; /* do nothing */ + umarkl(bw); + if ( piseof(bw->cursor) ) uopen(bw); + pnextl(bw->cursor); + ublkcpy(bw); + unmark(bw); + return 0; +} + + int utomarkb(BW *bw) { if (markb && markb->b == bw->b) { diff -ur joe-2.9.8-pre1.orig/ublock.h joe-2.9.8-pre1/ublock.h --- joe-2.9.8-pre1.orig/ublock.h Mon Dec 3 16:18:54 2001 +++ joe-2.9.8-pre1/ublock.h Sat May 18 18:48:23 2002 @@ -43,5 +43,6 @@ int upsh PARAMS((BW *bw)); int upop PARAMS((BW *bw)); extern int nstack; +int udupl PARAMS((BW *bw)); #endif diff -ur joe-2.9.8-pre1.orig/uedit.c joe-2.9.8-pre1/uedit.c --- joe-2.9.8-pre1.orig/uedit.c Mon Dec 10 19:48:55 2001 +++ joe-2.9.8-pre1/uedit.c Sun May 19 23:29:47 2002 @@ -31,13 +31,21 @@ /******** i don't like global var ******/ + /* * Move cursor to beginning of line */ int u_goto_bol(BW *bw) { - p_goto_bol(bw->cursor); - return 0; +#ifdef IMOVEMENT + if ( pisbol(bw->cursor) ) { + dogomark(bw,':',NULL,NULL); + return 0; + } + dosetmark(bw,':',NULL,NULL); +#endif + p_goto_bol(bw->cursor); + return 0; } /* @@ -45,8 +53,15 @@ */ int u_goto_eol(BW *bw) { - p_goto_eol(bw->cursor); - return 0; +#ifdef IMOVEMENT + if ( piseol(bw->cursor) ) { + dogomark(bw,':',NULL,NULL); + return 0; + } + dosetmark(bw,':',NULL,NULL); +#endif + p_goto_eol(bw->cursor); + return 0; } /* @@ -54,8 +69,15 @@ */ int u_goto_bof(BW *bw) { - p_goto_bof(bw->cursor); - return 0; +#ifdef IMOVEMENT + if ( pisbof(bw->cursor) ) { + dogomark(bw,':',NULL,NULL); + return 0; + } + dosetmark(bw,':',NULL,NULL); +#endif + p_goto_bof(bw->cursor); + return 0; } /* @@ -63,8 +85,15 @@ */ int u_goto_eof(BW *bw) { - p_goto_eof(bw->cursor); - return 0; +#ifdef IMOVEMENT + if ( piseof(bw->cursor) ) { + dogomark(bw,':',NULL,NULL); + return 0; + } + dosetmark(bw,':',NULL,NULL); +#endif + p_goto_eof(bw->cursor); + return 0; } /* @@ -90,26 +119,24 @@ } /* - * Move cursor to beginning of previous word or if there isn't - * previous word then go to beginning of the file - * - * WORD is a sequence non-white-space characters + * Move cursor to begin of prev word or bof + * WORD is a sequence of alnum characters */ int u_goto_prev(BW *bw) { - if (pisbof(bw->cursor)) { - return -1; /* cursor is at beginning of file */ - } else if (isspace(prgetc(bw->cursor))) { - while ((!pisbof(bw->cursor)) && (isspace(prgetc(bw->cursor)))) + if (pisbof(bw->cursor)) return -1; /* cursor is at beginning of file */ + + if (!isalnum_(prgetc(bw->cursor))) { + while ((!pisbof(bw->cursor)) && (!isalnum_(prgetc(bw->cursor)))) /* do nothing */; /* if cursor is on white-space char then find first non-white-space char */ } - if (pisbof(bw->cursor)) { - return -1; /* cursor is at beginning of file */ - } + + if (pisbof(bw->cursor)) return -1; /* cursor is at beginning of file */ + pgetc(bw->cursor); while (!pisbof(bw->cursor)) { - if (isspace(prgetc(bw->cursor))) { /* if previous character is white-space then beginning of word was found */ + if (!isalnum_(prgetc(bw->cursor))) { /* if previous character is white-space then beginning of word was found */ pgetc(bw->cursor); break; } @@ -118,30 +145,32 @@ } /* - * Move cursor to end of next word or if there isn't - * next word then go to end of the file - * - * WORD is a sequence non-white-space characters + * Move cursor to begin of next word or eol or eof + * WORD is a sequence of alnum_ characters */ int u_goto_next(BW *bw) { - if (piseof(bw->cursor)) { - return -1; /* cursor is at end of file */ - } else if (isspace(pgetc(bw->cursor))) { - while ((!piseof(bw->cursor)) && (isspace(pgetc(bw->cursor)))) - /* do nothing */; /* if cursor is on white-space char then find first non-white-space char */ - } - if (piseof(bw->cursor)) { - return -1; /* cursor is at end of file */ - } - prgetc(bw->cursor); + if (piseof(bw->cursor)) return -1; /* cursor is at end of file */ - while (!piseof(bw->cursor)) { - if (isspace(pgetc(bw->cursor))) { /* if next character is white-space then end of word was found */ - prgetc(bw->cursor); - break; + if (isalnum_(pgetc(bw->cursor))) { /* cursor to next non-alnum */ + while (!piseof(bw->cursor)) { + if (!isalnum_(pgetc(bw->cursor))) { + prgetc(bw->cursor); + break; + } } - } + } + + if (piseof(bw->cursor)) return -1; /* cursor is at end of file */ + + if (piseol(bw->cursor)) return 0; /* cursor is at eol */ + + while ((!piseof(bw->cursor)) && (!isalnum_(pgetc(bw->cursor)) )) + if (piseol(bw->cursor)) return 0; + + if (piseof(bw->cursor)) return -1; /* cursor is at end of file */ + + prgetc(bw->cursor); return 0; } @@ -1081,11 +1110,21 @@ { if (notify) *notify = 1; +#ifdef IMOVEMENT + if ( (c >= '0' && c <= '9') || c == ':' ) { +#else if (c >= '0' && c <= '9') { +#endif pdupown(bw->cursor, bw->b->marks + c - '0'); poffline(bw->b->marks[c - '0']); +#ifdef IMOVEMENT + if (c >= '0' && c <= '9') { +#endif snprintf(msgbuf, JOE_MSGBUFSIZE, "Mark %d set", c - '0'); msgnw(bw->parent, msgbuf); +#ifdef IMOVEMENT + } +#endif return 0; } else { nungetc(c); @@ -1109,16 +1148,27 @@ { if (notify) *notify = 1; +#ifdef IMOVEMENT + if( (c>='0' && c<='9') || c == ':') +#else if (c >= '0' && c <= '9') +#endif if (bw->b->marks[c - '0']) { pset(bw->cursor, bw->b->marks[c - '0']); bw->cursor->xcol = piscol(bw->cursor); return 0; } else { +#ifdef IMOVEMENT + if (c >= '0' && c <= '9') { +#endif snprintf(msgbuf, JOE_MSGBUFSIZE, "Mark %d not set", c - '0'); msgnw(bw->parent, msgbuf); +#ifdef IMOVEMENT + } +#endif return -1; - } else { + } + else { nungetc(c); return -1; } @@ -1126,7 +1176,11 @@ int ugomark(BW *bw, int c) { +#ifdef IMOVEMENT + if (c >= '0' && c <= '9' || c == ':') +#else if (c >= '0' && c <= '9') +#endif return dogomark(bw, c, NULL, NULL); else if (mkqwna(bw->parent, sc("Goto bookmark (0-9):"), dogomark, NULL, NULL, NULL)) return 0; diff -ur joe-2.9.8-pre1.orig/uedit.h joe-2.9.8-pre1/uedit.h --- joe-2.9.8-pre1.orig/uedit.h Mon Dec 10 19:48:55 2001 +++ joe-2.9.8-pre1/uedit.h Sun May 19 00:13:49 2002 @@ -18,6 +18,7 @@ * return 0 if action was done * return -1 otherwise */ +int u_test PARAMS((BW *bw)); /* test functions */ int u_goto_bol PARAMS((BW *bw)); /* move cursor to beginning of line */ int u_goto_eol PARAMS((BW *bw)); /* move cursor to end of line */ int u_goto_bof PARAMS((BW *bw)); /* move cursor to beginning of file */ @@ -65,5 +66,4 @@ int ubyte PARAMS((BW *bw)); int ucol PARAMS((BW *bw)); int utxt PARAMS((BASE *bw)); - #endif