-/* $OpenBSD: main.c,v 1.39 2017/04/18 01:45:35 deraadt Exp $ */
+/* $OpenBSD: main.c,v 1.40 2017/07/03 07:01:14 bentley Exp $ */
/*-
* Copyright (c) 1992, 1993, 1994
SCR *sp;
size_t len;
u_int flags;
- int ch, flagchk, lflag, secure, startup, readonly, rval, silent;
+ int ch, flagchk, secure, startup, readonly, rval, silent;
char *tag_f, *wsizearg, path[256];
static const char *optstr[3] = {
/* Parse the arguments. */
flagchk = '\0';
tag_f = wsizearg = NULL;
- lflag = secure = silent = 0;
+ secure = silent = 0;
startup = 1;
/* Set the file snapshot flag. */
case 'F': /* No snapshot. */
F_CLR(gp, G_SNAPSHOT);
break;
- case 'l': /* Set lisp, showmatch options. */
- lflag = 1;
- break;
case 'R': /* Readonly. */
readonly = 1;
break;
goto err;
{ int oargs[5], *oargp = oargs;
- if (lflag) { /* Command-line options. */
- *oargp++ = O_LISP;
- *oargp++ = O_SHOWMATCH;
- }
- if (readonly)
+ if (readonly) /* Command-line options. */
*oargp++ = O_READONLY;
if (secure)
*oargp++ = O_SECURE;
-/* $OpenBSD: options.c,v 1.24 2017/06/30 14:42:05 bentley Exp $ */
+/* $OpenBSD: options.c,v 1.25 2017/07/03 07:01:14 bentley Exp $ */
/*-
* Copyright (c) 1991, 1993, 1994
{"leftright", f_reformat, OPT_0BOOL, 0},
/* O_LINES 4.4BSD */
{"lines", f_lines, OPT_NUM, OPT_NOSAVE},
-/* O_LISP 4BSD
- * XXX
- * When the lisp option is implemented, delete the OPT_NOSAVE flag,
- * so that :mkexrc dumps it.
- */
- {"lisp", f_lisp, OPT_0BOOL, OPT_NOSAVE},
/* O_LIST 4BSD */
{"list", f_reformat, OPT_0BOOL, 0},
/* O_LOCKFILES 4.4BSD
{"matchtime", NULL, OPT_NUM, 0},
/* O_MESG 4BSD */
{"mesg", NULL, OPT_1BOOL, 0},
-/* O_MODELINE 4BSD
- * !!!
- * This has been documented in historical systems as both "modeline"
- * and as "modelines". Regardless of the name, this option represents
- * a security problem of mammoth proportions, not to mention a stunning
- * example of what your intro CS professor referred to as the perils of
- * mixing code and data. Don't add it, or I will kill you.
- */
- {"modeline", NULL, OPT_0BOOL, OPT_NOSET},
/* O_NOPRINT 4.4BSD */
{"noprint", f_print, OPT_STR, OPT_EARLYSET},
/* O_NUMBER 4BSD */
{"octal", f_print, OPT_0BOOL, OPT_EARLYSET},
/* O_OPEN 4BSD */
{"open", NULL, OPT_1BOOL, 0},
-/* O_OPTIMIZE 4BSD */
- {"optimize", NULL, OPT_1BOOL, 0},
/* O_PARAGRAPHS 4BSD */
{"paragraphs", f_paragraph, OPT_STR, 0},
/* O_PATH 4.4BSD */
{"readonly", f_readonly, OPT_0BOOL, OPT_ALWAYS},
/* O_RECDIR 4.4BSD */
{"recdir", NULL, OPT_STR, 0},
-/* O_REDRAW 4BSD */
- {"redraw", NULL, OPT_0BOOL, 0},
/* O_REMAP 4BSD */
{"remap", NULL, OPT_1BOOL, 0},
/* O_REPORT 4BSD */
{"showmode", NULL, OPT_0BOOL, 0},
/* O_SIDESCROLL 4.4BSD */
{"sidescroll", NULL, OPT_NUM, OPT_NOZERO},
-/* O_SLOWOPEN 4BSD */
- {"slowopen", NULL, OPT_0BOOL, 0},
-/* O_SOURCEANY 4BSD (undocumented)
- * !!!
- * Historic vi, on startup, source'd $HOME/.exrc and ./.exrc, if they
- * were owned by the user. The sourceany option was an undocumented
- * feature of historic vi which permitted the startup source'ing of
- * .exrc files the user didn't own. This is an obvious security problem,
- * and we ignore the option.
- */
- {"sourceany", NULL, OPT_0BOOL, OPT_NOSET},
/* O_TABSTOP 4BSD */
{"tabstop", f_reformat, OPT_NUM, OPT_NOZERO},
/* O_TAGLENGTH 4BSD */
{"ht", O_HARDTABS}, /* 4BSD */
{"ic", O_IGNORECASE}, /* 4BSD */
{"li", O_LINES}, /* 4.4BSD */
- {"modelines", O_MODELINE}, /* HPUX */
{"nu", O_NUMBER}, /* 4BSD */
- {"opt", O_OPTIMIZE}, /* 4BSD */
{"para", O_PARAGRAPHS}, /* 4BSD */
- {"re", O_REDRAW}, /* O'Reilly */
{"ro", O_READONLY}, /* 4BSD (undocumented) */
{"scr", O_SCROLL}, /* 4BSD (undocumented) */
{"sect", O_SECTIONS}, /* O'Reilly */
{"sh", O_SHELL}, /* 4BSD */
- {"slow", O_SLOWOPEN}, /* 4BSD */
{"sm", O_SHOWMATCH}, /* 4BSD */
{"smd", O_SHOWMODE}, /* 4BSD */
{"sw", O_SHIFTWIDTH}, /* 4BSD */
break;
}
- /* Some options may not be set. */
- if (F_ISSET(op, OPT_NOSET) && !turnoff) {
- msgq_str(sp, M_ERR, name,
- "set: the %s option may never be turned on");
- rval = 1;
- break;
- }
-
if (equals) {
msgq_str(sp, M_ERR, name,
"set: [no]%s option doesn't take a value");
-/* $OpenBSD: options.h,v 1.8 2006/01/08 21:05:39 miod Exp $ */
+/* $OpenBSD: options.h,v 1.9 2017/07/03 07:01:14 bentley Exp $ */
/*-
* Copyright (c) 1991, 1993, 1994
#define OPT_ALWAYS 0x002 /* Always call the support function. */
#define OPT_NDISP 0x004 /* Never display the option. */
#define OPT_NOSAVE 0x008 /* Mkexrc command doesn't save. */
-#define OPT_NOSET 0x010 /* Option may not be set. */
#define OPT_NOUNSET 0x020 /* Option may not be unset. */
#define OPT_NOZERO 0x040 /* Option may not be set to 0. */
#define OPT_EARLYSET 0x080 /* Func called after value is set */
-/* $OpenBSD: options_f.c,v 1.11 2016/01/06 22:28:52 millert Exp $ */
+/* $OpenBSD: options_f.c,v 1.12 2017/07/03 07:01:14 bentley Exp $ */
/*-
* Copyright (c) 1993, 1994
return (0);
}
-/*
- * PUBLIC: int f_lisp(SCR *, OPTION *, char *, u_long *);
- */
-int
-f_lisp(SCR *sp, OPTION *op, char *str, u_long *valp)
-{
- msgq(sp, M_ERR, "The lisp option is not implemented");
- return (0);
-}
-
/*
* PUBLIC: int f_paragraph(SCR *, OPTION *, char *, u_long *);
*/
-.\" $OpenBSD: vi.1,v 1.69 2017/06/30 14:42:05 bentley Exp $
+.\" $OpenBSD: vi.1,v 1.70 2017/07/03 07:01:14 bentley Exp $
.\"
.\" Copyright (c) 1994
.\" The Regents of the University of California. All rights reserved.
.\"
.\" @(#)vi.1 8.51 (Berkeley) 10/10/96
.\"
-.Dd $Mdocdate: June 30 2017 $
+.Dd $Mdocdate: July 3 2017 $
.Dt VI 1
.Os
.Sh NAME
Don't copy the entire file when first starting to edit.
(The default is to make a copy in case someone else modifies
the file during your edit session.)
-.\" .It Fl l
-.\" Start editing with the lisp and showmatch options set.
.It Fl R
Start editing in read-only mode, as if the command name was
.Nm view ,
.Nm vi
only.
Set the number of lines in the screen.
-.It Cm lisp Bq off
-.Nm vi
-only.
-Modify various search commands and options to work with Lisp.
-This option is not yet implemented.
.It Cm list Bq off
Display lines in an unambiguous fashion.
.It Cm lock Bq on
option is set.
.It Cm mesg Bq on
Permit messages from other users.
-.It Cm modelines , modeline Bq off
-Read the first and last few lines of each file for
-.Nm ex
-commands.
-This option will never be implemented.
.It Cm noprint Bq \&"\&"
Characters that are never handled as printable characters.
.It Cm number, nu Bq off
and
.Cm visual
commands are disallowed.
-.It Cm optimize , opt Bq on
-.Nm vi
-only.
-Optimize text throughput to dumb terminals.
-This option is not yet implemented
.It Cm paragraphs , para Bq "IPLPPPQPP LIpplpipbpBlBdPpLpIt"
.Nm vi
only.
Mark the file and session as read-only.
.It Cm recdir Bq /tmp/vi.recover
The directory where recovery files are stored.
-.It Cm redraw , re Bq off
-.Nm vi
-only.
-Simulate an intelligent terminal on a dumb one.
-This option is not yet implemented.
.It Cm remap Bq on
Remap keys until resolved.
.It Cm report Bq 5
.Nm vi
only.
Set the amount a left-right scroll will shift.
-.It Cm slowopen , slow Bq off
-Delay display updating during text input.
-This option is not yet implemented.
-.It Cm sourceany Bq off
-Read startup files not owned by the current user.
-This option will never be implemented.
.It Cm tabstop , ts Bq 8
This option sets tab widths for the editor display.
.It Cm taglength , tl Bq 0
.Nm nex Ns / Ns Nm nvi
is close to
.St -p1003.1-2008 .
-That document differs from historical
-.Nm ex Ns / Ns Nm vi
-practice in several places; there are changes to be made on both sides.
+It deviates in the following respects:
+.Bl -bullet
+.It
+The
+.Ic s
+.Nm ex
+command may not be called as
+.Ic substitute .
+.It
+The
+.Ic directory , redraw
+and
+.Ic slowopen
+settings are not implemented.
+.It
+The
+.Ic paragraphs
+and
+.Ic sections
+settings default to values useful for editing
+.Xr mdoc 7
+manuals.
+.It
+The
+.Ev TMPDIR
+environment variable is ignored.
+.It
+In insert mode, entering
+.Ic Aq control-H ,
+.Ic Aq erase ,
+or
+.Ic Aq kill
+following a backslash will not embed the control character in the text.
+.El
.Sh HISTORY
The
.Nm ex
-/* $OpenBSD: com_extern.h,v 1.14 2016/05/27 09:18:12 martijn Exp $ */
+/* $OpenBSD: com_extern.h,v 1.15 2017/07/03 07:01:14 bentley Exp $ */
int cut(SCR *, CHAR_T *, MARK *, MARK *, int);
int cut_line(SCR *, recno_t, size_t, size_t, CB *);
int f_altwerase(SCR *, OPTION *, char *, u_long *);
int f_columns(SCR *, OPTION *, char *, u_long *);
int f_lines(SCR *, OPTION *, char *, u_long *);
-int f_lisp(SCR *, OPTION *, char *, u_long *);
int f_paragraph(SCR *, OPTION *, char *, u_long *);
int f_print(SCR *, OPTION *, char *, u_long *);
int f_readonly(SCR *, OPTION *, char *, u_long *);
-/* $OpenBSD: options_def.h,v 1.7 2016/08/01 18:27:35 bentley Exp $ */
+/* $OpenBSD: options_def.h,v 1.8 2017/07/03 07:01:14 bentley Exp $ */
enum {
O_ALTWERASE = 0,
O_KEYTIME,
O_LEFTRIGHT,
O_LINES,
- O_LISP,
O_LIST,
O_LOCKFILES,
O_MAGIC,
O_MATCHTIME,
O_MESG,
- O_MODELINE,
O_NOPRINT,
O_NUMBER,
O_OCTAL,
O_OPEN,
- O_OPTIMIZE,
O_PARAGRAPHS,
O_PATH,
O_PRINT,
O_PROMPT,
O_READONLY,
O_RECDIR,
- O_REDRAW,
O_REMAP,
O_REPORT,
O_RULER,
O_SHOWMATCH,
O_SHOWMODE,
O_SIDESCROLL,
- O_SLOWOPEN,
- O_SOURCEANY,
O_TABSTOP,
O_TAGLENGTH,
O_TAGS,