/gosling-emacs

Gosling emacs from early 1980s

Primary LanguageOCaml

This is retrieved from https://github.com/larsbrinkhoff/emacs-history/blob/sources/reid.org/%7Ebrian/misc/gosling-emacs-1999.tar
which is untarred and imported here.  I wanted to archive here simply because it is the first big chunk of C code I read and
I learned a lot from reading the code in the early 1980s.  By then James Gosling had sold rights to Unipress and the
company I worked for used to have source code license.  We studied it extensively and made our own version of the editor
at the time.

James Gosling's emacs was there to be useful to Unix users before GNU emacs was available on Unix machines.  GNU didn't exist back then.
Although my first emacs was TECO based emacs on TOPS-20 on DEC-10 machines, the Gosling emacs was faithful enough and had
enough enhancements to make it very useful.  The "mock Lisp" was derided by many who were used to MacLisp at the time, but
it was the first editor I encountered that had Lisp like language as basis for many features and customizations at the time.
GNU emacs was the second.

My favorite source code here is display.c.  Infamous for its ASCII skull rendering at the beginning, it is also basis of
a lot of very old controversy and disputes between James Gosling and Richard Stallman, as to the alleged theft of the display update algorithm.

Here is the beginning of the display.c:

		         /-------------\
			/		\
		       /		 \
		      /			  \
		      |	  XXXX	   XXXX	  |
		      |	  XXXX	   XXXX	  |
		      |	  XXX	    XXX	  |
		      \		X	  /
		       --\     XXX     /--
			| |    XXX    | |
			| |	      | |
			| I I I I I I I |
			|  I I I I I I	|
			 \	       /
			  --	     --
			    \-------/
		    XXX			   XXX
		   XXXXX		  XXXXX
		   XXXXXXXXX	     XXXXXXXXXX
			  XXXXX	  XXXXX
			     XXXXXXX
			  XXXXX	  XXXXX
		   XXXXXXXXX	     XXXXXXXXXX
		   XXXXX		  XXXXX
		    XXX			   XXX
			  **************
			  *  BEWARE!!  *
			  **************
			All ye who enter here:
		    Most of the code in this module
		       is twisted beyond belief!
			   Tread carefully.
		    If you think you understand it,
			      You Don't,
			    So Look Again.


The following is the original README
=========

This is Gosling Emacs, version 84S, locally modified at decwrl.

THE OFFICIAL SOURCES FOR EMACS ARE KEPT ON acetes:/usr/src/local/emacs under
RCS control. If you modify the sources on acetes, you are are NOT done until
you update mopar, generate a new version of emacs and test it on a Titan!
The Makefile for the Titan version is kept on circe. See below.

***********

The Titan and Vax versions of emacs have been merged as of 6 May 1986. If you
wish to construct a new version of the Titan emacs, you must generate the
program on mopar:/tunix/src/local/emacs.  The Makefile on the *tunix*
subdirectory is different; the rest consists of symbolic links to
mopar:/usr/src/local/emacs. YOU MUST MANUALLY UPDATE
mopar:/usr/src/local/emacs from acetes after making changes. Eg., "rdist -c
*.c mopar:/usr/src/local/emacs".

The Vax version of emacs uses the ibis libraries.

The InsertLines and DeleteLines (note PLURAL) code has been ifdef'd
OUT of the TrmVS100.c driver because it did not work on the Vax or the Titan.

Some comments about the Titan version:
  1) unexec does not work -- the Titan version of unix is different
  and I have not fixed unexec.

  2) There are numerous problems I fixed in emacs for the Titan. If
  you decide to add features to emacs here are a few things that
  might bite you when you try to get it to run on the Titan:

    a) Malloc returns a byte pointer and you must coerce its
    results into a word pointer as required:
        p = (struct foo *) malloc(sizeof(foo));

    b) Realloc's parameter must be coerced back into a byte pointer
    as required:
        p = (struct foo *) realloc( (char *)p, sizeof(foo)*2);

    c) Polymorphic routines (initialization routines especially)
    cause problems if you coerce pointer types to match the
    parameter declaration. Consider macros.DefMac:
        DefMac (s, bodyparm, IsMlisp)
	char *s, *bodyparm;
    Now in emacs.c there is initialization code that calls DefMac
    with bodyparm=word pointer. For example:
        DefMac ("ESC-prefix", &ESCmap, -2);
    Your natural thought mmight be to write
        DefMac ("ESC-prefix", (char *)&ESCmap, -2);
    unfortunately this is a bug. The third parameter declares the
    type of the bodyparm. By coercing &ESCmap into a char * you'll
    cause the wrong value to be stored into body.b_bound.b_keymap.
    Don't use type casts here!

    d) Cast the data for ioctl's into word pointers:
        ioctl(fd, ioctl, (waddr_t)&tlbytes );

  3) Hey, hey, let's be careful out there.

Gene McDaniel
6 May 86

**********
EMACS sources are kept on ACETES. DO NOT MODIFY ANY source files without
checking them out from acetes -- the emacs sources are kept under
RCS control
Gene McDaniel
16 Apr 86