# vile 9.4h - 2004/6/20 - T.Dickey # ------------------------------------------------------------------------------ # CHANGES | 15 +++++++++++++++ # MANIFEST | 2 +- # eval.c | 12 +++++++++--- # exec.c | 21 ++++++++++++++++----- # macros/which.rc | 34 ++++++++++++++++++++++------------ # patchlev.h | 2 +- # perl.xs | 10 ++++++---- # perl/directory.pm | 4 ++-- # proto.h | 3 ++- # revlist | 24 ++++++++++++------------ # tbuff.c | 32 ++++++++++++++++++++++++++++++-- # vile-9.4.spec | 9 +++++++-- # 12 files changed, 123 insertions(+), 45 deletions(-) # ------------------------------------------------------------------------------ Index: CHANGES --- vile-9.4g+/CHANGES 2004-06-17 23:56:32.000000000 +0000 +++ vile-9.4h/CHANGES 2004-06-21 00:04:37.000000000 +0000 @@ -1,5 +1,20 @@ Changes for vile 9.5 (released ??? ??? ?? ????) + 20040620 (h) + > Tom Dickey: + + correct which-keywords to work with 9.4e change that appends "mode" + to majormode parameters of procedures. + + rename utility macro which-filename to WhichFilename, to avoid + conflict with which-filter. + + add/use tb_setlen() in run_func() to update the lengths of TBUFF's + which are built by unusual methods, e.g., allocating a large TBUFF + and using lengthen_path() to rewrite its contents. This was not + a noticeable problem until run_func() called tb_enquote(), which + assumed the TBUFF length was correct. + + modify FindMode() in perl.xs to dequote results from evaluating + a function, since 9.4f changes cause string results of functions to + always be quoted. + 20040617 (g) > Clark Morgan: + modify manpage.rc and color-ls.rc to avoid showing their guts if Index: MANIFEST --- vile-9.4g+/MANIFEST 2004-06-18 00:56:07.000000000 +0000 +++ vile-9.4h/MANIFEST 2004-06-21 00:16:00.000000000 +0000 @@ -1,4 +1,4 @@ -MANIFEST for vile, version v9_4g +MANIFEST for vile, version v9_4h -------------------------------------------------------------------------------- MANIFEST this file CHANGES Change-log for VILE Index: eval.c Prereq: 1.330 --- vile-9.4g+/eval.c 2004-06-11 11:20:34.000000000 +0000 +++ vile-9.4h/eval.c 2004-06-19 15:04:50.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.330 2004/06/11 11:20:34 tom Exp $ + * $Header: /usr/build/vile/vile/RCS/eval.c,v 1.331 2004/06/19 15:04:50 tom Exp $ * */ @@ -926,7 +926,7 @@ break; case UFGTSEQ: (void) kcod2escape_seq(kbd_seq_nomap(), tb_values(result)); - result->tb_used = strlen(tb_values(result)); + tb_setlen(&result, -1); break; case UFCMATCH: if ((exp = new_regexval(arg[0], TRUE)) != 0) { @@ -1052,19 +1052,24 @@ tb_scopy(&result, arg[1]); tb_alloc(&result, NFILEN); SL_TO_BSL(lengthen_path(tb_values(result))); + tb_setlen(&result, -1); break; case PATH_HEAD: SL_TO_BSL(path_head(&result, arg[1])); + tb_setlen(&result, -1); break; case PATH_ROOT: tb_scopy(&result, SL_TO_BSL(pathleaf(arg[1]))); - if ((cp = strchr(tb_values(result), '.')) != 0) + if ((cp = strchr(tb_values(result), '.')) != 0) { *cp = EOS; + tb_setlen(&result, -1); + } break; case PATH_SHORT: tb_scopy(&result, arg[1]); tb_alloc(&result, NFILEN); SL_TO_BSL(shorten_path(tb_values(result), FALSE)); + tb_setlen(&result, -1); break; case PATH_TAIL: tb_scopy(&result, pathleaf(arg[1])); @@ -1078,6 +1083,7 @@ case UFPATHCAT: tb_alloc(&result, NFILEN); SL_TO_BSL(pathcat(tb_values(result), arg[0], arg[1])); + tb_setlen(&result, -1); break; case UFPATHQUOTE: path_quote(&result, SL_TO_BSL(arg[0])); Index: exec.c Prereq: 1.264 --- vile-9.4g+/exec.c 2004-06-09 20:59:35.000000000 +0000 +++ vile-9.4h/exec.c 2004-06-19 17:15:20.000000000 +0000 @@ -4,7 +4,7 @@ * original by Daniel Lawrence, but * much modified since then. assign no blame to him. -pgf * - * $Header: /usr/build/vile/vile/RCS/exec.c,v 1.264 2004/06/09 20:59:35 tom Exp $ + * $Header: /usr/build/vile/vile/RCS/exec.c,v 1.265 2004/06/19 17:15:20 tom Exp $ * */ @@ -13,8 +13,10 @@ #include "nefunc.h" #include "nefsms.h" -static int rangespec(const char *specp, LINEPTR * fromlinep, LINEPTR * - tolinep, CMDFLAGS * flagp); +static int rangespec(const char *specp, + LINEPTR * fromlinep, + LINEPTR * tolinep, + CMDFLAGS * flagp); /* while loops are described by a list of small structs. these point * at the line on which they were found, and at the line to which one @@ -849,8 +851,17 @@ returnCode(FALSE); } - TRACE((T_CALLED "execute(execfunc=%p(%s), f=%d, n=%d)\n", - execfunc, execfunc->c_name ? execfunc->c_name : "?", f, n)); + TRACE((T_CALLED "execute(execfunc=%p(%s:%s), f=%d, n=%d)\n", + execfunc, + (execfunc->c_flags & CMD_PERL + ? "perl" + : (execfunc->c_flags & CMD_PROC + ? "proc" + : "func")), + (execfunc->c_name + ? execfunc->c_name + : "?"), + f, n)); flags = execfunc->c_flags; Index: macros/which.rc Prereq: 1.4 --- vile-9.4g+/macros/which.rc 2003-10-08 20:34:29.000000000 +0000 +++ vile-9.4h/macros/which.rc 2004-06-21 00:04:55.000000000 +0000 @@ -1,4 +1,4 @@ -;; $Header: /usr/build/vile/vile/macros/RCS/which.rc,v 1.4 2003/10/08 20:34:29 tom Exp $ +;; $Header: /usr/build/vile/vile/macros/RCS/which.rc,v 1.6 2004/06/21 00:04:55 tom Exp $ ;; ;; Show where vile looks for keyword file, and where it finds it. If we ;; always implemented built-in filters, the natural place for this would be @@ -6,7 +6,7 @@ ;; configured with external filters. Rather than maintain two chunks of ;; similar C code, this is implemented as a macro (as an exercise ;-. -store-procedure which-filename f='Filename' +store-procedure WhichFilename f='Filename' ~local %flag newline ~if &rd $1 @@ -19,10 +19,20 @@ ~endm store-procedure which-keywords major="MajorMode" "Prompt for, and display location of keyword files" - ~local %terse %path %leaf %suffix %pathdot %dothides %index %mybuffer %found + ~local %terse %path %leaf %suffix %pathdot %dothides %index %mybuffer %found %long %short setv %terse=$terse setv %found="no" set terse + + ~if &seq 'mode' &right $1 &sub &len $1 3 + ; 9.4e + setv %long=$1 + setv %short=&left $1 &sub &len $1 4 + ~else + ; pre-9.4e + setv %long=&cat $1 'mode' + setv %short=$1 + ~endif ; setv %mybuffer='[Which Keywords]' ~force select-buffer %mybuffer @@ -39,7 +49,7 @@ ; insert-string 'Show which keyword-files are tested for:' newline - insert-string &cat &chr 9 &cat $1 'mode' + insert-string &cat &chr 9 %long newline insert-string '(* marks found-files)' 2 newline @@ -56,14 +66,14 @@ setv %pathdot='.' ~endif ; - setv %leaf=&cat $1 %suffix + setv %leaf=&cat %short %suffix insert-string '$cwd' - which-filename &cat %pathdot &cat $pathname-separator &cat %dothides %leaf + WhichFilename &cat %pathdot &cat $pathname-separator &cat %dothides %leaf ; newline insert-string '$HOME' - which-filename &cat '~' &cat $pathname-separator &cat %dothides %leaf - which-filename &cat '~' &cat $pathname-separator &cat %dothides &cat 'vile' &cat $pathname-separator %leaf + WhichFilename &cat '~' &cat $pathname-separator &cat %dothides %leaf + WhichFilename &cat '~' &cat $pathname-separator &cat %dothides &cat 'vile' &cat $pathname-separator %leaf ; newline insert-string '$startup-path' @@ -73,7 +83,7 @@ ~if &seq %path '' ~break ~endif - which-filename &cat %path &cat $pathname-separator %leaf + WhichFilename &cat %path &cat $pathname-separator %leaf setv %index=&add %index 1 ~endwhile ; @@ -124,11 +134,11 @@ ; Look for $menu-file in the current and home-directories setv %leaf=$menu-file insert-string '$cwd' - which-filename &cat %pathdot &cat $pathname-separator %leaf + WhichFilename &cat %pathdot &cat $pathname-separator %leaf ; newline insert-string '$HOME' - which-filename &cat '~' &cat $pathname-separator %leaf + WhichFilename &cat '~' &cat $pathname-separator %leaf ; ; If dot hides a name, and $menu-file begins with a dot, we are done ; with it. Use "vilemenu.rc" in the other places. If it does not @@ -148,7 +158,7 @@ ~if &seq %path '' ~break ~endif - which-filename &cat %path &cat $pathname-separator %leaf + WhichFilename &cat %path &cat $pathname-separator %leaf setv %index=&add %index 1 ~endwhile ; Index: patchlev.h --- vile-9.4g+/patchlev.h 2004-05-13 23:57:03.000000000 +0000 +++ vile-9.4h/patchlev.h 2004-06-19 16:46:17.000000000 +0000 @@ -1,2 +1,2 @@ /* set to "" for no patches */ -#define PATCHLEVEL "g" +#define PATCHLEVEL "h" Index: perl.xs Prereq: 1.91 --- vile-9.4g+/perl.xs 2004-03-22 22:37:16.000000000 +0000 +++ vile-9.4h/perl.xs 2004-06-19 16:44:54.000000000 +0000 @@ -13,7 +13,7 @@ * vile. The file api.c (sometimes) provides a middle layer between * this interface and the rest of vile. * - * $Header: /usr/build/vile/vile/RCS/perl.xs,v 1.91 2004/03/22 22:37:16 tom Exp $ + * $Header: /usr/build/vile/vile/RCS/perl.xs,v 1.92 2004/06/19 16:44:54 tom Exp $ */ /*# @@ -1701,6 +1701,7 @@ int literal = (toktyp(mode) == TOK_LITSTR); const char *value; char *result = 0; + TBUFF *temp = 0; if (literal) status = find_mode(curbp, mode, isglobal, args); @@ -1718,7 +1719,6 @@ * A function should be legal anywhere a variable value is. */ if (toktyp(mode) == TOK_FUNCTION) { - TBUFF *temp = 0; char *save_str = execstr; int save_flag = clexec; @@ -1728,8 +1728,9 @@ if (isSpace(*execstr)) { *execstr++ = 0; } - value = tokval(tb_values(temp)); - tb_free(&temp); + tb_scopy(&temp, tokval(tb_values(temp))); + tb_dequote(&temp); + value = tb_values(temp); execstr = save_str; clexec = save_flag; @@ -1746,6 +1747,7 @@ } else { value = ""; } + tb_free(&temp); TRACE(("value of %s(%s) = %s\n", status ? "mode" : "", mode, value)); return result; } Index: perl/directory.pm Prereq: 1.8 --- vile-9.4g+/perl/directory.pm 2002-05-06 23:08:25.000000000 +0000 +++ vile-9.4h/perl/directory.pm 2004-06-19 17:50:47.000000000 +0000 @@ -1,4 +1,4 @@ -# $Header: /usr/build/vile/vile/perl/RCS/directory.pm,v 1.8 2002/05/06 23:08:25 tom Exp $ +# $Header: /usr/build/vile/vile/perl/RCS/directory.pm,v 1.9 2004/06/19 17:50:47 tom Exp $ # (see dir.doc) package directory; @@ -48,7 +48,7 @@ do { print "[Aborted]"; Vile::working($work); return; } if (! defined $dir); $dir = scalar(Vile->get("&path full $dir")); - chdir $dir || do { print "dir: $!\n"; Vile::working($work); return; }; + chdir $dir || do { print "$dir: $!\n"; Vile::working($work); return; }; # Keep the vile current directory in sync with the directory the browser is # displaying. Index: proto.h Prereq: 1.525 --- vile-9.4g+/proto.h 2004-06-17 00:56:50.000000000 +0000 +++ vile-9.4h/proto.h 2004-06-19 15:00:08.000000000 +0000 @@ -4,7 +4,7 @@ * * Created: Thu May 14 15:44:40 1992 * - * $Header: /usr/build/vile/vile/RCS/proto.h,v 1.525 2004/06/17 00:56:50 tom Exp $ + * $Header: /usr/build/vile/vile/RCS/proto.h,v 1.526 2004/06/19 15:00:08 tom Exp $ * */ @@ -1107,6 +1107,7 @@ size_t tb_length (TBUFF *p); void tb_first (TBUFF *p); void tb_free (TBUFF **p); +void tb_setlen (TBUFF **p, int n); void tb_stuff (TBUFF *p, int c); void tb_unnext (TBUFF *p); void tb_unput (TBUFF *p); Index: revlist --- vile-9.4g+/revlist 2004-06-18 00:55:05.000000000 +0000 +++ vile-9.4h/revlist 2004-06-21 00:15:30.000000000 +0000 @@ -1,6 +1,6 @@ -revlist for vile, version v9_4g +revlist for vile, version v9_4h -------------------------------------------------------------------------------- -CHANGES 1.745 +CHANGES 1.748 CHANGES.R3 1.1 CHANGES.R4 1.1 CHANGES.R5 1.1 @@ -40,8 +40,8 @@ dumbterm.c 1.18 edef.h 1.314 estruct.h 1.543 -eval.c 1.330 -exec.c 1.264 +eval.c 1.331 +exec.c 1.265 externs.c 1.9 fences.c 1.82 file.c 1.351 @@ -85,25 +85,25 @@ os2keys.h 1.1 os2pipe.c 1.5 os2vio.c 1.29 -patchlev.h 1.311 +patchlev.h 1.312 path.c 1.135 -perl.xs 1.91 +perl.xs 1.92 plugin.c 1.1 plugin.h 1.1 -proto.h 1.525 +proto.h 1.526 pscreen.h 1.1 ptypemap 1.7 random.c 1.272 regexp.c 1.108 region.c 1.128 -revlist v9_4g +revlist v9_4h search.c 1.135 select.c 1.151 sinstall.sh 1.1 spawn.c 1.179 statevar.c 1.80 tags.c 1.120 -tbuff.c 1.47 +tbuff.c 1.48 tcap.c 1.152 tcap.h 1.9 termio.c 1.196 @@ -112,7 +112,7 @@ ucrypt.c 1.15 undo.c 1.84 version.c 1.55 -vile-9.4.spec 1.8 +vile-9.4.spec 1.9 vile.1 1.30 vile.hlp 1.584 vile.wmconfig 1.1 @@ -327,7 +327,7 @@ macros/vileinit.rc 1.22 macros/vilemenu.rc 1.2 macros/vileperl.rc 1.7 -macros/which.rc 1.4 +macros/which.rc 1.6 perl/Breadcrumbs.pm 1.4 perl/CaptHook.pm 1.1 perl/Glob2re.pm 1.1 @@ -339,7 +339,7 @@ perl/Visit.pm 1.2 perl/capture.pm 1.2 perl/dict.pm 1.3 -perl/directory.pm 1.8 +perl/directory.pm 1.9 perl/dirlist.pm 1.3 perl/gdb.pm 1.1 perl/hgrep.pm 1.3 Index: tbuff.c Prereq: 1.47 --- vile-9.4g+/tbuff.c 2004-06-11 11:22:15.000000000 +0000 +++ vile-9.4h/tbuff.c 2004-06-19 17:43:37.000000000 +0000 @@ -7,7 +7,7 @@ * To do: add 'tb_ins()' and 'tb_del()' to support cursor-level command * editing. * - * $Header: /usr/build/vile/vile/RCS/tbuff.c,v 1.47 2004/06/11 11:22:15 tom Exp $ + * $Header: /usr/build/vile/vile/RCS/tbuff.c,v 1.48 2004/06/19 17:43:37 tom Exp $ * */ @@ -16,6 +16,8 @@ #define NCHUNK NLINE +#define ERROR_LEN 6 /* sizeof(ERROR) */ + /*******(testing)************************************************************/ #if NO_LEAKS typedef struct _tb_list { @@ -500,10 +502,36 @@ if (p != 0) { if (p->tb_errs) { - result = 6; /* sizeof(ERROR) */ + result = ERROR_LEN; } else { result = p->tb_used; } } return result; } + +/* + * Set the length of the buffer, increasing it if needed, and accounting for + * errors. + */ +void +tb_setlen(TBUFF **p, int n) +{ + size_t len; + + if (p != 0) { + if (!(*p)->tb_errs) { + if (n < 0) { + char *value = tb_values(*p); + if (value != 0) + len = strlen(value) + 1; + else + len = 0; + } else { + len = n; + tb_alloc(p, len); + } + (*p)->tb_used = len; + } + } +} Index: vile-9.4.spec Prereq: 1.8 --- vile-9.4g+/vile-9.4.spec 2004-05-13 23:57:47.000000000 +0000 +++ vile-9.4h/vile-9.4.spec 2004-06-19 16:47:20.000000000 +0000 @@ -1,7 +1,7 @@ Summary: VILE VI Like Emacs editor -# $Header: /usr/build/vile/vile/RCS/vile-9.4.spec,v 1.8 2004/05/13 23:57:47 tom Exp $ +# $Header: /usr/build/vile/vile/RCS/vile-9.4.spec,v 1.9 2004/06/19 16:47:20 tom Exp $ Name: vile -Version: 9.4g +Version: 9.4h # each patch should update the version Release: 1 Copyright: GPL @@ -15,6 +15,7 @@ Patch5: vile-9.4e.patch.gz Patch6: vile-9.4f.patch.gz Patch7: vile-9.4g.patch.gz +Patch8: vile-9.4h.patch.gz # each patch should add itself to this list Packager: Thomas Dickey BuildRoot: %{_tmppath}/%{name}-root @@ -34,6 +35,7 @@ %patch5 -p1 %patch6 -p1 %patch7 -p1 +%patch8 -p1 # each patch should add itself to this list %build @@ -81,6 +83,9 @@ %changelog # each patch should add its ChangeLog entries here +* Sat Jun 19 2004 Thomas Dickey +- added patch for 9.4h + * Thu May 13 2004 Thomas Dickey - added patch for 9.4g