Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/5/84; site bunkerb.UUCP Path: utzoo!watmath!clyde!burl!ulysses!allegra!mit-eddie!genrad!decvax!ittvax!bunkerb!afs From: afs@bunkerb.UUCP (Andrew F. Seirup) Newsgroups: net.sources Subject: vc enhancements Message-ID: <423@bunkerb.UUCP> Date: Fri, 18-Jan-85 15:58:31 EST Article-I.D.: bunkerb.423 Posted: Fri Jan 18 15:58:31 1985 Date-Received: Sun, 20-Jan-85 05:40:36 EST Distribution: net Organization: Bunker Ramo, Trumbull Ct Lines: 115 Once I finally got the copy row command (^J) to work, I wondered why there wasn't a copy column command. So I added one (^K). Why ^K? It's close to ^J (why is it ^J?). Change it if it makes a difference to you. Also, not having used EMACS heavily for several years, and having used vi, rogue, and hack in the meanwhile, I had difficulty adjusting to the cursor control commands. Since h, j, k, and l where unused commands, (you guessed it) I added them as alternates to ^B, ^N, ^P, and ^F, with the exception that they won't work to move the entry cursor while entering a long command. The code is copied from the originals (as is ^K copied from ^J with the obvious changes). Andrew Seirup - Bunker Ramo, Trumbull CT - (203)386-2086 uucp address: {decvax|ittvax}!bunker!afs *** sc.c Fri Jan 18 09:06:13 1985 --- sc.new Thu Jan 17 16:01:04 1985 *************** *** 269,274 if (curcol > maxcol) curcol = 0; break; case ctl (l): FullUpdate++; break; --- 269,306 ----- if (curcol > maxcol) curcol = 0; break; + case ctl (k): + if (curcol >= MAXCOLS - 1 || maxcol >= MAXCOLS - 1) { + error ("The table can't be any wider"); + break; + } + modflg++; + curcol++; + opencol (curcol); + for (currow = 0; currow <= maxrow; currow++) { + register struct ent *p = tbl[currow][curcol - 1]; + if (p) { + register struct ent *n; + n = lookat (currow, curcol); + n -> v = p -> v; + n -> flags = p -> flags; + n -> expr = copye (p -> expr, 0, 1); + n -> label = 0; + if (p -> label) { + n -> label = (char *) + malloc (strlen (p -> label) + 1); + strcpy (n -> label, p -> label); + } + } + } + for (currow = 0; currow <= maxrow; currow++) { + register struct ent *p = tbl[currow][curcol]; + if (p && (p -> flags & is_valid) && !p -> expr) + break; + } + if (currow > maxrow) + currow = 0; + break; case ctl (l): FullUpdate++; break; *************** *** 424,429 break; case 'Q': running = 0; break; default: if ((c & 0177) != c) --- 456,493 ----- break; case 'Q': running = 0; + break; + case 'h': + while (--arg>=0) { + if (curcol) + curcol--; + else + error ("At column zero"); + } + break; + case 'j': + while (--arg>=0) { + if (currow < MAXROWS - 1) + currow++; + else + error ("The table can't be any longer"); + } + break; + case 'k': + while (--arg>=0) { + if (currow) + currow--; + else + error ("At row zero"); + } + break; + case 'l': + while (--arg>=0) { + if (curcol < MAXCOLS - 1) + curcol++; + else + error ("The table can't be any wider"); + } break; default: if ((c & 0177) != c)