Skip to content

Commit

Permalink
Release 160706
Browse files Browse the repository at this point in the history
  • Loading branch information
n-t-roff committed Jul 6, 2016
1 parent c390653 commit 1b5ef36
Show file tree
Hide file tree
Showing 11 changed files with 84 additions and 14 deletions.
2 changes: 1 addition & 1 deletion Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ DBG_CFLAGS=-DDEBUG \
-fsanitize=undefined \
-fsanitize=integer \
-fsanitize=address
_CFLAGS=-DUNIMP -Wall -Wextra -DSHAREDIR='"$(SHAREDIR)"' \
_CFLAGS=-DUNIMP -Wall -Wextra -DSHAREDIR='"$(SHAREDIR)"' $(DEFS) \
#$(DBG_CFLAGS)
_LDFLAGS=-s
OBJ= ex.o ex_cmds.o exd.o ex_put.o ex_print.o exv.o ex_vmain.o exs.o \
Expand Down
27 changes: 27 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,11 @@ append mode.
With the added text, command `vi` will work.
Note that ex-1.1 places the cursor at the last line of the file.
Use `1G` or `-` or `k` to move upwards.
Alternatively use `1vi` as first command to open visual at first line.
After any command ex-1.1 stays in ex mode.
`vi` will put the current line to top of the window.
Use command `vi.` instead to open visual with the current line
centered in the window.
The most significant differences for visual mode are:
* **Don't use unescaped `@` in input mode, type `\@` instead.**
`@` in input mode deletes the current line.
Expand All @@ -70,6 +75,16 @@ The most significant differences for visual mode are:
This is intended and not a bug.
(You may ignore these lines or type `^Z` to remove them.)
* Use `Y` instead of `yy`.
* Note that it is not possible to delete a range of lines
with `:`*startline*`,`*endline*`d` and then insert these
lines with `p` or `P`.
On change between ex and visual mode the yank buffer
information it lost.
So even `:`*line*`put` can't be used.
The combination `delete`/`put` does only work if ex
mode is not left.
Alternatively use *n*`\\` to delete and `p`/`P` to
insert.
* In input mode use `^H` instead of <BACKSPACE>
* Use `` :e` `` instead of `:e#` to address the alternate
file name.
Expand All @@ -80,6 +95,18 @@ The most significant differences for visual mode are:
* `/`, `?` and `n` search only for the first occurrence
of a pattern in a line.
* Use `K`*letter* instead of `m`*letter* to set marks.
* Control characters are printed as `?` and it is not
possible to insert them preceded with `^V`.
Use at least
[vi version 2.2](https://github.com/n-t-roff/ex-2.2)
to edit control characters in files.
(Existing control characters are left unchanged by
vi 1.1.)
* In rare cases some word characters are displayed as
spaces.
This is a visual effect and not a data issue.
Going to ex mode with `q` and returning to vi mode
fixes this.
* The code is compiled for editing files with at most
16384 lines and 256 KB temp file size.

Expand Down
2 changes: 1 addition & 1 deletion Version.c
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
char version[] = "Version 1.1, February 1, 1978"
" (1BSD) git "
"160704 16:07";
"160706 21:24";
50 changes: 43 additions & 7 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,36 @@ all:
EOT
bmake -f $TMPMK >> $LOG 2>&1
test_result && MAKE=bmake
}
check_major_minor () {
check_for "major(3), minor(3)"

cat <<EOT >$TMPC
#include <sys/types.h>
int
main() {
(void)major(0);
(void)minor(0);
return 0;
}
EOT
compile
test_result && return

check_for "major(3), minor(3) using <sys/mkdev.h>"

cat <<EOT >$TMPC
#include <sys/types.h>
#include <sys/mkdev.h>
int
main() {
(void)major(0);
(void)minor(0);
return 0;
}
EOT
compile
test_result && DEFS="$DEFS -DUSE_SYS_MKDEV_H"
}
[ ! -s compat.h ] && rm compat.h
OUTMK=Makefile
Expand All @@ -126,20 +156,20 @@ rm -f $LOG
gen_mk

check_make
check_major_minor

TermTest () {
check_for "$1"
check_for "$1 $2"
Term="$1"
echo "TERMLIB=$1" > $OUTMK
echo "TERMLIB=$1" > $OUTMK
echo "DEFS=$2" >> $OUTMK
gen_mk 1
cat <<EOT >>$OUTMK
$TMPNAM: ${TMPNAM}.o
\$(CC) \$(_CFLAGS) -o \$@ ${TMPNAM}.o \$(TERMLIB)
EOT
cat <<EOT >>$TMPC
int tgetent(char *bp, const char *name);
#include "ex.h"
#include "ex_tty.h"
int main() {
char tcbuf[1024];
char *terms[] = { "xterm", "screen" };
Expand All @@ -161,13 +191,19 @@ EOT
}

TestLocalTermlib () {
TermTest "-ltinfo" && return
TermTest "-lcurses" && return
TermTest "-lncurses" && return
D="-I/usr/pkg/include -L/usr/pkg/lib -Wl,-rpath,/usr/pkg/lib"
TermTest "-lncurses" "$D" && {
DEFS="$DEFS $D"
return
}
TermTest "-lcurses" && return
TermTest "-ltinfo" && return
}

TestLocalTermlib

echo "TERMLIB=$Term" > $OUTMK
echo "TERMLIB=$Term" > $OUTMK
echo "DEFS=$DEFS" >> $OUTMK
gen_mk 1
rm -f $TMPNAM*
4 changes: 2 additions & 2 deletions ex_addr.c
Original file line number Diff line number Diff line change
Expand Up @@ -265,14 +265,14 @@ scanfor(int c)
if (c == '/') {
addr++;
if (addr > dol) {
if (value(WRAP) == 0)
if (value(EX_WRAP) == 0)
error("No match to BOTTOM|Address search hit BOTTOM without matching pattern");
addr = zero;
}
} else {
addr--;
if (addr < zero) {
if (value(WRAP) == 0)
if (value(EX_WRAP) == 0)
error("No match to TOP|Address search hit TOP without matching pattern");
addr = dol;
}
Expand Down
2 changes: 1 addition & 1 deletion ex_shift.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ void
shift(int c, int cnt)
{
register int *addr;
register char *cp;
char *cp = genbuf;
char *dp;
register int i;

Expand Down
2 changes: 1 addition & 1 deletion ex_vars.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,4 @@ extern struct varbl varbls[];
#define TERSE 26
#define VISUALMESSAGE 27
#define WINDOW 28
#define WRAP 29
#define EX_WRAP 29
2 changes: 1 addition & 1 deletion ex_vcolumn.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ column(char *cp)
int
qcolumn(char *lim, char *gp)
{
register int x;
int x = 0;
void (*OO)();

OO = Outchar;
Expand Down
1 change: 1 addition & 0 deletions ex_voperate.c
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,7 @@ word(void (*op)(), int cnt)
while (!margin() && wordof(which, wcursor))
wcursor--;
}
which = wordch(wcursor); /* reported by OI compiler */
if (margin() || !wordof(which, wcursor))
wcursor++;
}
Expand Down
3 changes: 3 additions & 0 deletions exr.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
#include <errno.h>
#include <sys/types.h>
#ifdef USE_SYS_MKDEV_H
# include <sys/mkdev.h>
#endif
#include <unistd.h>
#include <sys/stat.h>
#include <fcntl.h>
Expand Down
3 changes: 3 additions & 0 deletions exw.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
#include <sys/types.h>
#ifdef USE_SYS_MKDEV_H
# include <sys/mkdev.h>
#endif
#include <sys/stat.h>
#include <unistd.h>
#include <fcntl.h>
Expand Down

0 comments on commit 1b5ef36

Please sign in to comment.