The 'tcl' command in vi does nothing, except to print the message
"Vi was not loaded with a Tcl interpreter". Printing the standard
message for unknown commands would be equally descriptive with the
benefit of reducing code size.

See the diff below.

cheers,
natano


Index: build/Makefile
===================================================================
RCS file: /cvs/src/usr.bin/vi/build/Makefile,v
retrieving revision 1.19
diff -u -r1.19 Makefile
--- build/Makefile      6 Nov 2014 10:48:52 -0000       1.19
+++ build/Makefile      14 Nov 2014 16:09:35 -0000
@@ -26,7 +26,7 @@
        ex_global.c ex_init.c ex_join.c ex_map.c ex_mark.c ex_mkexrc.c \
        ex_move.c ex_open.c ex_perl.c ex_preserve.c ex_print.c ex_put.c \
        ex_quit.c ex_read.c ex_screen.c ex_script.c ex_set.c ex_shell.c \
-       ex_shift.c ex_source.c ex_stop.c ex_subst.c ex_tag.c ex_tcl.c \
+       ex_shift.c ex_source.c ex_stop.c ex_subst.c ex_tag.c \
        ex_txt.c ex_undo.c ex_usage.c ex_util.c ex_version.c ex_visual.c \
        ex_write.c ex_yank.c ex_z.c exf.c getc.c key.c line.c log.c main.c \
        mark.c msg.c options.c options_f.c put.c recover.c screen.c \
Index: common/gs.h
===================================================================
RCS file: /cvs/src/usr.bin/vi/common/gs.h,v
retrieving revision 1.11
diff -u -r1.11 gs.h
--- common/gs.h 1 Dec 2013 20:22:34 -0000       1.11
+++ common/gs.h 14 Nov 2014 16:09:18 -0000
@@ -64,7 +64,6 @@
        SCR     *ccl_sp;                /* Colon command-line screen. */
 
        void    *perl_interp;           /* Perl interpreter. */
-       void    *tcl_interp;            /* Tcl_Interp *: Tcl interpreter. */
 
        void    *cl_private;            /* Curses support private area. */
        void    *ip_private;            /* IP support private area. */
Index: docs/help
===================================================================
RCS file: /cvs/src/usr.bin/vi/docs/help,v
retrieving revision 1.3
diff -u -r1.3 help
--- docs/help   29 May 2010 06:40:00 -0000      1.3
+++ docs/help   14 Nov 2014 16:07:02 -0000
@@ -188,7 +188,6 @@
       tagpop: return to the previous group of tags
      tagprev: move to the previous tag
       tagtop: discard all tags
-        tcl: run the tcl interpreter with the command
        undo: undo the most recent change
 unabbreviate: delete an abbreviation
        unmap: delete an input or command map
Index: ex/ex_cmd.c
===================================================================
RCS file: /cvs/src/usr.bin/vi/ex/ex_cmd.c,v
retrieving revision 1.7
diff -u -r1.7 ex_cmd.c
--- ex/ex_cmd.c 29 May 2010 06:40:00 -0000      1.7
+++ ex/ex_cmd.c 14 Nov 2014 16:08:50 -0000
@@ -370,12 +370,6 @@
            "!",
            "tagt[op][!]",
            "discard all tags"},
-/* C_TCLCMD */
-       {"tcl",         ex_tcl,         E_ADDR2_ALL|E_ADDR_ZERO|
-                                           E_ADDR_ZERODEF|E_SECURE,
-           "s",
-           "tc[l] cmd",
-           "run the tcl interpreter with the command"},
 /* C_UNDO */
        {"undo",        ex_undo,        E_AUTOPRINT,
            "",
Index: ex/ex_tcl.c
===================================================================
RCS file: /cvs/src/usr.bin/vi/ex/ex_tcl.c,v
retrieving revision 1.7
diff -u -r1.7 ex_tcl.c
--- ex/ex_tcl.c 12 Nov 2014 04:28:41 -0000      1.7
+++ ex/ex_tcl.c 14 Nov 2014 16:11:01 -0000
@@ -1,33 +1 @@
-/*     $OpenBSD: ex_tcl.c,v 1.7 2014/11/12 04:28:41 bentley Exp $      */
- 
-/*-
- * Copyright (c) 1992, 1993, 1994
- *     The Regents of the University of California.  All rights reserved.
- * Copyright (c) 1992, 1993, 1994, 1995, 1996
- *     Keith Bostic.  All rights reserved.
- * Copyright (c) 1995
- *     George V. Neville-Neil.  All rights reserved.
- *
- * See the LICENSE file for redistribution information.
- */
-
-#include <sys/types.h>
-#include <sys/queue.h>
-
-#include <bitstring.h>
-#include <stdio.h>
-
-#include "../common/common.h"
-
-/* 
- * ex_tcl -- :[line [,line]] tcl [command]
- *     Run a command through the tcl interpreter.
- *
- * PUBLIC: int ex_tcl(SCR*, EXCMD *);
- */
-int 
-ex_tcl(SCR *sp, EXCMD *cmdp)
-{
-       msgq(sp, M_ERR, "302|Vi was not loaded with a Tcl interpreter");
-       return (1);
-}
Index: include/ex_def.h
===================================================================
RCS file: /cvs/src/usr.bin/vi/include/ex_def.h,v
retrieving revision 1.2
diff -u -r1.2 ex_def.h
--- include/ex_def.h    29 Jan 2001 01:58:47 -0000      1.2
+++ include/ex_def.h    14 Nov 2014 16:13:11 -0000
@@ -62,19 +62,18 @@
 #define C_TAGPOP 59
 #define C_TAGPREV 60
 #define C_TAGTOP 61
-#define C_TCLCMD 62
-#define C_UNDO 63
-#define C_UNABBREVIATE 64
-#define C_UNMAP 65
-#define C_V 66
-#define C_VERSION 67
-#define C_VISUAL_EX 68
-#define C_VISUAL_VI 69
-#define C_VIUSAGE 70
-#define C_WRITE 71
-#define C_WN 72
-#define C_WQ 73
-#define C_XIT 74
-#define C_YANK 75
-#define C_Z 76
-#define C_SUBTILDE 77
+#define C_UNDO 62
+#define C_UNABBREVIATE 63
+#define C_UNMAP 64
+#define C_V 65
+#define C_VERSION 66
+#define C_VISUAL_EX 67
+#define C_VISUAL_VI 68
+#define C_VIUSAGE 69
+#define C_WRITE 70
+#define C_WN 71
+#define C_WQ 72
+#define C_XIT 73
+#define C_YANK 74
+#define C_Z 75
+#define C_SUBTILDE 76
Index: include/ex_extern.h
===================================================================
RCS file: /cvs/src/usr.bin/vi/include/ex_extern.h,v
retrieving revision 1.10
diff -u -r1.10 ex_extern.h
--- include/ex_extern.h 3 May 2013 20:43:25 -0000       1.10
+++ include/ex_extern.h 14 Nov 2014 16:10:06 -0000
@@ -104,7 +104,6 @@
 void tag_msg(SCR *, tagmsg_t, char *);
 int ex_tagf_alloc(SCR *, char *);
 int ex_tag_free(SCR *);
-int ex_tcl(SCR*, EXCMD *);
 int ex_txt(SCR *, TEXTH *, ARG_CHAR_T, u_int32_t);
 int ex_undo(SCR *, EXCMD *);
 int ex_help(SCR *, EXCMD *);

Beware: manual cvs remove for ex/ex_tcl.c required.

Reply via email to