diff --git a/Makefile b/Makefile index 125ec2d..030221d 100644 --- a/Makefile +++ b/Makefile @@ -77,7 +77,7 @@ INC_FILES = $(wildcard include/*.h) \ $(wildcard include/smallc/*.h) \ $(wildcard include/smallc/sys/*.h) \ $(wildcard include/arpa/*.h) -SHARE_FILES = share/re.help share/example/Makefile \ +SHARE_FILES = share/re.help share/emg.keys share/example/Makefile \ share/example/ashello.S share/example/chello.c \ share/example/blkjack.bas share/example/hilow.bas \ share/example/stars.bas share/example/prime.scm \ @@ -179,6 +179,7 @@ cleanall: clean rm -f games/lib/adventure.dat rm -f games/lib/cfscores rm -f share/re.help + rm -f share/emg.keys rm -f share/misc/more.help rm -f etc/termcap etc/remote etc/phones rm -rf share/unixbench diff --git a/src/cmd/emg/ChangeLog b/src/cmd/emg/ChangeLog index 9c41af6..c5d10c8 100644 --- a/src/cmd/emg/ChangeLog +++ b/src/cmd/emg/ChangeLog @@ -1,6 +1,11 @@ ChangeLog ========= +May 29, 2014 : emg 1.6 +---------------------- +emg is now part of the RetroBSD tree. +Add PgUp and PgDn scrolling. + March 16, 2014 : emg 1.5 ------------------------ Add line number to the mode line. diff --git a/src/cmd/emg/README b/src/cmd/emg/README index 1bde8f3..b6e1015 100644 --- a/src/cmd/emg/README +++ b/src/cmd/emg/README @@ -34,11 +34,8 @@ appreciate the history of this software. As both Ersatz Emacs and Mg are Public Domain, emg is also Public Domain. Versions of emg up to and including 1.2 also supported OpenBSD; OpenBSD -has since dropped the older headers, such as sgtty.h and it is not worth -reimplementing these for OpenBSD, since OpenBSD maintains Mg. +has since dropped the older headers, such as sgtty.h, and it is not worth +reimplementing these for OpenBSD since OpenBSD maintains Mg. -Tarballs can be found here: -http://devio.us/~bcallah/emg/ - -Github repo, for patches: -https://github.com/ibara/emg +==================================== +Brian Callahan diff --git a/src/cmd/emg/basic.c b/src/cmd/emg/basic.c index ca7d30f..75290ea 100644 --- a/src/cmd/emg/basic.c +++ b/src/cmd/emg/basic.c @@ -21,6 +21,8 @@ int forwchar(int f, int n); int backchar(int f, int n); int forwline(int f, int n); int backline(int f, int n); +int pagedown(int f, int n); +int pageup(int f, int n); /* * This routine, given a pointer to a LINE, and the current cursor goal @@ -252,6 +254,28 @@ int backline(int f, int n) return (TRUE); } +/* + * PgDn. Scroll down (FORCE_ROWS - 1). + * Just forwline(f, (FORCE_ROWS -1)) + * Bound to C-V + */ +int pagedown(int f, int n) +{ + forwline(f, (FORCE_ROWS - 1)); + return (TRUE); +} + +/* + * PgUp. Scroll up (FORCE_ROWS - 1). + * Just backline(f, (FORCE_ROWS -1)) + * Bound to M-V + */ +int pageup(int f, int n) +{ + backline(f, (FORCE_ROWS - 1)); + return (TRUE); +} + /* * Set the mark in the current window to the value of "." in the window. No * errors are possible. Bound to "M-.". diff --git a/src/cmd/emg/display.c b/src/cmd/emg/display.c index 721425d..ffc9979 100644 --- a/src/cmd/emg/display.c +++ b/src/cmd/emg/display.c @@ -647,7 +647,7 @@ void modeline(WINDOW *wp) n = 2; /* This is the version string. Do not forget to * increment when releasing a new version. */ - n += vtputs(" emg 1.5 "); + n += vtputs(" emg 1.6 "); vtputc(lchar); vtputc(lchar); @@ -676,7 +676,7 @@ void modeline(WINDOW *wp) } len = snprintf(sl, sizeof(sl), " %d%% (%d,%d) ", - ((wp->w_dotline +1) / bp->b_lines), + ((100*(wp->w_dotline)) / bp->b_lines), (wp->w_dotline + 1), getccol(FALSE)); if (len < sizeof(sl) && len != -1) n += vtputs(sl); diff --git a/src/cmd/emg/ebind.h b/src/cmd/emg/ebind.h index a047139..35836dd 100644 --- a/src/cmd/emg/ebind.h +++ b/src/cmd/emg/ebind.h @@ -26,6 +26,7 @@ KEYTAB keytab[] = { {CTRL | 'R', backsearch}, {CTRL | 'S', forwsearch}, {CTRL | 'T', twiddle}, + {CTRL | 'V', pagedown}, {CTRL | 'W', killregion}, {CTRL | 'Y', yank}, {CTLX | '(', ctlxlp}, @@ -63,6 +64,7 @@ KEYTAB keytab[] = { {META | 'R', sreplace}, {META | 'S', forwsearch}, /* non-standard */ {META | 'U', upperword}, + {META | 'V', pageup}, {META | 'W', copyregion}, {META | 'Z', quickexit}, {META | 0x7F, delbword}, diff --git a/src/cmd/emg/efunc.h b/src/cmd/emg/efunc.h index 0531b3c..00bf3ff 100644 --- a/src/cmd/emg/efunc.h +++ b/src/cmd/emg/efunc.h @@ -23,6 +23,8 @@ extern int gotoeol(); /* Move to end of line */ extern int backchar(); /* Move backward by characters */ extern int forwline(); /* Move forward by lines */ extern int backline(); /* Move backward by lines */ +extern int pagedown(); /* PgDn */ +extern int pageup(); /* PgUp */ extern int gotobob(); /* Move to start of buffer */ extern int gotoeob(); /* Move to end of buffer */ extern int setfillcol(); /* Set fill column */ diff --git a/src/cmd/emg/emg.keys b/src/cmd/emg/emg.keys index 6677f1b..9ab44fd 100644 --- a/src/cmd/emg/emg.keys +++ b/src/cmd/emg/emg.keys @@ -1,4 +1,4 @@ - emg keybindings (March 16, 2014) + emg keybindings (May 29, 2014) Based on Ersatz Emacs (2000/09/14) M- means to use the key prior to using another key @@ -13,6 +13,7 @@ M- means to use the key prior to using another key ^P Previous line M-N End of paragraph ^A Front of line M-< or [HOME] Start of file ^E End of line M-> or [END] End of file +^V or [PgDn] Scroll down M-V or [PgUp] Scroll up M-G Go to line Arrow keys are active ------------------------------------------------------------------------------ diff --git a/src/cmd/emg/main.c b/src/cmd/emg/main.c index 880c410..fd48cf1 100644 --- a/src/cmd/emg/main.c +++ b/src/cmd/emg/main.c @@ -458,6 +458,10 @@ int extendedcmd(int f, int n) case 'D': cmd = backchar; break; case 'H': cmd = gotobob; break; case 'W': cmd = gotoeob; break; + case '5': cmd = pageup; getctl(); break; + case '6': cmd = pagedown; getctl(); break; + case '7': cmd = gotobob; getctl(); break; + case '8': cmd = gotoeob; getctl(); break; default: mlwrite("\007[Key not bound]"); return (FALSE); } diff --git a/src/cmd/smux/Makefile b/src/cmd/smux/Makefile index 24ba798..1adc829 100644 --- a/src/cmd/smux/Makefile +++ b/src/cmd/smux/Makefile @@ -1,10 +1,10 @@ all: - make -C retro - make -C linux + ${MAKE} -C retro + ${MAKE} -C linux install: - make -C retro install + ${MAKE} -C retro install clean: - make -C retro clean - make -C linux clean + ${MAKE} -C retro clean + ${MAKE} -C linux clean diff --git a/src/cmd/tip/Makefile b/src/cmd/tip/Makefile index bbccde6..ff6cde3 100644 --- a/src/cmd/tip/Makefile +++ b/src/cmd/tip/Makefile @@ -68,18 +68,18 @@ acutab.o: acutab.c log.o remote.o: Makefile aculib: FRC - cd aculib; make ${MFLAGS} + cd aculib; ${MAKE} ${MFLAGS} clean: FRC rm -f ${OBJS} core tip tip.elf tip.dis - cd aculib; make ${MFLAGS} clean + cd aculib; ${MAKE} ${MFLAGS} clean depend: FRC mkdep ${CFLAGS} ${SRCS} - cd aculib; make ${MFLAGS} depend + cd aculib; ${MAKE} ${MFLAGS} depend install: aculib tip - cd aculib; make ${MFLAGS} install + cd aculib; ${MAKE} ${MFLAGS} install cp tip ${DESTDIR}/bin/tip rm -f ${DESTDIR}/bin/cu touch ${DESTDIR}/${ADM}/aculog diff --git a/src/cmd/uucp/Makefile b/src/cmd/uucp/Makefile index 3923691..fde7bb8 100644 --- a/src/cmd/uucp/Makefile +++ b/src/cmd/uucp/Makefile @@ -44,7 +44,7 @@ SUBDIRS=C. D.${HOSTNAME}X D.${HOSTNAME} D. X. TM. all: libacu $(ALL) libacu: - cd aculib && make + cd aculib && ${MAKE} uuencode: uuencode.o @@ -136,7 +136,7 @@ install: uuencode uuencode clean: rm -f *.o $(ALL) libuucp.a *.dis *.elf - cd aculib; make ${MFLAGS} clean + cd aculib; ${MAKE} ${MFLAGS} clean depend: mkdep ${CFLAGS} *.c diff --git a/src/games/Makefile b/src/games/Makefile index e20f0dc..62d2ae2 100644 --- a/src/games/Makefile +++ b/src/games/Makefile @@ -42,7 +42,7 @@ FRC: install: $(STD) $(NSTD) -for i in $(SUBDIR); do \ - make -C $$i $(MFLAGS) DESTDIR=$(DESTDIR) install; done + ${MAKE} -C $$i $(MFLAGS) DESTDIR=$(DESTDIR) install; done -for i in $(STD) $(NSTD); do \ install $$i $(DESTDIR)/games/$$i; done -for i in *.6; do \ @@ -52,7 +52,7 @@ install: $(STD) $(NSTD) clean: rm -f a.out core *.s *.o *.dis *.elf $(STD) $(NSTD) - -for i in $(SUBDIR); do make -C $$i $(MFLAGS) clean; done + -for i in $(SUBDIR); do ${MAKE} -C $$i $(MFLAGS) clean; done # Files listed in $(NSTD) have explicit make lines given below. diff --git a/src/libc/Makefile b/src/libc/Makefile index 3d0c081..44cf99f 100644 --- a/src/libc/Makefile +++ b/src/libc/Makefile @@ -40,7 +40,7 @@ all: ../libc.a rm -rf tmp ${ALL}: FRC - cd $@; make ${MFLAGS} DEFS="${DEFS}" + cd $@; ${MAKE} ${MFLAGS} DEFS="${DEFS}" FRC: @@ -51,9 +51,9 @@ install: ../libc.a clean: for i in ${ALL}; \ - do (cd $$i; make ${MFLAGS} clean); done + do (cd $$i; ${MAKE} ${MFLAGS} clean); done rm -rf tmp *.a *~ depend: for i in ${ALL}; \ - do (cd $$i; make ${MFLAGS} DEFS="${DEFS}" depend); done + do (cd $$i; ${MAKE} ${MFLAGS} DEFS="${DEFS}" depend); done diff --git a/src/libc/mips/Makefile b/src/libc/mips/Makefile index 87fb931..a62fcda 100644 --- a/src/libc/mips/Makefile +++ b/src/libc/mips/Makefile @@ -17,19 +17,19 @@ mips.a: ${ALL} rm -rf tmp ${ALL}: FRC - cd $@; make ${MFLAGS} DEFS=${DEFS} + cd $@; ${MAKE} ${MFLAGS} DEFS=${DEFS} FRC: tags: for i in ${ALL}; do \ - (cd $$i; make ${MFLAGS} TAGSFILE=../${TAGSFILE} tags); \ + (cd $$i; ${MAKE} ${MFLAGS} TAGSFILE=../${TAGSFILE} tags); \ done clean: - for i in ${ALL}; do (cd $$i; make ${MFLAGS} clean); done + for i in ${ALL}; do (cd $$i; ${MAKE} ${MFLAGS} clean); done rm -rf *.a tmp *~ depend: for i in ${ALL}; do \ - (cd $$i; make ${MFLAGS} DEFS=${DEFS} depend); done + (cd $$i; ${MAKE} ${MFLAGS} DEFS=${DEFS} depend); done diff --git a/src/libtermlib/Makefile b/src/libtermlib/Makefile index 386f77b..5614e26 100644 --- a/src/libtermlib/Makefile +++ b/src/libtermlib/Makefile @@ -26,7 +26,7 @@ all: ../libtermcap.a termcap .PHONY: termcap termcap: - cd termcap && make + cd termcap && ${MAKE} ../libtermcap.a: ${OBJS} $(AR) cr ../libtermcap.a ${OBJS} diff --git a/src/share/Makefile b/src/share/Makefile index bd0a113..34ce823 100644 --- a/src/share/Makefile +++ b/src/share/Makefile @@ -11,14 +11,14 @@ SUBDIR = misc all: ${SUBDIR} ${SUBDIR}: FRC - cd $@; make ${MFLAGS} + cd $@; ${MAKE} ${MFLAGS} FRC: install: FRC -for i in ${SUBDIR}; do \ - (cd $$i; make ${MFLAGS} DESTDIR=${DESTDIR} install); done + (cd $$i; ${MAKE} ${MFLAGS} DESTDIR=${DESTDIR} install); done clean: rm -f *~ - for i in ${SUBDIR}; do (cd $$i; make ${MFLAGS} clean); done + for i in ${SUBDIR}; do (cd $$i; ${MAKE} ${MFLAGS} clean); done diff --git a/sys/pic32/Makefile b/sys/pic32/Makefile index 193371e..e82501f 100644 --- a/sys/pic32/Makefile +++ b/sys/pic32/Makefile @@ -10,12 +10,12 @@ SUBDIR = baremetal dip duinomite duinomite-uart duinomite-e \ default: all: - -for i in $(SUBDIR); do make -C $$i all; done + -for i in $(SUBDIR); do ${MAKE} -C $$i all; done install: clean: - -for i in $(SUBDIR); do make -C $$i clean; done + -for i in $(SUBDIR); do ${MAKE} -C $$i clean; done find .. -name \*~ | xargs rm -f reconfig: