# vile 9.5e - patch 2005/01/09 - Thomas Dickey <dickey@invisible-island.net> # ------------------------------------------------------------------------------ # CHANGES | 50 ++++ # MANIFEST | 3 # basic.c | 42 +++- # bind.c | 8 # btree.c | 11 - # buffer.c | 200 +++++++++---------- # display.c | 105 ++++++---- # estruct.h | 8 # eval.c | 7 # filters/cfg-filt.l | 4 # filters/cpp.key | 5 # filters/css-filt.l | 4 # filters/filters.h | 6 # filters/flt_defs.h | 6 # filters/infofilt.l | 4 # filters/lex-filt.l | 118 ++++++++--- # filters/mailfilt.l | 4 # filters/makefile.wnt | 3 # filters/nr-filt.l | 6 # filters/pot-filt.l | 4 # filters/sql-filt.l | 8 # filters/txt-filt.l | 4 # macros/modes.rc | 7 # makefile.in | 6 # makefile.wnt | 23 ++ # mkprlenv.wnt | 4 # ntwinio.c | 37 ++- # patchlev.h | 2 # regexp.c | 4 # revlist | 75 +++---- # statevar.c | 6 # vile-9.5e/test_io.c | 18 + # vile.hlp | 16 + # w32misc.c | 15 - # w32ole.cpp | 15 + # w32reg.c | 512 +++++++++++++++++++++++++++---------------------- # winvile.h | 2 # wvwrap.cpp | 27 ++ # 38 files changed, 861 insertions(+), 518 deletions(-) # ------------------------------------------------------------------------------ Index: CHANGES --- vile-9.5d+/CHANGES 2005-11-30 01:25:56.000000000 +0000 +++ vile-9.5e/CHANGES 2006-01-10 01:20:29.000000000 +0000 @@ -1,5 +1,55 @@ Changes for vile 9.6 (released ??? ??? ?? ????) + 20060109 (e) + > Clark Morgan: + + improved winvile's "flash". + + several changes to w32reg.c: + + if at all possible, don't register ole-enabled winvile using the + path ".\winvile.exe" (obscure cygwin corner case). + + remove use of toUpper(), which is not legit for winvile in this + context because the underlying mapping array is apparently _not_ + initialized. With this fix, "winvile -Ou" now displays the + editor's name in MessageBox text (rather than ""). + + fixed lots of misuses of registry APIs (not properly testing return + code). With fixes in place, winvile -Ou/-Or now properly reports + an error when registration/unregistration is attempted by an + account with insufficient privileges. + + add section definitions to vbmode. + + fix: wvwrap caused winvile to show an 8.3 folder name in Recent + Folders list. + + fix: when CD'ing to a directory stored in winvile's "recent folders" + list, the cursor stayed in the mini-buffer following a call to pwd(). + > Tom Dickey: + + adjust makefile dependencies to allow "make -j4" when building the + loadable filter configuration (report by Ciaran McCreesh). + + add "+", ",", "&", "@" and ";" to URL patterns in filters. + + modify nr-filt.l to allow for optional blanks between the leading + "." and the command. This is common in nroff library macros, not + in manpages, etc. + + improve lex-filt.l, allowing for some flex extensions: + + allow code in action rules to not have curly braces + + allow curly-braces to surround chunks of flex actions + + "*" as a state name. + + add named marks for decimal digits (request by George Eccles). + + fix stray ^@'s on the winvile popup menu resulting from changes to + kcod2prc() for xterm-fkeys mode (report by Clark Morgan). + + add a call to set_editor_title() at the end of swbuffer_lfl() to + make title updates work properly with termcap configuration. + + add %n and %N substitutions for $title-format (prompted by Clark + Morgan comments). + + modify FreeBuffer() to clear window's buffer-pointers that point to + the freed buffer, e.g., to prevent reference to free memory in title + updates (report by Clark Morgan). + + check file descriptors in stdin_data_available() to avoid doing a + fdopen() on an invalid descriptor. + + add "#import" in cpp.key + + modify preamble for xml- and html-modes to ensure that the first + tag determines the type. + + fixes to makefile.wnt and mkprlenv.wnt to work with Visual C++ 7. + + correct padding of subtitle line for "Temporary variables" in + [Variables] buffer, which was applied to all temporary variable + lines. + 20051129 (d) > Tom Dickey: + fix vl_ctype.h to avoid redefinition of UCHAR (reports by Clark Index: MANIFEST --- vile-9.5d+/MANIFEST 2005-11-30 02:20:03.000000000 +0000 +++ vile-9.5e/MANIFEST 2006-01-10 01:29:03.000000000 +0000 @@ -1,4 +1,4 @@ -MANIFEST for vile, version v9_5d +MANIFEST for vile, version v9_5e -------------------------------------------------------------------------------- MANIFEST this file CHANGES Change-log for VILE @@ -106,6 +106,7 @@ tcap.c TERMCAP terminal driver tcap.h interface of tcap.c termio.c low-level terminal I/O support +test_io.c I/O stub for testing linkage requirements trace.c development: trace to logfile trace.h development: trace to logfile ucrypt.c interface to Unix crypt(1) Index: basic.c Prereq: 1.123 --- vile-9.5d+/basic.c 2005-11-16 01:22:08.000000000 +0000 +++ vile-9.5e/basic.c 2005-12-27 02:07:06.000000000 +0000 @@ -5,7 +5,7 @@ * functions that adjust the top line in the window and invalidate the * framing, are hard. * - * $Header: /usr/build/vile/vile/RCS/basic.c,v 1.123 2005/11/16 01:22:08 tom Exp $ + * $Header: /usr/build/vile/vile/RCS/basic.c,v 1.124 2005/12/27 02:07:06 tom Exp $ * */ @@ -1069,6 +1069,34 @@ return code; } +#if NMARKS > 26 +static int +nmark2inx(int c) +{ + if (isDigit(c)) { + return c - '0' + 26; + } else if (isLower(c)) { + return c - 'a'; + } + return -1; +} + +static int +inx2nmark(int c) +{ + if (c > 36 || c < 0) { + return '?'; + } else if (c >= 26) { + return c - 26 + '0'; + } else { + return c + 'a'; + } +} +#else +#define nmark2inx(c) ((c) - 'a') +#define inx2nmark(c) ((c) + 'a') +#endif + #if OPT_SHOW_MARKS static int show_mark(int count, BUFFER *bp, MARK mark, int name) @@ -1123,7 +1151,7 @@ } if (bp->b_nmmarks != 0) { for (n = 0; n < NMARKS; n++) { - done += show_mark(done, bp, bp->b_nmmarks[n], n + 'a'); + done += show_mark(done, bp, bp->b_nmmarks[n], inx2nmark(n)); } } #if OPT_SELECTIONS @@ -1172,6 +1200,10 @@ { if (isLower(c) || c == SQUOTE) return TRUE; +#if !SMALLER + if (isDigit(c)) + return TRUE; +#endif #if OPT_SELECTIONS if (c == '<' || c == '>') return TRUE; @@ -1196,7 +1228,7 @@ } else #endif if (curbp->b_nmmarks != NULL) { - *markp = curbp->b_nmmarks[c - 'a']; + *markp = curbp->b_nmmarks[nmark2inx(c)]; } else { result = FALSE; } @@ -1238,7 +1270,7 @@ return ABORT; } - if (c < 'a' || c > 'z') { + if (nmark2inx(c) < 0) { return invalid_nmmark(); } @@ -1255,7 +1287,7 @@ } } - curbp->b_nmmarks[c - 'a'] = DOT; + curbp->b_nmmarks[nmark2inx(c)] = DOT; return show_mark_is_set(c); } Index: bind.c Prereq: 1.290 --- vile-9.5d+/bind.c 2005-11-24 01:30:54.000000000 +0000 +++ vile-9.5e/bind.c 2005-12-26 00:28:04.000000000 +0000 @@ -3,7 +3,7 @@ * * written 11-feb-86 by Daniel Lawrence * - * $Header: /usr/build/vile/vile/RCS/bind.c,v 1.290 2005/11/24 01:30:54 tom Exp $ + * $Header: /usr/build/vile/vile/RCS/bind.c,v 1.291 2005/12/26 00:28:04 tom Exp $ * */ @@ -1732,9 +1732,11 @@ length = kcod2pstr(c, temp, sizeof(temp))[0]; #if OPT_KEY_MODIFY - if ((c & mod_KEY) != 0 && length != 0) { + if ((c & mod_KEY) != 0 && (length != 0)) { (void) strcpy(seq, temp + 1); - (void) bytes2prc(seq + length - 1, temp + length, 1); + if (length < (int) (1 + strlen(temp + 1) + (CharOf(c) == 0))) { + (void) bytes2prc(seq + length - 1, temp + length, 1); + } } else #endif (void) bytes2prc(seq, temp + 1, length); Index: btree.c Prereq: 1.21 --- vile-9.5d+/btree.c 2005-01-24 22:21:38.000000000 +0000 +++ vile-9.5e/btree.c 2006-01-10 01:19:19.000000000 +0000 @@ -1,5 +1,5 @@ /* - * $Id: btree.c,v 1.21 2005/01/24 22:21:38 tom Exp $ + * $Id: btree.c,v 1.22 2006/01/10 01:19:19 tom Exp $ * Copyright 1997-2005 by Thomas E. Dickey * * Maintains a balanced binary tree (aka AVL tree) of unspecified nodes. The @@ -39,6 +39,8 @@ #define beginDisplay() /* nothing */ #define endofDisplay() /* nothing */ +#include <time.h> + #else #include "estruct.h" #include "edef.h" @@ -896,7 +898,7 @@ printf("** list(%s)\n", t); for (n = 0; list[n] != 0; n++) printf("[%d] '%s'\n", n, list[n]); - free(list); + free((char *) list); } else printf("** list(%s) fail\n", t); break; @@ -910,8 +912,9 @@ btree_printf(&text_tree); break; case 'r': + srand((unsigned) time(NULL)); for (n = 0; n < MAX_VEC; n++) { - vector[n] = random(); + vector[n] = rand(); sprintf(buffer, "%d", vector[n]); temp.bi_key = buffer; (void) btree_insert(&text_tree, &temp); @@ -919,7 +922,7 @@ } for (m = 0; m < 2; m++) for (n = 0; n < MAX_VEC; n++) { - unsigned delete = random() & 1; + unsigned delete = rand() & 1; char *name = delete ? "delete" : "insert"; int ok; Index: buffer.c Prereq: 1.296 --- vile-9.5d+/buffer.c 2005-09-26 22:50:14.000000000 +0000 +++ vile-9.5e/buffer.c 2005-12-25 22:00:59.000000000 +0000 @@ -5,7 +5,7 @@ * keys. Like everyone else, they set hints * for the display system. * - * $Header: /usr/build/vile/vile/RCS/buffer.c,v 1.296 2005/09/26 22:50:14 tom Exp $ + * $Header: /usr/build/vile/vile/RCS/buffer.c,v 1.298 2005/12/25 22:00:59 tom Exp $ * */ @@ -304,6 +304,8 @@ static void FreeBuffer(BUFFER *bp) { + WINDOW *wp; + beginDisplay(); if (bp->b_fname != out_of_mem) @@ -328,6 +330,13 @@ #endif free((char *) bp); /* Release buffer block */ } + + for_each_window(wp) { + if (wp->w_bufp == bp) { + wp->w_bufp = 0; + } + } + endofDisplay(); } @@ -1094,113 +1103,117 @@ if (!b_is_reading(bp) && !bp->b_active) /* on second thought, yes there is */ s = suckitin(bp, TRUE, lockfl); - - returnCode(s); - } + } else { #if !WINMARK - /* Whatever else we do, make sure MK isn't bogus when we leave */ - MK = nullmark; + /* Whatever else we do, make sure MK isn't bogus when we leave */ + MK = nullmark; #endif - if (valid_buffer(curbp)) { - /* if we'll have to take over this window, and it's the last */ - if ((this_window || bp->b_nwnd == 0) - && curbp->b_nwnd != 0 && --(curbp->b_nwnd) == 0) { - undispbuff(curbp, curwp); - } else if (DOT.l != 0 && (this_window || bp->b_nwnd == 0)) { - /* Window is still getting taken over so make a - copy of the traits for a possible future - set-window */ - copy_traits(&(curbp->b_wtraits), &(curwp->w_traits)); + if (valid_buffer(curbp)) { + /* if we'll have to take over this window, and it's the last */ + if ((this_window || bp->b_nwnd == 0) + && curbp->b_nwnd != 0 && --(curbp->b_nwnd) == 0) { + undispbuff(curbp, curwp); + } else if (DOT.l != 0 && (this_window || bp->b_nwnd == 0)) { + /* Window is still getting taken over so make a + copy of the traits for a possible future + set-window */ + copy_traits(&(curbp->b_wtraits), &(curwp->w_traits)); + } } - } - /* don't let make_current() call the hook -- there's - more to be done down below */ - DisableHook(&bufhook); - make_current(bp); /* sets curbp */ - EnableHook(&bufhook); - - bp = curbp; /* if running the bufhook caused an error, we may - be in a different buffer than we thought - we were going to */ + /* don't let make_current() call the hook -- there's + more to be done down below */ + DisableHook(&bufhook); + make_current(bp); /* sets curbp */ + EnableHook(&bufhook); + + bp = curbp; /* if running the bufhook caused an error, + we may be in a different buffer than we + thought we were going to */ #if !SMALLER - if (this_window) { - /* Put buffer in this window even if it's already on - screen */ - LINE *lp; - int trait_matches; - if (curwp == 0) - returnCode(FALSE); - if (curwp->w_bufp == bp) - returnCode(TRUE); - if (curwp->w_bufp->b_nwnd == 0) - undispbuff(curwp->w_bufp, curwp); - else - copy_traits(&(curwp->w_bufp->b_wtraits), - &(curwp->w_traits)); + if (this_window) { + /* Put buffer in this window even if it's already on screen */ + LINE *lp; + int trait_matches; + + if (curwp == 0) + returnCode(FALSE); + else if (curwp->w_bufp == bp) + returnCode(TRUE); - /* Initialize the window using the saved buffer traits - * if possible. If they don't pass a sanity check, - * simply initialize the newest window to be a clone - * of any other window on the buffer, or initialize it - * as we do in popupbuff(). - */ + if (curwp->w_bufp->b_nwnd == 0) + undispbuff(curwp->w_bufp, curwp); + else + copy_traits(&(curwp->w_bufp->b_wtraits), + &(curwp->w_traits)); - trait_matches = 0; + /* Initialize the window using the saved buffer traits if possible. + * If they don't pass a sanity check, simply initialize the newest + * window to be a clone of any other window on the buffer, or + * initialize it as we do in popupbuff(). + */ + trait_matches = 0; #if WINMARK #define TRAIT_MATCHES_NEEDED 5 #else #define TRAIT_MATCHES_NEEDED 4 #endif - for_each_line(lp, bp) { - if (lp == bp->b_dot.l && llength(lp) > bp->b_dot.o) - trait_matches++; + for_each_line(lp, bp) { + if (lp == bp->b_dot.l && llength(lp) > bp->b_dot.o) + trait_matches++; #if WINMARK - if (lp == bp->b_mark.l && llength(lp) > bp->b_mark.o) - trait_matches++; + if (lp == bp->b_mark.l && llength(lp) > bp->b_mark.o) + trait_matches++; #endif - if (lp == bp->b_lastdot.l && llength(lp) > bp->b_lastdot.o) - trait_matches++; - if (lp == bp->b_tentative_lastdot.l && llength(lp) > bp->b_tentative_lastdot.o) - trait_matches++; - if (lp == bp->b_wline.l && llength(lp) > bp->b_wline.o) - trait_matches++; + if (lp == bp->b_lastdot.l && llength(lp) > bp->b_lastdot.o) + trait_matches++; + if (lp == bp->b_tentative_lastdot.l && llength(lp) > bp->b_tentative_lastdot.o) + trait_matches++; + if (lp == bp->b_wline.l && llength(lp) > bp->b_wline.o) + trait_matches++; + if (trait_matches == TRAIT_MATCHES_NEEDED) + break; + } if (trait_matches == TRAIT_MATCHES_NEEDED) - break; - } - if (trait_matches == TRAIT_MATCHES_NEEDED) - copy_traits(&(curwp->w_traits), &(bp->b_wtraits)); - else if ((wp = bp2any_wp(bp)) == 0) - init_window(curwp, bp); - else - clone_window(curwp, wp); - } else + copy_traits(&(curwp->w_traits), &(bp->b_wtraits)); + else if ((wp = bp2any_wp(bp)) == 0) + init_window(curwp, bp); + else + clone_window(curwp, wp); + + curwp->w_bufp = bp; + s = suckitin(bp, (bp->b_nwnd++ == 0), lockfl); + } else #endif /* !SMALLER */ - /* get it already on the screen if possible */ - if (bp->b_nwnd != 0) { /* then it's on the screen somewhere */ - if ((wp = bp2any_wp(bp)) == 0) - mlforce("BUG: swbuffer: wp still NULL"); - curwp = wp; - upmode(); + /* get it already on the screen if possible */ + if (bp->b_nwnd != 0) { /* then it's on the screen somewhere */ + if ((wp = bp2any_wp(bp)) == 0) + mlforce("BUG: swbuffer: wp still NULL"); + curwp = wp; + upmode(); #ifdef MDCHK_MODTIME - (void) check_file_changed(bp, bp->b_fname); + (void) check_file_changed(bp, bp->b_fname); #endif #if OPT_UPBUFF - if (bp != find_BufferList()) - updatelistbuffers(); + if (bp != find_BufferList()) + updatelistbuffers(); #endif - run_buffer_hook(); - returnCode(find_bp(bp) != 0); - } else if (curwp == 0) { - returnCode(FALSE); /* we haven't started displaying yet */ + run_buffer_hook(); + s = (find_bp(bp) != 0); + } else if (curwp == 0) { + s = FALSE; /* we haven't started displaying yet */ + } else { + /* oh well, suck it into this window */ + curwp->w_bufp = bp; + s = suckitin(bp, (bp->b_nwnd++ == 0), lockfl); + } } - - /* oh well, suck it into this window */ - - curwp->w_bufp = bp; - returnCode(suckitin(bp, (bp->b_nwnd++ == 0), lockfl)); +#if OPT_TITLE + set_editor_title(); +#endif + returnCode(s); } #if VILE_NEEDED @@ -1624,8 +1637,6 @@ if (buffer_in_use(bp)) returnCode(FALSE); -#define no_del -#ifdef no_del if (buffer_is_visible(bp)) /* Error if on screen. */ returnCode(FALSE); if (is_fake_window(wheadp)) { @@ -1642,21 +1653,6 @@ } } } -#else - if (curbp == bp) { - didswitch = TRUE; - if (buffer_is_solo(bp)) { - returnCode(FALSE); - } - } - if (bp->b_nwnd != 0 || is_fake_window(wheadp)) { - /* then it's on the screen somewhere - or there are fake windows to worry about */ - (void) zotwp(bp); - if (find_bp(bp) == 0) /* delwp must have zotted us */ - returnCode(TRUE); - } -#endif #if OPT_LCKFILES /* If Buffer is killed and not locked by other then release own lock */ if (global_g_val(GMDUSEFILELOCK)) { Index: display.c Prereq: 1.410 --- vile-9.5d+/display.c 2005-11-30 01:34:50.000000000 +0000 +++ vile-9.5e/display.c 2005-12-25 21:44:45.000000000 +0000 @@ -5,7 +5,7 @@ * functions use hints that are left in the windows by the commands. * * - * $Header: /usr/build/vile/vile/RCS/display.c,v 1.410 2005/11/30 01:34:50 tom Exp $ + * $Header: /usr/build/vile/vile/RCS/display.c,v 1.413 2005/12/25 21:44:45 tom Exp $ * */ @@ -2385,18 +2385,13 @@ } } -/* - * Redisplay the mode line for the window pointed to by the "wp". - * modeline() is the only routine that has any idea of how the modeline is - * formatted. You can change the modeline format by hacking at this - * routine. Called by "update" any time there is a dirty window. - */ #if OPT_MLFORMAT || OPT_POSFORMAT || OPT_TITLE static void -mlfs_prefix(const char **fsp, char **msp, int lchar) +mlfs_prefix(const char **fsp, char **msp, char lchar) { const char *fs = *fsp; char *ms = *msp; + if (*fs == ':') { fs++; while (*fs && *fs != ':') { @@ -2415,7 +2410,7 @@ *ms++ = ':'; break; case '-': - *ms++ = (char) lchar; + *ms++ = lchar; break; default: *ms++ = '%'; @@ -2430,7 +2425,7 @@ } static void -mlfs_suffix(const char **fsp, char **msp, int lchar) +mlfs_suffix(const char **fsp, char **msp, char lchar) { mlfs_prefix(fsp, msp, lchar); if (**fsp == ':') @@ -2542,10 +2537,10 @@ return (mcnt != 0); } -static int -modeline_show(WINDOW *wp, int lchar) +static char +modeline_show(WINDOW *wp, char lchar) { - int ic = lchar; + char ic = lchar; BUFFER *bp = wp->w_bufp; if (b_val(bp, MDSHOWMODE)) { @@ -2636,10 +2631,11 @@ char temp[NFILEN]; int col; int fc; - int lchar; + char lchar; int need_eighty_column_indicator; int right_len; int n; + int skip = TRUE; if (fs == 0) return; @@ -2679,20 +2675,20 @@ need_eighty_column_indicator = TRUE; break; case '-': - *ms++ = (char) lchar; + *ms++ = lchar; break; case '=': *ms = EOS; ms = right_ms; break; case 'i': /* insert mode indicator */ - *ms++ = (char) modeline_show(wp, lchar); + *ms++ = modeline_show(wp, lchar); break; case 'b': - ms = lsprintf(ms, "%s", bp->b_bname); + ms = lsprintf(ms, "%s", bp ? bp->b_bname : UNNAMED_BufName); break; case 'm': - if (modeline_modes(bp, (char **) 0)) { + if (bp != 0 && modeline_modes(bp, (char **) 0)) { mlfs_prefix(&fs, &ms, lchar); (void) modeline_modes(bp, &ms); mlfs_suffix(&fs, &ms, lchar); @@ -2700,34 +2696,61 @@ mlfs_skipfix(&fs); break; case 'f': - case 'F':{ + case 'F': + skip = TRUE; /* assumption */ + + if (bp != 0 && bp->b_fname != 0) { char *p; - int skip = TRUE; /* assumption */ - if (bp->b_fname != 0) { - /* - * when b_fname is a pipe cmd, it can be - * arbitrarily long - */ + /* + * when b_fname is a pipe cmd, it can be + * arbitrarily long + */ + vl_strncpy(temp, bp->b_fname, sizeof(temp)); + temp[sizeof(temp) - 1] = '\0'; + + if ((p = shorten_path(temp, FALSE)) != 0 + && *p + && !eql_bname(bp, p) + && ((fc == 'f') + ? !is_internalname(p) + : is_internalname(p))) { + mlfs_prefix(&fs, &ms, lchar); + for (; *p == ' '; p++) ; + ms = lsprintf(ms, "%s", p); + mlfs_suffix(&fs, &ms, lchar); + skip = FALSE; + } + } + if (skip) + mlfs_skipfix(&fs); + break; + case 'n': + case 'N': + mlfs_prefix(&fs, &ms, lchar); + if (bp != 0) { + if (bp->b_fname != 0 && !is_internalname(bp->b_bname)) { + char *p; vl_strncpy(temp, bp->b_fname, sizeof(temp)); temp[sizeof(temp) - 1] = '\0'; - if ((p = shorten_path(temp, FALSE)) != 0 - && *p - && !eql_bname(bp, p) - && (fc == 'f' ? !is_internalname(p) - : is_internalname(p))) { - mlfs_prefix(&fs, &ms, lchar); - for (; *p == ' '; p++) ; - ms = lsprintf(ms, "%s", p); - mlfs_suffix(&fs, &ms, lchar); - skip = FALSE; + + if (fc == 'n') { + p = shorten_path(temp, FALSE); + if (p == 0) + p = temp; + } else { + p = temp; } + ms = lsprintf(ms, "%s", p); + } else { + ms = lsprintf(ms, "%s", bp->b_bname); } - if (skip) - mlfs_skipfix(&fs); - break; + } else { + ms = lsprintf(ms, "%s", UNNAMED_BufName); } + mlfs_suffix(&fs, &ms, lchar); + break; #ifdef WMDRULER case 'l': /* line number */ case 'c': /* column number */ @@ -2899,6 +2922,12 @@ } #endif +/* + * Redisplay the mode line for the window pointed to by the "wp". + * This is the only routine that has any idea of how the modeline is + * formatted. You can change the modeline format by hacking at this + * routine. Called by "update" any time there is a dirty window. + */ static void update_modeline(WINDOW *wp) { Index: estruct.h Prereq: 1.591 --- vile-9.5d+/estruct.h 2005-11-30 02:18:18.000000000 +0000 +++ vile-9.5e/estruct.h 2005-12-26 01:29:43.000000000 +0000 @@ -12,7 +12,7 @@ */ /* - * $Header: /usr/build/vile/vile/RCS/estruct.h,v 1.591 2005/11/30 02:18:18 tom Exp $ + * $Header: /usr/build/vile/vile/RCS/estruct.h,v 1.592 2005/12/26 01:29:43 tom Exp $ */ #ifndef _estruct_h @@ -1018,11 +1018,15 @@ #define CLIP_KREG (NKREGS-1) #define SEL_KREG (NKREGS-2) #define KEYST_KREG (NKREGS-3) -#define NMARKS 26 #else #define NKREGS 37 /* number of kill buffers */ #define KEYST_KREG (NKREGS-1) +#endif + +#if SMALLER #define NMARKS 26 +#else +#define NMARKS 36 #endif /* special characters assigned to kill-registers */ Index: eval.c Prereq: 1.348 --- vile-9.5d+/eval.c 2005-05-27 22:21:58.000000000 +0000 +++ vile-9.5e/eval.c 2005-12-10 01:38:33.000000000 +0000 @@ -2,7 +2,7 @@ * eval.c -- function and variable evaluation * original by Daniel Lawrence * - * $Header: /usr/build/vile/vile/RCS/eval.c,v 1.348 2005/05/27 22:21:58 tom Exp $ + * $Header: /usr/build/vile/vile/RCS/eval.c,v 1.349 2005/12/10 01:38:33 tom Exp $ * */ @@ -335,9 +335,10 @@ if (temp_vars != 0) bputc('\n'); for (p = temp_vars, j = 0; p != 0; p = p->next) { - if (!j++) + if (!j++) { bprintf("--- Temporary variables "); - bpadc('-', term.cols - DOT.o); + bpadc('-', term.cols - DOT.o); + } bprintf("\n%%%s = %s", p->u_name, p->u_value); } } Index: filters/cfg-filt.l Prereq: 1.10 --- vile-9.5d+/filters/cfg-filt.l 2005-09-04 21:10:12.000000000 +0000 +++ vile-9.5e/filters/cfg-filt.l 2006-01-09 19:24:31.000000000 +0000 @@ -1,7 +1,7 @@ %{ /* - * $Header: /usr/build/vile/vile/filters/RCS/cfg-filt.l,v 1.10 2005/09/04 21:10:12 tom Exp $ + * $Header: /usr/build/vile/vile/filters/RCS/cfg-filt.l,v 1.11 2006/01/09 19:24:31 tom Exp $ * * Filter to add vile "attribution" sequences to an ordinary Lynx config-file */ @@ -46,7 +46,7 @@ ADDRESS ({NAME}|\.)+ EMAIL {NAME}@{ADDRESS} -URL [[:alpha:]]+"://"[[:alnum:]%/.~_#?=-]+ +URL [[:alpha:]]+"://"[[:alnum:]#%&+,./?;@_=~-]+ %% Index: filters/cpp.key Prereq: 1.5 --- vile-9.5d+/filters/cpp.key 2004-10-20 00:48:02.000000000 +0000 +++ vile-9.5e/filters/cpp.key 2005-12-23 19:37:33.000000000 +0000 @@ -1,4 +1,4 @@ -: $Id: cpp.key,v 1.5 2004/10/20 00:48:02 cmorgan Exp $ +: $Id: cpp.key,v 1.6 2005/12/23 19:37:33 tom Exp $ asm bool:Type catch @@ -28,4 +28,7 @@ typename using virtual +.table cpre +import +.default .include c Index: filters/css-filt.l Prereq: 1.10 --- vile-9.5d+/filters/css-filt.l 2005-09-03 11:52:59.000000000 +0000 +++ vile-9.5e/filters/css-filt.l 2006-01-09 19:24:31.000000000 +0000 @@ -2,7 +2,7 @@ %{ /* - * $Header: /usr/build/vile/vile/filters/RCS/css-filt.l,v 1.10 2005/09/03 11:52:59 tom Exp $ + * $Header: /usr/build/vile/vile/filters/RCS/css-filt.l,v 1.11 2006/01/09 19:24:31 tom Exp $ * * Filter to add vile "attribution" sequences to Cascading Style Sheets. */ @@ -49,7 +49,7 @@ REAL ([[:digit:]]*\.[[:digit:]]+) NUMBER ({DECIMAL}|{REAL}) -URL [[:alpha:]]+"://"[[:alnum:]%/.~_#?=-]+ +URL [[:alpha:]]+"://"[[:alnum:]#%&+,./?;@_=~-]+ %% Index: filters/filters.h Prereq: 1.94 --- vile-9.5d+/filters/filters.h 2005-06-09 21:39:40.000000000 +0000 +++ vile-9.5e/filters/filters.h 2006-01-09 20:23:38.000000000 +0000 @@ -1,5 +1,5 @@ /* - * $Header: /usr/build/vile/vile/filters/RCS/filters.h,v 1.94 2005/06/09 21:39:40 tom Exp $ + * $Header: /usr/build/vile/vile/filters/RCS/filters.h,v 1.96 2006/01/09 20:23:38 tom Exp $ */ #ifndef FILTERS_H @@ -233,12 +233,12 @@ extern int flt_lookup(char *name); extern int flt_start(char *name); extern void flt_echo(const char *string, int length); -extern void flt_error(const char *fmt, ...); +extern void flt_error(const char *fmt, ...) VILE_PRINTF(1,2); extern void flt_failed(const char *msg); extern void flt_finish(void); extern void flt_putc(int ch); extern void flt_puts(const char *string, int length, const char *attribute); -extern void mlforce(const char *fmt, ...); +extern void mlforce(const char *fmt, ...) VILE_PRINTF(1,2); #ifndef strmalloc extern char *strmalloc(const char *src); Index: filters/flt_defs.h Prereq: 1.1 --- vile-9.5d+/filters/flt_defs.h 2005-06-09 23:39:40.000000000 +0000 +++ vile-9.5e/filters/flt_defs.h 2006-01-09 23:26:33.000000000 +0000 @@ -1,5 +1,5 @@ /* - * $Header: /usr/build/vile/vile/filters/RCS/flt_defs.h,v 1.1 2005/06/09 23:39:40 tom Exp $ + * $Header: /usr/build/vile/vile/filters/RCS/flt_defs.h,v 1.2 2006/01/09 23:26:33 tom Exp $ */ #ifndef FLT_DEFS_H @@ -115,6 +115,10 @@ #define GCC_UNUSED /*nothing*/ #endif +#ifndef VILE_PRINTF +#define VILE_PRINTF(a,b) /*nothing*/ +#endif + #define BACKSLASH '\\' #define VILE_SUBKEY "Software\\VI Like Emacs" Index: filters/infofilt.l Prereq: 1.4 --- vile-9.5d+/filters/infofilt.l 2005-09-05 01:30:11.000000000 +0000 +++ vile-9.5e/filters/infofilt.l 2006-01-09 19:24:31.000000000 +0000 @@ -5,7 +5,7 @@ %{ /* - * $Header: /usr/build/vile/vile/filters/RCS/infofilt.l,v 1.4 2005/09/05 01:30:11 tom Exp $ + * $Header: /usr/build/vile/vile/filters/RCS/infofilt.l,v 1.5 2006/01/09 19:24:31 tom Exp $ * * Filter to add vile "attribution" sequences to an info file. * (An extension of "text" mode). @@ -41,7 +41,7 @@ ADDRESS ({NAME}|\.)+ EMAIL {NAME}@{ADDRESS} -URL [[:alpha:]]+"://"[[:alnum:]%/.~_#?=-]+ +URL [[:alpha:]]+"://"[[:alnum:]#%&+,./?;@_=~-]+ %% Index: filters/lex-filt.l Prereq: 1.43 --- vile-9.5d+/filters/lex-filt.l 2005-11-29 22:51:01.000000000 +0000 +++ vile-9.5e/filters/lex-filt.l 2006-01-09 23:41:53.000000000 +0000 @@ -1,4 +1,4 @@ -%s RULES RULE1 RULEX RULER STATES ACTIONS ACTION1 ACTION2 ACTION3 CODE COMMENT +%s RULES RULE1 RULEX RULER STATES ACTIONS ACTION0 ACTION1 ACTION2 ACTION3 CODE CODE1 COMMENT %a 20000 %n 10000 @@ -7,7 +7,7 @@ %{ /* - * $Header: /usr/build/vile/vile/filters/RCS/lex-filt.l,v 1.43 2005/11/29 22:51:01 tom Exp $ + * $Header: /usr/build/vile/vile/filters/RCS/lex-filt.l,v 1.58 2006/01/09 23:41:53 tom Exp $ * * Filter to add vile "attribution" sequences to selected bits of LEX program. */ @@ -21,6 +21,7 @@ #define NAME_LEX_SECTION "LexSection" #define NAME_LEX_STATES "LexStates" +static char *Action_attr; static char *Comment_attr; static char *Error_attr; static char *Ident_attr; @@ -35,7 +36,9 @@ static int section = 0; static int nesting = 0; +static int bracket = 0; +static void end_action(void); static void set_rules(void); static void set_state(void); static void write_patterns(char *text, int len); @@ -76,7 +79,7 @@ PATTERN (({PATTERN0}|"("{PATTERN1}")")+|"<<EOF>>") PATTERNS (({PATTERN0}|{PATTERN1}|"("{PATTERN1}")")+|"<<EOF>>") -STATES ("<"({IDENT}|\,)+">") +STATES ("<"("*"|({IDENT}|\,)+)">") %% @@ -104,46 +107,85 @@ } } -<STATES>{IDENT} { insert_keyword(yytext, States_attr, 0); - WriteToken(keyword_attr(yytext)); } +<STATES>{IDENT} { + char *attr = class_attr(yytext); + if (attr == 0) { + insert_keyword(yytext, States_attr, 0); + attr = keyword_attr(yytext); + } else { + attr = Error_attr; + flt_error("Keyword \"%s\" is already a classname", yytext); + } + WriteToken(attr); + } <STATES>{SPACE} { ECHO; } -<STATES>[^\n[:blank:]] { WriteToken(Error_attr); } +<STATES>[^\n[:blank:]] { WriteToken(Error_attr); + flt_error("Expected newline or blanks"); + } <STATES>[\n] { ECHO; set_state(); } <RULES>^{IDENT} { if (set_symbol_table(NAME_LEX_PATTERN)) { - insert_keyword(yytext, Pattern_attr, 0); - WriteToken(keyword_attr(yytext)); + char *attr = class_attr(yytext); + if (attr == 0) { + insert_keyword(yytext, Pattern_attr, 0); + attr = keyword_attr(yytext); + } else { + attr = Error_attr; + flt_error("Keyword \"%s\" is already a classname", yytext); + } + WriteToken(attr); set_symbol_table(filter_def.filter_name); } else { WriteToken(Ident_attr); } new_state(RULE1); } +<RULES>"//"[^\n]* { WriteToken(Comment_attr); } +<RULES>"/*" { PushQuote(COMMENT, Comment_attr); } + <RULE1>{SPACE}+ { ECHO; new_state(RULEX); } <RULEX>{PATTERNS} { write_patterns(yytext, yyleng); new_state(RULER); } -<RULER>[^\n]* { WriteToken(Error_attr); } +<RULER>[^\n]* { WriteToken(Error_attr); + flt_error("Expected newline"); + } <RULER>[\n] { ECHO; new_state(RULES); } -<ACTIONS>^{STATES}? { write_states(yytext, yyleng); new_state(ACTION1); } +<ACTIONS>^{SPACE}+ { ECHO; new_state(CODE1); } +<ACTIONS>{SPACE}+ { ECHO; } +<ACTIONS>^{STATES} { write_states(yytext, yyleng); new_state(ACTION1); } <ACTIONS>^{PATTERN} { write_patterns(yytext, yyleng); new_state(ACTION2); } -<ACTION1>{PATTERN}? { write_patterns(yytext, yyleng); new_state(ACTION2); } -<ACTION1>[\n] { ECHO; new_state(ACTIONS); } + +<ACTION0>"//"[^\n]* { WriteToken(Comment_attr); } +<ACTION0>^{SPACE}+ { ECHO; } +<ACTION0>{STATES} { write_states(yytext, yyleng); new_state(ACTION1); } +<ACTION0>"/*" { PushQuote(COMMENT, Comment_attr); } +<ACTION0>{PATTERN} { write_patterns(yytext, yyleng); new_state(ACTION2); } + +<ACTION1>"{" { WriteToken(Action_attr); ++bracket; new_state(ACTION0); } +<ACTIONS,ACTION0>"}" { if (bracket) { --bracket; WriteToken(Action_attr); end_action(); } else ECHO; } +<ACTION1>{PATTERN} { write_patterns(yytext, yyleng); new_state(ACTION2); } <ACTION1>{SPACE}+ { ECHO; new_state(ACTION3); } -<ACTION2>[\n] { ECHO; new_state(ACTIONS); } +<ACTION1>[\n] { ECHO; end_action(); } + <ACTION2>{SPACE}+ { ECHO; new_state(ACTION3); } +<ACTION2>[\n] { ECHO; end_action(); } + +<ACTION3>{IDENT} { WriteToken(keyword_attr(yytext)); new_state(CODE1); } +<ACTION3>"//"[^\n]* { WriteToken(Comment_attr); } +<ACTION3>"/*" { PushQuote(COMMENT, Comment_attr); } <ACTION3>\{ { ECHO; nesting = 1; new_state(CODE); } -<ACTION3>[^\{/\n].*$ { ECHO; } -<ACTION3>[\n] { ECHO; new_state(ACTIONS); } +<ACTION3>[\n] { ECHO; end_action(); } -<CODE>{IDENT} { WriteToken(keyword_attr(yytext)); } -<CODE>{STRINGS} { WriteToken(String_attr); } -<CODE>{INTEGER} { WriteToken(Number_attr); } -<CODE>\{ { ECHO; nesting++; } -<CODE>\} { ECHO; if (--nesting <= 0) { nesting = 0; set_rules(); } } +<CODE,CODE1>{IDENT} { WriteToken(keyword_attr(yytext)); } +<CODE,CODE1>{STRINGS} { WriteToken(String_attr); } +<CODE,CODE1>{INTEGER} { WriteToken(Number_attr); } +<CODE1>[\n] { ECHO; set_rules(); } +<CODE,CODE1>\{ { ECHO; nesting++; } +<CODE,CODE1>\} { ECHO; if (--nesting <= 0) { nesting = 0; set_rules(); } } -<ACTION3,CODE,RULES>"//"[^\n]* { WriteToken(Comment_attr); } -<ACTION3,CODE,RULES>"/*" { PushQuote(COMMENT, Comment_attr); } +<CODE,CODE1>"//"[^\n]* { WriteToken(Comment_attr); } +<CODE,CODE1>"/*" { PushQuote(COMMENT, Comment_attr); } <COMMENT>[^*]* { flt_bfr_append(yytext, yyleng); } <COMMENT>"*"+[^*/]* { flt_bfr_append(yytext, yyleng); } <COMMENT>"*"+"/" { PopQuote(); } @@ -153,12 +195,21 @@ %% static void +end_action(void) +{ + if (bracket) + new_state(ACTION0); + else + new_state(ACTIONS); +} + +static void set_state(void) { if (section >= 2) { new_state(CODE); } else if (section >= 1) { - new_state(ACTIONS); + end_action(); } else { new_state(RULES); } @@ -175,8 +226,14 @@ write_1state(char *text, int len) { char *attr = keyword_attr(text); - if (attr == 0) - attr = Error_attr; + if (attr == 0) { + if (len == 1 && *text == '*') { + attr = Keyword_attr; + } else { + attr = Error_attr; + flt_error("Unknown state name \"%s\"", text); + } + } flt_bfr_embed(text, len, attr); } @@ -305,7 +362,6 @@ } else if (ch == L_BLOCK) { ranges = 1; } else if (ch == L_CURLY) { - flt_bfr_append(text + first, last - first); if ((next = parse_ident(text, last + 1, len)) > 0) { int save = text[next - 1]; text[next - 1] = 0; @@ -315,17 +371,18 @@ * is a forward reference. But show an error anyway since * it is more likely to be useful. */ - if ((attr = keyword_attr(text + last + 1)) == 0) + flt_bfr_append(text + first, last - first); + if ((attr = keyword_attr(text + last + 1)) == 0) { attr = Error_attr; + flt_error("Undefined name \"%s\"", text + last + 1); + } text[next - 1] = save; flt_bfr_embed(text + last, next - last, attr); first = next; } else if ((next = parse_limits(text, last + 1, len)) >= 0) { + flt_bfr_append(text + first, last - first); flt_bfr_embed(text + last, next - last, Number_attr); first = next; - } else { - flt_bfr_embed(text + last, len - last, Error_attr); - break; } } } @@ -349,6 +406,7 @@ section = 0; nesting = 0; + Action_attr = class_attr(NAME_ACTION); Comment_attr = class_attr(NAME_COMMENT); Error_attr = class_attr(NAME_ERROR); Ident_attr = class_attr(NAME_IDENT); Index: filters/mailfilt.l Prereq: 1.17 --- vile-9.5d+/filters/mailfilt.l 2005-09-30 22:32:32.000000000 +0000 +++ vile-9.5e/filters/mailfilt.l 2006-01-09 19:24:31.000000000 +0000 @@ -5,7 +5,7 @@ %{ /* - * $Header: /usr/build/vile/vile/filters/RCS/mailfilt.l,v 1.17 2005/09/30 22:32:32 tom Exp $ + * $Header: /usr/build/vile/vile/filters/RCS/mailfilt.l,v 1.18 2006/01/09 19:24:31 tom Exp $ * * Filter to add vile "attribution" sequences to selected bits of mail */ @@ -33,7 +33,7 @@ BEGIN_HEADER ^"From "{EMAIL} -URL [[:alpha:]]+"://"[[:alnum:]%/.~_#?=-]+ +URL [[:alpha:]]+"://"[[:alnum:]#%&+,./?;@_=~-]+ %% Index: filters/makefile.wnt Prereq: 1.31 --- vile-9.5d+/filters/makefile.wnt 2005-03-10 23:45:11.000000000 +0000 +++ vile-9.5e/filters/makefile.wnt 2005-12-10 01:30:22.000000000 +0000 @@ -1,7 +1,7 @@ # # makefile for vile filters on WIN32 using Microsoft Visual C++ # -# $Header: /usr/build/vile/vile/filters/RCS/makefile.wnt,v 1.31 2005/03/10 23:45:11 tom Exp $ +# $Header: /usr/build/vile/vile/filters/RCS/makefile.wnt,v 1.32 2005/12/10 01:30:22 tom Exp $ # # !include <ntwin32.mak> @@ -179,6 +179,7 @@ - del lex.*.c - del *.bak - del *.tmp + - del *.pdb - del *$x - del *$o - del *.lib Index: filters/nr-filt.l Prereq: 1.17 --- vile-9.5d+/filters/nr-filt.l 2005-09-04 21:15:43.000000000 +0000 +++ vile-9.5e/filters/nr-filt.l 2006-01-09 19:04:36.000000000 +0000 @@ -1,7 +1,7 @@ %{ /* - * $Header: /usr/build/vile/vile/filters/RCS/nr-filt.l,v 1.17 2005/09/04 21:15:43 tom Exp $ + * $Header: /usr/build/vile/vile/filters/RCS/nr-filt.l,v 1.18 2006/01/09 19:04:36 tom Exp $ * * Filter to add vile "attribution" sequences to selected bits of NROFF */ @@ -41,8 +41,8 @@ %} -COMMAND ^(\.[[:alnum:]]+([ \t][^\n]+)?|'\\\"[^\n]+) -COMMENT ^\.\\\" +COMMAND ^(\.[[:blank:]]*[[:alnum:]]+([ \t][^\n]+)?|'\\\"[^\n]+) +COMMENT ^\.[[:blank:]]*\\\" ENIT \\[e *\n\\+-] Index: filters/pot-filt.l Prereq: 1.4 --- vile-9.5d+/filters/pot-filt.l 2005-09-04 21:15:43.000000000 +0000 +++ vile-9.5e/filters/pot-filt.l 2006-01-09 20:24:38.000000000 +0000 @@ -2,7 +2,7 @@ %{ /* - * $Header: /usr/build/vile/vile/filters/RCS/pot-filt.l,v 1.4 2005/09/04 21:15:43 tom Exp $ + * $Header: /usr/build/vile/vile/filters/RCS/pot-filt.l,v 1.5 2006/01/09 20:24:38 tom Exp $ * * Filter to add vile "attribution" sequences to selected bits of gettext files. */ @@ -46,7 +46,7 @@ <QUOTED>{FORMAT} { flt_bfr_embed(yytext, yyleng, Number_attr); } <QUOTED>[^%\n"\\]+ { flt_bfr_append(yytext, yyleng); } <QUOTED>"%%" { flt_bfr_append(yytext, yyleng); } -<QUOTED>"%" { flt_error("unexpected '%'"); +<QUOTED>"%" { flt_error("unexpected '%%'"); flt_bfr_embed(yytext, yyleng, Error_attr); } <QUOTED>[\n] { flt_bfr_append(yytext, yyleng); } <QUOTED>"\"" { FinishQuote(NORMAL); } Index: filters/sql-filt.l Prereq: 1.27 --- vile-9.5d+/filters/sql-filt.l 2005-09-05 11:18:50.000000000 +0000 +++ vile-9.5e/filters/sql-filt.l 2005-12-23 21:02:45.000000000 +0000 @@ -3,7 +3,7 @@ %{ /* - * $Header: /usr/build/vile/vile/filters/RCS/sql-filt.l,v 1.27 2005/09/05 11:18:50 tom Exp $ + * $Header: /usr/build/vile/vile/filters/RCS/sql-filt.l,v 1.28 2005/12/23 21:02:45 tom Exp $ * * Filter to add vile "attribution" sequences to selected bits of SQL script * - T.Dickey @@ -29,8 +29,8 @@ static char *String_attr; static int next_line; /* state after one-line SQL*Plus */ -static int began_state = LEAD; -static int saved_state = LEAD; +static int began_state; +static int saved_state; /******************************************************************************/ @@ -208,6 +208,8 @@ Number_attr = class_attr(NAME_NUMBER); String_attr = class_attr(NAME_LITERAL); + began_state = LEAD; + saved_state = LEAD; set_state(LEAD); while (yylex() > 0) { } Index: filters/txt-filt.l Prereq: 1.19 --- vile-9.5d+/filters/txt-filt.l 2005-09-05 01:42:35.000000000 +0000 +++ vile-9.5e/filters/txt-filt.l 2006-01-09 19:25:18.000000000 +0000 @@ -5,7 +5,7 @@ %{ /* - * $Header: /usr/build/vile/vile/filters/RCS/txt-filt.l,v 1.19 2005/09/05 01:42:35 tom Exp $ + * $Header: /usr/build/vile/vile/filters/RCS/txt-filt.l,v 1.20 2006/01/09 19:25:18 tom Exp $ * * Filter to add vile "attribution" sequences to an ordinary text file */ @@ -39,7 +39,7 @@ ADDRESS ({NAME}|\.)+ EMAIL {NAME}@{ADDRESS} -URL [[:alpha:]]+"://"[[:alnum:]%/.~_#?=-]+ +URL [[:alpha:]]+"://"[[:alnum:]#%&+,./?;@_=~-]+~ %% Index: macros/modes.rc Prereq: 1.31 --- vile-9.5d+/macros/modes.rc 2005-11-15 23:05:18.000000000 +0000 +++ vile-9.5e/macros/modes.rc 2006-01-04 23:03:34.000000000 +0000 @@ -1,4 +1,4 @@ -; $Id: modes.rc,v 1.31 2005/11/15 23:05:18 tom Exp $ +; $Id: modes.rc,v 1.33 2006/01/04 23:03:34 cmorgan Exp $ ; majormodes in this file are ordered alphabetically for convenience - the ; precedence used by vile is strictly alphabetic, counting case. Use the ; before and after qualifiers to override the precedence. @@ -275,7 +275,7 @@ define-mode html ~with define-submode html suffixes '\.\(html\|htm\)$' - pre '\(<html>\|<script>\|<!doctype\|<!--\)' + pre '^\s*\(<html>\|<script>\|<!doctype\|<!--\)' fence-pairs '<>()[]{}' ignorecase comment-prefix '^\s*--' @@ -554,7 +554,7 @@ ~with define-submode rc after "vile" suffixes '\.rc\d*$' - preamble '^\s*[^;"]' + preamble '^\s*[^;"]' qualifiers=all comment-prefix '^\s*//' comments '^\s*//\s*$' @@ -731,6 +731,7 @@ dos ignorecase notabinsert + sections '^\(Public\|Private\)\s\+\(Sub\|Function\)' ~endwith define-mode vbs Index: makefile.in Prereq: 1.198 --- vile-9.5d+/makefile.in 2005-11-30 01:17:59.000000000 +0000 +++ vile-9.5e/makefile.in 2006-01-09 20:48:25.000000000 +0000 @@ -20,7 +20,7 @@ # # gnu autoconf support by kevin buettner, 5/94 # -# $Header: /usr/build/vile/vile/RCS/makefile.in,v 1.198 2005/11/30 01:17:59 tom Exp $ +# $Header: /usr/build/vile/vile/RCS/makefile.in,v 1.199 2006/01/09 20:48:25 tom Exp $ SHELL = /bin/sh @@ -288,7 +288,7 @@ sources : $(BUILTHDRS) -filters/@LIB_PREFIX@vlflt.a : +filters/@LIB_PREFIX@vlflt.a : $(BUILTHDRS) cd filters && $(MAKE) $(MAKE_RECUR) @LIB_PREFIX@vlflt.a $(TARGET): $(BUILTHDRS) $(OBJ) $(BUILTLIBS) @@ -595,7 +595,7 @@ -typemap ptypemap \ $(srcdir)/perl.xs > $@ -$(OBJ): estruct.h nemode.h edef.h neproto.h proto.h config.h +$(OBJ): estruct.h $(BUILTHDRS) api$o : api.h bind$o : nefunc.h btree.h Index: makefile.wnt Prereq: 1.86 --- vile-9.5d+/makefile.wnt 2005-11-24 18:50:25.000000000 +0000 +++ vile-9.5e/makefile.wnt 2006-01-10 00:20:15.000000000 +0000 @@ -1,7 +1,7 @@ # # makefile for vile on WIN32 using Microsoft Visual C++ # -# $Header: /usr/build/vile/vile/RCS/makefile.wnt,v 1.86 2005/11/24 18:50:25 tom Exp $ +# $Header: /usr/build/vile/vile/RCS/makefile.wnt,v 1.89 2006/01/10 00:20:15 tom Exp $ # # !include <ntwin32.mak> @@ -247,8 +247,14 @@ $(RC) -DVILE_ICON="$(ICON).ico" -Iicons winvile.rc # collect some perl environment info +!if "$(PERLCFG)" != "$(DEVNULL)" +!if !exist("$(PERLCFG)") $(PERLCFG): $(PERL_SCRIPTS) mkprlenv.wnt + echo making PERLCFG $(PERLCFG) !INCLUDE "mkprlenv.wnt" + echo ...made PERLCFG $(PERLCFG) +!endif +!endif $(OBJ): estruct.h edef.h proto.h $(MYHDRS) builtflt.obj : builtflt.h @@ -301,10 +307,25 @@ winviletlb.h winvile.tlb: winvile.odl midl -h winviletlb.h -tlb winvile.tlb winvile.odl +test_btree.exe : btree.c + $(CC) -Fo$* -DDEBUG_BTREE $(CPPFLAGS) $(CFLAGS) btree.c $(LDFLAGS) + +test_regexp.exe : regexp.c + $(CC) -Fo$* -DDEBUG_REGEXP $(CPPFLAGS) $(CFLAGS) regexp.c $(LDFLAGS) + +TEST_IO_OBJS = \ + $(SCREEN).obj \ + test_io.obj + +test_io.exe : $(TEST_IO_OBJS) + $(link) $(TEST_IO_OBJS) $(LDFLAGS) $(LIBS) -out:$(@) + clean :: -del *.bak -del *.exe + -del *.ilk -del *.map + -del *.pdb -del *.obj -del ne*.h -del $(THE_PERLCFG) Index: mkprlenv.wnt Prereq: 1.8 --- vile-9.5d+/mkprlenv.wnt 2001-01-03 01:27:14.000000000 +0000 +++ vile-9.5e/mkprlenv.wnt 2005-12-07 11:55:18.000000000 +0000 @@ -27,7 +27,7 @@ # Consult the macro $(PERL_SCRIPTS) in the file makefile.wnt to ascertain the # current list of vile-based perl scripts known to work in a Win32 environment. # -# $Header: /usr/build/vile/vile/RCS/mkprlenv.wnt,v 1.8 2001/01/03 01:27:14 tom Exp $ +# $Header: /usr/build/vile/vile/RCS/mkprlenv.wnt,v 1.9 2005/12/07 11:55:18 tom Exp $ # perl -w << require Config; @@ -175,7 +175,7 @@ # # Delete things that are affected by the perl configuration before # going any further. - -del $(TARGET) + -del $(EXEFILE) -del perl.c # Look ma, a recursive make $(MAKE) -f makefile.wnt CFG=$(CFG) OPT=$(OPT) ICON=$(ICON) Index: ntwinio.c Prereq: 1.150 --- vile-9.5d+/ntwinio.c 2005-11-23 12:19:35.000000000 +0000 +++ vile-9.5e/ntwinio.c 2006-01-09 23:51:18.000000000 +0000 @@ -1,7 +1,7 @@ /* * Uses the Win32 screen API. * - * $Header: /usr/build/vile/vile/RCS/ntwinio.c,v 1.150 2005/11/23 12:19:35 tom Exp $ + * $Header: /usr/build/vile/vile/RCS/ntwinio.c,v 1.153 2006/01/09 23:51:18 tom Exp $ * Written by T.E.Dickey for vile (october 1997). * -- improvements by Clark Morgan (see w32cbrd.c, w32pipe.c). */ @@ -1455,15 +1455,8 @@ static void flash_display(void) { - RECT rect; - HDC hDC; - - GetClientRect(cur_win->text_hwnd, &rect); - hDC = GetDC(cur_win->text_hwnd); - InvertRect(hDC, &rect); - Sleep(100); - InvertRect(hDC, &rect); - ReleaseDC(cur_win->text_hwnd, hDC); + PostMessage(cur_win->text_hwnd, WM_WVILE_FLASH_START, 0, 0); + PostMessage(cur_win->text_hwnd, WM_WVILE_FLASH_STOP, 0, 0); } #endif @@ -2007,7 +2000,7 @@ /* talk about copyright */ hwnd = GetDlgItem(hDlg, IDM_ABOUT_COPYRIGHT); sprintf(buf, - "\nCopyright \xA9 Thomas Dickey 1997-2005\n\n" + "\nCopyright \xA9 Thomas Dickey 1997-2005,2006\n\n" "%s is free software, distributed under the terms of the GNU " "Public License (see COPYING).", prognam); @@ -2116,10 +2109,12 @@ break; default: if (cmd >= IDM_RECENT_FILES && cmd < IDM_RECENT_FLDRS) { - update(!edit_recent_file(cmd)); + (void) edit_recent_file(cmd); + update(TRUE); /* force cursor out of mini-buffer */ } else if (cmd >= IDM_RECENT_FLDRS && cmd < (IDM_RECENT_FLDRS + MAX_RECENT_FLDRS)) { - update(!cd_recent_folder(cmd)); + (void) cd_recent_folder(cmd); + update(TRUE); /* force cursor out of mini-buffer */ } else result = FALSE; break; @@ -3327,6 +3322,9 @@ WPARAM wParam, LONG lParam) { + RECT rect; + HDC hDC; + TRACE(("TEXT:%s, %s\n", message2s(message), which_window(hWnd))); switch (message) { @@ -3341,6 +3339,19 @@ return (DefWindowProc(hWnd, message, wParam, lParam)); } break; + case WM_WVILE_FLASH_START: + GetClientRect(cur_win->text_hwnd, &rect); + hDC = GetDC(cur_win->text_hwnd); + InvertRect(hDC, &rect); + ReleaseDC(cur_win->text_hwnd, hDC); + break; + case WM_WVILE_FLASH_STOP: + Sleep(200); + GetClientRect(cur_win->text_hwnd, &rect); + hDC = GetDC(cur_win->text_hwnd); + InvertRect(hDC, &rect); + ReleaseDC(cur_win->text_hwnd, hDC); + break; default: return (DefWindowProc(hWnd, message, wParam, lParam)); Index: patchlev.h --- vile-9.5d+/patchlev.h 2005-11-24 22:51:11.000000000 +0000 +++ vile-9.5e/patchlev.h 2005-12-20 20:42:05.000000000 +0000 @@ -1,3 +1,3 @@ #define VILE_VERSION "9.5" /* set to "" for no patches */ -#define VILE_PATCHLEVEL "d" +#define VILE_PATCHLEVEL "e" Index: regexp.c Prereq: 1.116 --- vile-9.5d+/regexp.c 2005-11-20 20:10:04.000000000 +0000 +++ vile-9.5e/regexp.c 2006-01-10 01:19:19.000000000 +0000 @@ -1,5 +1,5 @@ /* - * $Header: /usr/build/vile/vile/RCS/regexp.c,v 1.116 2005/11/20 20:10:04 tom Exp $ + * $Header: /usr/build/vile/vile/RCS/regexp.c,v 1.117 2006/01/10 01:19:19 tom Exp $ * * Copyright 2005, Thomas E. Dickey and Paul G. Fox * @@ -2717,7 +2717,7 @@ have *= 2; result = typereallocn(char, result, have); } - result[*length] = value; + result[*length] = (char) value; *length += 1; if (literal < 0) literal = (value == '#' || isupper(value)) ? 1 : 0; Index: revlist --- vile-9.5d+/revlist 2005-11-30 02:19:32.000000000 +0000 +++ vile-9.5e/revlist 2006-01-10 01:27:47.000000000 +0000 @@ -1,6 +1,6 @@ -revlist for vile, version v9_5d +revlist for vile, version v9_5e -------------------------------------------------------------------------------- -CHANGES 1.883 +CHANGES 1.893 CHANGES.R3 1.1 CHANGES.R4 1.1 CHANGES.R5 1.1 @@ -17,12 +17,12 @@ ansi.c 1.46 api.c 1.37 api.h 1.13 -basic.c 1.123 -bind.c 1.290 +basic.c 1.124 +bind.c 1.291 borland.c 1.34 -btree.c 1.21 +btree.c 1.22 btree.h 1.4 -buffer.c 1.296 +buffer.c 1.298 buglist 1.403 builtflt.c 1.47 chgdfunc.h 1.18 @@ -36,12 +36,12 @@ curses.c 1.25 descrip.mms 1.46 dirstuff.h 1.30 -display.c 1.410 +display.c 1.413 djhandl.c 1.6 dumbterm.c 1.19 edef.h 1.322 -estruct.h 1.591 -eval.c 1.348 +estruct.h 1.592 +eval.c 1.349 exec.c 1.281 externs.c 1.10 fences.c 1.83 @@ -65,25 +65,25 @@ makefile.djg 1.34 makefile.emx 1.5 makefile.icc 1.15 -makefile.in 1.198 -makefile.wnt 1.86 +makefile.in 1.199 +makefile.wnt 1.89 map.c 1.108 menu.c 1.48 mkdirs.sh 1.6 -mkprlenv.wnt 1.8 +mkprlenv.wnt 1.9 mktbls.c 1.132 modes.c 1.311 modetbl 1.237 msgs.c 1.26 npopen.c 1.94 ntconio.c 1.84 -ntwinio.c 1.150 +ntwinio.c 1.153 oneliner.c 1.108 opers.c 1.90 os2keys.h 1.2 os2pipe.c 1.5 os2vio.c 1.33 -patchlev.h 1.340 +patchlev.h 1.341 path.c 1.150 perl.xs 1.104 plugin.c 1.1 @@ -92,19 +92,20 @@ pscreen.h 1.2 ptypemap 1.7 random.c 1.287 -regexp.c 1.116 +regexp.c 1.117 region.c 1.132 -revlist v9_5d +revlist v9_5e search.c 1.137 select.c 1.158 sinstall.sh 1.1 spawn.c 1.188 -statevar.c 1.94 +statevar.c 1.95 tags.c 1.128 tbuff.c 1.63 tcap.c 1.168 tcap.h 1.10 termio.c 1.203 +test_io.c 1.1 trace.c 1.53 trace.h 1.24 ucrypt.c 1.15 @@ -112,7 +113,7 @@ version.c 1.58 vile-9.5.spec 1.5 vile.1 1.30 -vile.hlp 1.603 +vile.hlp 1.606 vile.wmconfig 1.1 vl_alloc.h 1.1 vl_ctype.h 1.4 @@ -123,23 +124,23 @@ vmsvt.c 1.58 w32cbrd.c 1.25 w32cmd.c 1.35 -w32misc.c 1.45 -w32ole.cpp 1.22 +w32misc.c 1.46 +w32ole.cpp 1.23 w32ole.h 1.6 w32ole.rc 1.2 w32oo.cpp 1.7 w32pipe.c 1.32 -w32reg.c 1.8 +w32reg.c 1.9 w32reg.h 1.1 w32vile.h 1.2 watch.c 1.5 window.c 1.106 -winvile.h 1.10 +winvile.h 1.11 winvile.odl 1.6 winvile.rc 1.11 word.c 1.79 wordmov.c 1.22 -wvwrap.cpp 1.9 +wvwrap.cpp 1.10 x11.c 1.281 x11menu.c 1.8 xshell.sh 1.4 @@ -180,10 +181,10 @@ filters/c-filt.c 1.73 filters/c-filt.flx 1.1 filters/c.key 1.11 -filters/cfg-filt.l 1.10 -filters/cpp.key 1.5 +filters/cfg-filt.l 1.11 +filters/cpp.key 1.6 filters/csh.key 1.1 -filters/css-filt.l 1.10 +filters/css-filt.l 1.11 filters/css.key 1.5 filters/cweb.key 1.2 filters/cwebfilt.l 1.16 @@ -204,9 +205,9 @@ filters/fdl.key 1.4 filters/filterio.c 1.28 filters/filters.c 1.99 -filters/filters.h 1.94 +filters/filters.h 1.96 filters/filters.rc 1.203 -filters/flt_defs.h 1.1 +filters/flt_defs.h 1.2 filters/fltstack.h 1.9 filters/genmake.c 1.4 filters/genmake.mak 1.29 @@ -214,7 +215,7 @@ filters/htmlfilt.l 1.35 filters/imake.key 1.4 filters/imakeflt.l 1.14 -filters/infofilt.l 1.4 +filters/infofilt.l 1.5 filters/ini-filt.l 1.4 filters/ini.key 1.1 filters/iss-filt.l 1.4 @@ -224,21 +225,21 @@ filters/key-filt.c 1.19 filters/latex.key 1.2 filters/latexflt.l 1.41 -filters/lex-filt.l 1.43 +filters/lex-filt.l 1.58 filters/lex.key 1.8 filters/lisp.key 1.2 filters/lispfilt.l 1.11 filters/m4-filt.c 1.25 filters/m4.key 1.3 filters/mail.key 1.3 -filters/mailfilt.l 1.17 +filters/mailfilt.l 1.18 filters/make.key 1.8 filters/makefile.2nd 1.11 filters/makefile.djg 1.3 filters/makefile.emx 1.4 filters/makefile.icc 1.3 filters/makefile.in 1.80 -filters/makefile.wnt 1.31 +filters/makefile.wnt 1.32 filters/makefilt.l 1.52 filters/makelist.sh 1.5 filters/manfilt.c 1.36 @@ -253,7 +254,7 @@ filters/mk-key.awk 1.2 filters/mms-filt.l 1.12 filters/noclass.sh 1.6 -filters/nr-filt.l 1.17 +filters/nr-filt.l 1.18 filters/nr.key 1.1 filters/nsis.key 1.4 filters/pas-filt.l 1.3 @@ -264,7 +265,7 @@ filters/php-filt.l 1.4 filters/php.key 1.3 filters/pl-filt.c 1.82 -filters/pot-filt.l 1.4 +filters/pot-filt.l 1.5 filters/pot.key 1.1 filters/ps-filt.l 1.7 filters/ps.key 1.2 @@ -290,7 +291,7 @@ filters/sml.key 1.1 filters/spell.rc 1.6 filters/spellflt.l 1.23 -filters/sql-filt.l 1.27 +filters/sql-filt.l 1.28 filters/sql.key 1.9 filters/syntax.key 1.1 filters/tags.key 1.1 @@ -306,7 +307,7 @@ filters/texifilt.l 1.4 filters/ti-filt.l 1.16 filters/ti.key 1.2 -filters/txt-filt.l 1.19 +filters/txt-filt.l 1.20 filters/unfilter.c 1.8 filters/unfilter.h 1.1 filters/vb.key 1.6 @@ -341,7 +342,7 @@ macros/gnugpg.rc 1.3 macros/loaderrs.rc 1.1 macros/manpage.rc 1.21 -macros/modes.rc 1.31 +macros/modes.rc 1.33 macros/palettes.rc 1.7 macros/pictmode.rc 1.4 macros/search.rc 1.3 Index: statevar.c Prereq: 1.94 --- vile-9.5d+/statevar.c 2005-03-13 18:20:19.000000000 +0000 +++ vile-9.5e/statevar.c 2005-12-25 22:36:49.000000000 +0000 @@ -3,7 +3,7 @@ * for getting and setting the values of the vile state variables, * plus helper utility functions. * - * $Header: /usr/build/vile/vile/RCS/statevar.c,v 1.94 2005/03/13 18:20:19 tom Exp $ + * $Header: /usr/build/vile/vile/RCS/statevar.c,v 1.95 2005/12/25 22:36:49 tom Exp $ */ #include "estruct.h" @@ -1431,7 +1431,9 @@ int var_TITLEFORMAT(TBUFF **rp, const char *vp) { - return any_rw_STR(rp, vp, &title_format); + int code = any_rw_STR(rp, vp, &title_format); + set_editor_title(); + return code; } #endif /* OPT_TITLE */ Index: test_io.c --- /dev/null 2005-11-19 17:15:46.000000000 +0000 +++ vile-9.5e/test_io.c 2006-01-10 01:18:48.000000000 +0000 @@ -0,0 +1,18 @@ +/* + * Stub for testing linkage requirements of I/O drivers. + * + * $Header: /usr/build/vile/vile/RCS/test_io.c,v 1.1 2006/01/10 01:18:48 tom Exp $ + */ + +#include <estruct.h> + +extern TERM term; /* Terminal information. */ + +int +main(int argc, char **argv) +{ + + TERM *test = &term; + + return (test != 0) ? EXIT_SUCCESS : EXIT_FAILURE; +} Index: vile.hlp Prereq: 1.603 --- vile-9.5d+/vile.hlp 2005-11-24 01:35:59.000000000 +0000 +++ vile-9.5e/vile.hlp 2006-01-09 23:49:18.000000000 +0000 @@ -455,6 +455,11 @@ below), so it can work on regions: for example use '^A-&}' to "repeat the previous substitution over the rest of this paragraph". + The named marks such as "'a" work as they do in vi. vile allows + a decimal digit as a mark. It also recognizes special marks for + the beginning and end of a selection: '< for the beginning and + '> for the end (see the discussion of the quoted motion command). + Infinite Undo -------------- The regular undo ('u') and line-undo ('U') are available for all @@ -3592,7 +3597,8 @@ %C character value at current edit-position. %f file name when not internal buffer and when not the same as the buffer name. - %F internal buffer name + %F file name when it is internal buffer name and not the + same as the buffer name. %i insert/overwrite/replace mode indicator, displayed only when in insert, overwrite, or replace mode. When not in one of these modes, the separator @@ -3601,6 +3607,10 @@ %L number of lines in buffer, if ruler is set %m major mode(s), e.g., cmode, view-only, etc. Displayed in square brackets. + %n relative file name when not internal buffer name, + otherwise the buffer name. + %N absolute file name when not internal buffer name, + otherwise the buffer name. %p line number as percentage of number of lines if "ruler" is set %P line number as percentage of number of lines @@ -6206,6 +6216,6 @@ Requests to be put on the announcement list should go to announce-request@vile.cx -Copyright 1995-2005 by Paul Fox, Thomas Dickey, and Kevin Buettner +Copyright 1995-2005,2006 by Paul Fox, Thomas Dickey, and Kevin Buettner -------------------------------------------------------------------- - $Header: /usr/build/vile/vile/RCS/vile.hlp,v 1.603 2005/11/24 01:35:59 tom Exp $ + $Header: /usr/build/vile/vile/RCS/vile.hlp,v 1.606 2006/01/09 23:49:18 tom Exp $ Index: w32misc.c Prereq: 1.45 --- vile-9.5d+/w32misc.c 2005-02-01 00:12:40.000000000 +0000 +++ vile-9.5e/w32misc.c 2005-12-21 00:59:05.000000000 +0000 @@ -2,7 +2,7 @@ * w32misc: collection of unrelated, common win32 functions used by both * the console and GUI flavors of the editor. * - * $Header: /usr/build/vile/vile/RCS/w32misc.c,v 1.45 2005/02/01 00:12:40 tom Exp $ + * $Header: /usr/build/vile/vile/RCS/w32misc.c,v 1.46 2005/12/21 00:59:05 tom Exp $ */ #include "estruct.h" @@ -37,11 +37,16 @@ { FILE *fp; int rc = 0; + int fd1 = fileno(stdin); + int fd2; - if ((fp = fdopen(dup(fileno(stdin)), "r")) != NULL) - { - fclose(fp); - rc = 1; + if (fd1 >= 0) { + if ((fd2 = dup(fd1)) >= 0) { + if ((fp = fdopen(fd2, "r")) != NULL) { + fclose(fp); + rc = 1; + } + } } return (rc); } Index: w32ole.cpp Prereq: 1.22 --- vile-9.5d+/w32ole.cpp 2005-01-26 23:20:01.000000000 +0000 +++ vile-9.5e/w32ole.cpp 2005-12-20 22:18:06.000000000 +0000 @@ -17,7 +17,7 @@ * "FAILED" may not be used to test an OLE return code. Use SUCCEEDED * instead. * - * $Header: /usr/build/vile/vile/RCS/w32ole.cpp,v 1.22 2005/01/26 23:20:01 tom Exp $ + * $Header: /usr/build/vile/vile/RCS/w32ole.cpp,v 1.23 2005/12/20 22:18:06 tom Exp $ */ #include "w32vile.h" @@ -38,10 +38,19 @@ #include "w32reg.h" #include <initguid.h> + +#if __MSC_VER == 1200 /* Visual C++ 6.0 */ +#define VC6_ADDIN 1 +#else +#define VC6_ADDIN 0 +#endif + +#if VC6_ADDIN #include <objmodel/appguid.h> #include <objmodel/textguid.h> #include <objmodel/appauto.h> #include <objmodel/textauto.h> +#endif static size_t ansibuf_len, /* scaled in bytes */ olebuf_len; /* scaled in wchar_t */ @@ -748,6 +757,7 @@ int syncfile(int f, int n) { +#if VC6_ADDIN static CLSID ds_clsid; /* dev studio class id */ HRESULT hr; static int initialized; @@ -919,6 +929,9 @@ syncfile_exit: pApp->Release(); return (rc); +#else + return 0; // FIXME +#endif } /* ------------------- Key Redirection Implementation -------------------- */ Index: w32reg.c Prereq: 1.8 --- vile-9.5d+/w32reg.c 2003-03-11 19:53:25.000000000 +0000 +++ vile-9.5e/w32reg.c 2006-01-05 00:06:00.000000000 +0000 @@ -2,7 +2,7 @@ * w32reg.c: Winvile OLE registration code (currently only used for OLE * automation). * - * $Header: /usr/build/vile/vile/RCS/w32reg.c,v 1.8 2003/03/11 19:53:25 tom Exp $ + * $Header: /usr/build/vile/vile/RCS/w32reg.c,v 1.9 2006/01/05 00:06:00 cmorgan Exp $ */ #include "estruct.h" @@ -19,7 +19,7 @@ make_editor_path(char *path), registration_success(char *editor_name, char *which, char *path); -static int report_last_error(void); +static int report_w32_error(long w32_err_code); /* ---------------------------------------------------------------------- */ @@ -86,37 +86,42 @@ /* -------------------------- Step 1 --------------------------- */ sprintf(key, "%s.Application", name); - if (RegCreateKeyEx(HKEY_CLASSES_ROOT, - key, - 0, - NULL, - 0, - KEY_ALL_ACCESS, - NULL, - &hk, - NULL) != ERROR_SUCCESS) + if ((rc = RegCreateKeyEx(HKEY_CLASSES_ROOT, + key, + 0, + NULL, + 0, + KEY_ALL_ACCESS, + NULL, + &hk, + NULL)) != ERROR_SUCCESS) { - return (report_last_error()); + return (report_w32_error(rc)); } val_len = sprintf((char *) value, "%s %s Application", name, VTL_VERSTR); - if (RegSetValueEx(hk, NULL, 0, REG_SZ, value, val_len) != ERROR_SUCCESS) + if ((rc = RegSetValueEx(hk, + NULL, + 0, + REG_SZ, + value, + val_len)) != ERROR_SUCCESS) { RegCloseKey(hk); - return (report_last_error()); + return (report_w32_error(rc)); } strcat(key, "\\CLSID"); - if (RegCreateKeyEx(HKEY_CLASSES_ROOT, - key, - 0, - NULL, - 0, - KEY_ALL_ACCESS, - NULL, - &hksub, - NULL) != ERROR_SUCCESS) + if ((rc = RegCreateKeyEx(HKEY_CLASSES_ROOT, + key, + 0, + NULL, + 0, + KEY_ALL_ACCESS, + NULL, + &hksub, + NULL)) != ERROR_SUCCESS) { RegCloseKey(hk); - return (report_last_error()); + return (report_w32_error(rc)); } rc = RegSetValueEx(hksub, NULL, @@ -128,63 +133,68 @@ if (rc != ERROR_SUCCESS) { RegCloseKey(hk); - return (report_last_error()); + return (report_w32_error(rc)); } sprintf(key, "%s.Application\\CURVER", name); - if (RegCreateKeyEx(HKEY_CLASSES_ROOT, - key, - 0, - NULL, - 0, - KEY_ALL_ACCESS, - NULL, - &hksub, - NULL) != ERROR_SUCCESS) + if ((rc = RegCreateKeyEx(HKEY_CLASSES_ROOT, + key, + 0, + NULL, + 0, + KEY_ALL_ACCESS, + NULL, + &hksub, + NULL)) != ERROR_SUCCESS) { RegCloseKey(hk); - return (report_last_error()); + return (report_w32_error(rc)); } val_len = sprintf((char *) value, "%s.Application.%s", name, VTL_VERSTR); rc = RegSetValueEx(hksub, NULL, 0, REG_SZ, value, val_len); RegCloseKey(hksub); RegCloseKey(hk); if (rc != ERROR_SUCCESS) - return (report_last_error()); + return (report_w32_error(rc)); /* -------------------------- Step 2 --------------------------- */ sprintf(key, "%s.Application.%s", name, VTL_VERSTR); val_len = sprintf((char *) value, "%s %s Application", name, VTL_VERSTR); - if (RegCreateKeyEx(HKEY_CLASSES_ROOT, - key, - 0, - NULL, - 0, - KEY_ALL_ACCESS, - NULL, - &hk, - NULL) != ERROR_SUCCESS) - { - return (report_last_error()); - } - if (RegSetValueEx(hk, NULL, 0, REG_SZ, value, val_len) != ERROR_SUCCESS) + if ((rc = RegCreateKeyEx(HKEY_CLASSES_ROOT, + key, + 0, + NULL, + 0, + KEY_ALL_ACCESS, + NULL, + &hk, + NULL)) != ERROR_SUCCESS) + { + return (report_w32_error(rc)); + } + if ((rc = RegSetValueEx(hk, + NULL, + 0, + REG_SZ, + value, + val_len)) != ERROR_SUCCESS) { RegCloseKey(hk); - return (report_last_error()); + return (report_w32_error(rc)); } strcat(key, "\\CLSID"); - if (RegCreateKeyEx(HKEY_CLASSES_ROOT, - key, - 0, - NULL, - 0, - KEY_ALL_ACCESS, - NULL, - &hksub, - NULL) != ERROR_SUCCESS) + if ((rc = RegCreateKeyEx(HKEY_CLASSES_ROOT, + key, + 0, + NULL, + 0, + KEY_ALL_ACCESS, + NULL, + &hksub, + NULL)) != ERROR_SUCCESS) { RegCloseKey(hk); - return (report_last_error()); + return (report_w32_error(rc)); } rc = RegSetValueEx(hksub, NULL, @@ -195,69 +205,74 @@ RegCloseKey(hksub); RegCloseKey(hk); if (rc != ERROR_SUCCESS) - return (report_last_error()); + return (report_w32_error(rc)); sprintf(key, "CLSID\\%s", CLSID_VILEAUTO_KEY); val_len = sprintf((char *) value, "%s %s Application", name, VTL_VERSTR); - if (RegCreateKeyEx(HKEY_CLASSES_ROOT, - key, - 0, - NULL, - 0, - KEY_ALL_ACCESS, - NULL, - &hk, - NULL) != ERROR_SUCCESS) - { - return (report_last_error()); - } - if (RegSetValueEx(hk, NULL, 0, REG_SZ, value, val_len) != ERROR_SUCCESS) + if ((rc = RegCreateKeyEx(HKEY_CLASSES_ROOT, + key, + 0, + NULL, + 0, + KEY_ALL_ACCESS, + NULL, + &hk, + NULL)) != ERROR_SUCCESS) + { + return (report_w32_error(rc)); + } + if ((rc = RegSetValueEx(hk, + NULL, + 0, + REG_SZ, + value, + val_len)) != ERROR_SUCCESS) { RegCloseKey(hk); - return (report_last_error()); + return (report_w32_error(rc)); } strcat(key, "\\ProgID"); val_len = sprintf((char *) value, "%s.Application.%s", name, VTL_VERSTR); - if (RegCreateKeyEx(HKEY_CLASSES_ROOT, - key, - 0, - NULL, - 0, - KEY_ALL_ACCESS, - NULL, - &hksub, - NULL) != ERROR_SUCCESS) + if ((rc = RegCreateKeyEx(HKEY_CLASSES_ROOT, + key, + 0, + NULL, + 0, + KEY_ALL_ACCESS, + NULL, + &hksub, + NULL)) != ERROR_SUCCESS) { RegCloseKey(hk); - return (report_last_error()); + return (report_w32_error(rc)); } rc = RegSetValueEx(hksub, NULL, 0, REG_SZ, value, val_len); RegCloseKey(hksub); if (rc != ERROR_SUCCESS) { RegCloseKey(hk); - return (report_last_error()); + return (report_w32_error(rc)); } sprintf(key, "CLSID\\%s\\VersionIndependentProgID", CLSID_VILEAUTO_KEY); val_len = sprintf((char *) value, "%s.Application", name); - if (RegCreateKeyEx(HKEY_CLASSES_ROOT, - key, - 0, - NULL, - 0, - KEY_ALL_ACCESS, - NULL, - &hksub, - NULL) != ERROR_SUCCESS) + if ((rc = RegCreateKeyEx(HKEY_CLASSES_ROOT, + key, + 0, + NULL, + 0, + KEY_ALL_ACCESS, + NULL, + &hksub, + NULL)) != ERROR_SUCCESS) { RegCloseKey(hk); - return (report_last_error()); + return (report_w32_error(rc)); } rc = RegSetValueEx(hksub, NULL, 0, REG_SZ, value, val_len); RegCloseKey(hksub); if (rc != ERROR_SUCCESS) { RegCloseKey(hk); - return (report_last_error()); + return (report_w32_error(rc)); } sprintf(key, "CLSID\\%s\\LocalServer32", CLSID_VILEAUTO_KEY); sprintf((char *) value, "%s -Oa", editor_path); @@ -279,39 +294,39 @@ " -fn '%s'", opts->fontstr); } - if (RegCreateKeyEx(HKEY_CLASSES_ROOT, - key, - 0, - NULL, - 0, - KEY_ALL_ACCESS, - NULL, - &hksub, - NULL) != ERROR_SUCCESS) + if ((rc = RegCreateKeyEx(HKEY_CLASSES_ROOT, + key, + 0, + NULL, + 0, + KEY_ALL_ACCESS, + NULL, + &hksub, + NULL)) != ERROR_SUCCESS) { RegCloseKey(hk); - return (report_last_error()); + return (report_w32_error(rc)); } rc = RegSetValueEx(hksub, NULL, 0, REG_SZ, value, val_len); RegCloseKey(hksub); if (rc != ERROR_SUCCESS) { RegCloseKey(hk); - return (report_last_error()); + return (report_w32_error(rc)); } sprintf(key, "CLSID\\%s\\TypeLib", CLSID_VILEAUTO_KEY); - if (RegCreateKeyEx(HKEY_CLASSES_ROOT, - key, - 0, - NULL, - 0, - KEY_ALL_ACCESS, - NULL, - &hksub, - NULL) != ERROR_SUCCESS) + if ((rc = RegCreateKeyEx(HKEY_CLASSES_ROOT, + key, + 0, + NULL, + 0, + KEY_ALL_ACCESS, + NULL, + &hksub, + NULL)) != ERROR_SUCCESS) { RegCloseKey(hk); - return (report_last_error()); + return (report_w32_error(rc)); } rc = RegSetValueEx(hksub, NULL, @@ -323,21 +338,21 @@ if (rc != ERROR_SUCCESS) { RegCloseKey(hk); - return (report_last_error()); + return (report_w32_error(rc)); } sprintf(key, "CLSID\\%s\\Programmable", CLSID_VILEAUTO_KEY); - if (RegCreateKeyEx(HKEY_CLASSES_ROOT, - key, - 0, - NULL, - 0, - KEY_ALL_ACCESS, - NULL, - &hksub, - NULL) != ERROR_SUCCESS) + if ((rc = RegCreateKeyEx(HKEY_CLASSES_ROOT, + key, + 0, + NULL, + 0, + KEY_ALL_ACCESS, + NULL, + &hksub, + NULL)) != ERROR_SUCCESS) { RegCloseKey(hk); - return (report_last_error()); + return (report_w32_error(rc)); } RegCloseKey(hksub); RegCloseKey(hk); @@ -346,90 +361,90 @@ sprintf(key, "TypeLib\\%s\\%s", LIBID_VILEAUTO_KEY, VTL_VERSTR); val_len = sprintf((char *) value, "%s %s Type Library", name, VTL_VERSTR); - if (RegCreateKeyEx(HKEY_CLASSES_ROOT, - key, - 0, - NULL, - 0, - KEY_ALL_ACCESS, - NULL, - &hk, - NULL) != ERROR_SUCCESS) - { - return (report_last_error()); - } - if (RegSetValueEx(hk, - NULL, - 0, - REG_SZ, - value, - val_len) != ERROR_SUCCESS) + if ((rc = RegCreateKeyEx(HKEY_CLASSES_ROOT, + key, + 0, + NULL, + 0, + KEY_ALL_ACCESS, + NULL, + &hk, + NULL)) != ERROR_SUCCESS) + { + return (report_w32_error(rc)); + } + if ((rc = RegSetValueEx(hk, + NULL, + 0, + REG_SZ, + value, + val_len)) != ERROR_SUCCESS) { RegCloseKey(hk); - return (report_last_error()); + return (report_w32_error(rc)); } /* -------------------------- Step 4 --------------------------- */ strcat(key, "\\9\\win32"); val_len = strlen(strcpy((char *) value, editor_path)); - if (RegCreateKeyEx(HKEY_CLASSES_ROOT, - key, - 0, - NULL, - 0, - KEY_ALL_ACCESS, - NULL, - &hksub, - NULL) != ERROR_SUCCESS) + if ((rc = RegCreateKeyEx(HKEY_CLASSES_ROOT, + key, + 0, + NULL, + 0, + KEY_ALL_ACCESS, + NULL, + &hksub, + NULL)) != ERROR_SUCCESS) { RegCloseKey(hk); - return (report_last_error()); + return (report_w32_error(rc)); } rc = RegSetValueEx(hksub, NULL, 0, REG_SZ, value, val_len); RegCloseKey(hksub); RegCloseKey(hk); if (rc != ERROR_SUCCESS) - return (report_last_error()); + return (report_w32_error(rc)); /* -------------------------- Step 5 --------------------------- */ sprintf(key, "Interface\\%s", IID_IVILEAUTO_KEY); - if (RegCreateKeyEx(HKEY_CLASSES_ROOT, - key, - 0, - NULL, - 0, - KEY_ALL_ACCESS, - NULL, - &hk, - NULL) != ERROR_SUCCESS) - { - return (report_last_error()); - } - if (RegSetValueEx(hk, - NULL, - 0, - REG_SZ, - (CONST BYTE *) "IVileAuto", - sizeof("IVileAuto") - 1) != ERROR_SUCCESS) + if ((rc = RegCreateKeyEx(HKEY_CLASSES_ROOT, + key, + 0, + NULL, + 0, + KEY_ALL_ACCESS, + NULL, + &hk, + NULL)) != ERROR_SUCCESS) + { + return (report_w32_error(rc)); + } + if ((rc = RegSetValueEx(hk, + NULL, + 0, + REG_SZ, + (CONST BYTE *) "IVileAuto", + sizeof("IVileAuto") - 1)) != ERROR_SUCCESS) { RegCloseKey(hk); - return (report_last_error()); + return (report_w32_error(rc)); } strcat(key, "\\TypeLib"); - if (RegCreateKeyEx(HKEY_CLASSES_ROOT, - key, - 0, - NULL, - 0, - KEY_ALL_ACCESS, - NULL, - &hksub, - NULL) != ERROR_SUCCESS) + if ((rc = RegCreateKeyEx(HKEY_CLASSES_ROOT, + key, + 0, + NULL, + 0, + KEY_ALL_ACCESS, + NULL, + &hksub, + NULL)) != ERROR_SUCCESS) { RegCloseKey(hk); - return (report_last_error()); + return (report_w32_error(rc)); } rc = RegSetValueEx(hksub, NULL, @@ -441,21 +456,21 @@ if (rc != ERROR_SUCCESS) { RegCloseKey(hk); - return (report_last_error()); + return (report_w32_error(rc)); } sprintf(key, "Interface\\%s\\ProxyStubClsid32", IID_IVILEAUTO_KEY); - if (RegCreateKeyEx(HKEY_CLASSES_ROOT, - key, - 0, - NULL, - 0, - KEY_ALL_ACCESS, - NULL, - &hksub, - NULL) != ERROR_SUCCESS) + if ((rc = RegCreateKeyEx(HKEY_CLASSES_ROOT, + key, + 0, + NULL, + 0, + KEY_ALL_ACCESS, + NULL, + &hksub, + NULL)) != ERROR_SUCCESS) { RegCloseKey(hk); - return (report_last_error()); + return (report_w32_error(rc)); } rc = RegSetValueEx(hksub, NULL, @@ -466,7 +481,7 @@ RegCloseKey(hksub); RegCloseKey(hk); if (rc != ERROR_SUCCESS) - return (report_last_error()); + return (report_w32_error(rc)); /* ------ Get to here, then all is well. Report status. ------ */ @@ -478,12 +493,14 @@ /* * Undo oleauto_register(). Absence of any of the keys/values is not an - * error. This routine can't fail (no news is good news). + * error. This routine can't fail, but we will check periodically for + * permission (access) errors. */ int oleauto_unregister(void) { char keytop[512], keysub[512], name[64]; + long rc; make_editor_name(name); @@ -496,35 +513,47 @@ sprintf(keytop, "%s.Application", name); sprintf(keysub, "%s\\CLSID", keytop); - RegDeleteKey(HKEY_CLASSES_ROOT, keysub); + if ((rc = RegDeleteKey(HKEY_CLASSES_ROOT, keysub)) != ERROR_SUCCESS) + { + if (rc == ERROR_ACCESS_DENIED) + return (report_w32_error(rc)); + } sprintf(keysub, "%s\\CURVER", keytop); - RegDeleteKey(HKEY_CLASSES_ROOT, keysub); - RegDeleteKey(HKEY_CLASSES_ROOT, keytop); + (void) RegDeleteKey(HKEY_CLASSES_ROOT, keysub); + (void) RegDeleteKey(HKEY_CLASSES_ROOT, keytop); /* -------------------------- Step 2 --------------------------- */ sprintf(keytop, "%s.Application.%s", name, VTL_VERSTR); sprintf(keysub, "%s\\CLSID", keytop); - RegDeleteKey(HKEY_CLASSES_ROOT, keysub); - RegDeleteKey(HKEY_CLASSES_ROOT, keytop); + if ((rc = RegDeleteKey(HKEY_CLASSES_ROOT, keysub)) != ERROR_SUCCESS) + { + if (rc == ERROR_ACCESS_DENIED) + return (report_w32_error(rc)); + } + (void) RegDeleteKey(HKEY_CLASSES_ROOT, keytop); sprintf(keytop, "CLSID\\%s", CLSID_VILEAUTO_KEY); sprintf(keysub, "%s\\ProgID", keytop); - RegDeleteKey(HKEY_CLASSES_ROOT, keysub); + (void) RegDeleteKey(HKEY_CLASSES_ROOT, keysub); sprintf(keysub, "%s\\VersionIndependentProgID", keytop); - RegDeleteKey(HKEY_CLASSES_ROOT, keysub); + (void) RegDeleteKey(HKEY_CLASSES_ROOT, keysub); sprintf(keysub, "%s\\LocalServer32", keytop); - RegDeleteKey(HKEY_CLASSES_ROOT, keysub); + (void) RegDeleteKey(HKEY_CLASSES_ROOT, keysub); sprintf(keysub, "%s\\TypeLib", keytop); - RegDeleteKey(HKEY_CLASSES_ROOT, keysub); + (void) RegDeleteKey(HKEY_CLASSES_ROOT, keysub); sprintf(keysub, "%s\\Programmable", keytop); - RegDeleteKey(HKEY_CLASSES_ROOT, keysub); - RegDeleteKey(HKEY_CLASSES_ROOT, keytop); + (void) RegDeleteKey(HKEY_CLASSES_ROOT, keysub); + (void) RegDeleteKey(HKEY_CLASSES_ROOT, keytop); /* ----------------------- Step 3 & 4 -------------------------- */ sprintf(keytop, "TypeLib\\%s\\%s", LIBID_VILEAUTO_KEY, VTL_VERSTR); sprintf(keysub, "%s\\9\\win32", keytop); - RegDeleteKey(HKEY_CLASSES_ROOT, keysub); + if ((rc = RegDeleteKey(HKEY_CLASSES_ROOT, keysub)) != ERROR_SUCCESS) + { + if (rc == ERROR_ACCESS_DENIED) + return (report_w32_error(rc)); + } sprintf(keysub, "%s\\9", keytop); RegDeleteKey(HKEY_CLASSES_ROOT, keysub); RegDeleteKey(HKEY_CLASSES_ROOT, keytop); @@ -535,7 +564,11 @@ sprintf(keytop, "Interface\\%s", IID_IVILEAUTO_KEY); sprintf(keysub, "%s\\TypeLib", keytop); - RegDeleteKey(HKEY_CLASSES_ROOT, keysub); + if ((rc = RegDeleteKey(HKEY_CLASSES_ROOT, keysub)) != ERROR_SUCCESS) + { + if (rc == ERROR_ACCESS_DENIED) + return (report_w32_error(rc)); + } sprintf(keysub, "%s\\ProxyStubClsid32", keytop); RegDeleteKey(HKEY_CLASSES_ROOT, keysub); RegDeleteKey(HKEY_CLASSES_ROOT, keytop); @@ -550,7 +583,12 @@ make_editor_name(char *name /* must be long enough to hold result */) { strcpy(name, prognam); - *name = toUpper(*name); + + /* + * Can't call toUpper() here because vile's character mapping array is + * not initialized in all cases _before_ make_editor_name() is called. + */ + *name = (char) toupper(*name); } @@ -566,29 +604,47 @@ */ sprintf(name, "%s.exe", prognam); if ((s = cfg_locate(name, FL_PATH|FL_EXECABLE)) != 0) - strcpy(path, sl_to_bsl(s)); - else { - /* lookup failed, assume cwd. */ - - if (_getcwd(temp, sizeof(temp)) == NULL) + if (! (s[0] == '.' && s[1] == '\\')) { - /* getcwd failed, user must live with '.' . */ - - temp[0] = '.'; - temp[1] = '\0'; + strcpy(path, sl_to_bsl(s)); + return; } - sprintf(path, "%s\\%s", sl_to_bsl(temp), name); } + + /* lookup failed or path prefix was ".\", fall back on cwd */ + if (_getcwd(temp, sizeof(temp)) == NULL) + { + /* getcwd failed, user must live with '.' . */ + + temp[0] = '.'; + temp[1] = '\0'; + } + sprintf(path, "%s\\%s", sl_to_bsl(temp), name); } static int -report_last_error(void) +report_w32_error(long w32_err_code) { - disp_win32_error(W32_SYS_ERROR, NULL); - return (1); /* This becomes the exit status returned to shell. */ + if (w32_err_code == ERROR_ACCESS_DENIED) + { + /* give an error message other than "Access denied" */ + + MessageBox(NULL, + "Access denied while updating the registry." + "\r\rRegistering/Unregistering an OLE automation server requires " + "administrator privilege.", + prognam, + MB_OK|MB_ICONSTOP); + + } + else + { + disp_win32_error(w32_err_code, NULL); + } + return (w32_err_code); } Index: winvile.h --- vile-9.5d+/winvile.h 2005-01-26 19:17:55.000000000 +0000 +++ vile-9.5e/winvile.h 2006-01-05 00:10:17.000000000 +0000 @@ -40,3 +40,5 @@ #define WM_WVILE_CURSOR_ON (WM_USER + 1) #define WM_WVILE_CURSOR_OFF (WM_USER + 2) +#define WM_WVILE_FLASH_START (WM_USER + 3) +#define WM_WVILE_FLASH_STOP (WM_USER + 4) Index: wvwrap.cpp Prereq: 1.9 --- vile-9.5d+/wvwrap.cpp 2005-01-17 01:45:21.000000000 +0000 +++ vile-9.5e/wvwrap.cpp 2006-01-04 22:53:39.000000000 +0000 @@ -10,7 +10,7 @@ * Note: A great deal of the code included in this file is copied * (almost verbatim) from other vile modules. * - * $Header: /usr/build/vile/vile/RCS/wvwrap.cpp,v 1.9 2005/01/17 01:45:21 tom Exp $ + * $Header: /usr/build/vile/vile/RCS/wvwrap.cpp,v 1.10 2006/01/04 22:53:39 cmorgan Exp $ */ #include "w32vile.h" @@ -229,14 +229,31 @@ } else { + /* + * To add insult to injury, Windows Explorer has a habit + * of passing 8.3 filenames to wvwrap (noted on a win2K + * system and a FAT32 partition). If the folder portion + * of the file's path happens to be in 8.3 format (i.e., + * a tilde included in the folder name), then 8.3 folder + * names appear in winvile's Recent Folders list. + * Needless to say, it's no fun trying to decipher 8.3 + * folder names. + */ + + char folder[FILENAME_MAX], *fp; + + if (GetLongPathName(*argv, folder, sizeof(folder)) > 0) + fp = folder; + else + fp = *argv; + if (insert_mode) { dynbuf[0] = '\033'; offset = 1; } - add_delim = (isalpha((*argv)[0]) && - (*argv)[1] == ':' && - (*argv)[2] == '\0'); + add_delim = (isalpha(fp[0]) && fp[1] == ':' && fp[2] == '\0'); + /* * With regard to the following code, note that the * original file might be in the form "<drive>:\leaf", in @@ -246,7 +263,7 @@ */ sprintf(dynbuf + offset, ":cd %s%s\n", - *argv, + fp, (add_delim) ? "\\" : ""); } dynbuf_idx = strlen(dynbuf);