Annotation of researchv9/cmd/emacs/README, revision 1.1

1.1     ! root        1: This file describes the standard distribution for the emacs editor. 
        !             2: The file contains instructions for compiling, a list of associated
        !             3: software and files, and additional information for people with
        !             4: special problems, like porting to odd machine types or using odd
        !             5: operating systems.
        !             6: 
        !             7: Anyone who is trying to maintain a copy of EMACS should send his
        !             8: name, address, machine name, and login name to me:
        !             9: 
        !            10: Warren Montgomery
        !            11: IH 6C-501
        !            12: 
        !            13: (ihesa!warren or ihnss!warren)
        !            14: 
        !            15: I will try to distribute news of interest about new versions or
        !            16: features to anyone who is maintaining a copy
        !            17: 
        !            18: COMPILATION AND INSTALLATION:
        !            19: 
        !            20: The first step is to move all of the files into the directory that
        !            21: you intend to keep the source in.  Do this now if you haven't.
        !            22: 
        !            23: The first line of the makefile describes any installation dependent
        !            24: parameters needed to compile emacs.  You will need to set the type
        !            25: of system that you are compiling for now.   You may want to set
        !            26: other parameter as well, as described later in the text, but you
        !            27: should be able to compile with just this option set.
        !            28: 
        !            29: -Dux3: Set this option if you are compiling for any AT&T Unix
        !            30:        system released after 1980.  (USG 3.0 or greater, system
        !            31:        III or greater, or version 7).  If you have an older version
        !            32:        (version 6, PWB unix, USG 2.0 or 1.2), omit this option.
        !            33:        
        !            34: -Dbsd: Set this when compiling for Berkeley unix (4.X bsd). 
        !            35:        Depending on which version you compile for, you may get an
        !            36:        error in not being able to find one of the include files. 
        !            37:        If you do, just change the pathname of the include file to
        !            38:        wherever it lives on your system and recompile.  -Dbsd
        !            39:        should set it up for any Berkeley system of recent release).
        !            40:        
        !            41:        As distributed, emacs assumes 4.2BSD, with the select and
        !            42:        cbreak mechanisms appropriate to 4.2.  If your system does
        !            43:        not have these, change the defines near the front of
        !            44:        emacs_io.c that set up SELECT, FLIM,  and CBRAKE.
        !            45: 
        !            46:        The primary effect of these two options is to specify what kind of
        !            47:        terminal I/O control mechanism to use.  If it is not set
        !            48:        correctly, emacs may not respond immediately to typed
        !            49:        characters (it may wait for 16 characters to be typed before
        !            50:        responding).
        !            51:        
        !            52: -Du370 and -Duts:  If you are compiling for unix/370 or amdahl uts,
        !            53:        set one of these, which affect the terminal initialization
        !            54:        code and some buffer size limits.
        !            55: 
        !            56: -DTERMCAP or -DTERMINFO:  If you have a termcap or terminfo system
        !            57:        installed, emacs can be compiled to use it.  You must add
        !            58:        the appropriate library to the makefile entry for "xemacs"
        !            59:        before compiling.  If neither of these options are set,
        !            60:        emacs will compile for it's own terminal support.
        !            61:        
        !            62: -DPORTEXT:  Set this flag when compiling with a compiler that does
        !            63:        not allocate external variables in the order in which they
        !            64:        are designed.  This flag is set automatically when compiling
        !            65:        for uts or unix/370, but may need to be set manually if
        !            66:        needed on other machines
        !            67:        
        !            68: To make a copy of emacs, just type make.  The makefile will make
        !            69: emacs, putting the result in a file called xemacs.   EMACS requires
        !            70: several files while running for its error messages, help
        !            71: explanations, and statistics.  These are kept in a directory known
        !            72: as the emacs library.  By default, this is the
        !            73: directory in which emacs was made.  You should make xemacs at least
        !            74: once this way to test it.  After you are satisfied with it, you can
        !            75: cause the new versions of emacs, dired, and ecomp to be installed by
        !            76: editing the makefile.  Change the definitions of BINDIR and LIBDIR
        !            77: to specify where you want the executable files to be put and where
        !            78: you  want the emacs library files to be put and type "make install".
        !            79: This will cause some of the files to be recompiled in order to
        !            80: accommodate the change in the library location, and will cause all of
        !            81: the resulting objects to be moved to BINDIR and the support files
        !            82: installed in LIBDIR.  The pathname of LIBDIR is kept in the file
        !            83: "terminals.x".
        !            84: 
        !            85: TROUBLESHOOTING:
        !            86: 
        !            87: If emacs won't make or doesn't behave as you think it should, there
        !            88: is a primitive "expert system" that diagnoses common problems
        !            89: included in this distribution.  This system will ask you questions
        !            90: about your installation of emacs and give suggestions on what you
        !            91: can do to correct the problem.  To use it, first make "hyde"
        !            92: (HYpothesis Driven Expert).  (If the make file won't run, just run
        !            93: cc -o hyde hyde.c.)  Once you have hyde built, you use it by
        !            94: invoking "hyde kbase".  Hyde will ask questions about your
        !            95: installation.  In general, it will present a series of statements,
        !            96: each with numbers, and you respond by indicating all of the numbers
        !            97: that apply to your situation.
        !            98: 
        !            99: Hyde is a crude tool, capable only of diagnosing the common problems
        !           100: that I have anticipated (or debugged for others) and put in it's
        !           101: knowledge base.  It may, however, save  a lot of time in pointing up
        !           102: things that you may have overlooked.
        !           103: 
        !           104: OTHER FILES AND UTILITIES:
        !           105: 
        !           106: EMACS can keep statistics on how it is being used and write these to a
        !           107: file called s<version> (where <version> is the version number) in
        !           108: the emacs library.  If you want statistics, create such a file (such
        !           109: as s4.7) in the emacs library give read and write access to
        !           110: everybody.  EMACS will produce one line of numbers for each
        !           111: invocation, which can be processed with stat_proc.
        !           112: 
        !           113: In addition to building xemacs, the makefile will build "ecomp"
        !           114: which is the emacs macro compiler.  It can be used to compile EML
        !           115: programs into macros for emacs, and should be placed wherever you put
        !           116: the emacs binary.  Ecomp depends on the file "emacs_defs" to define
        !           117: the macro language.  This file should be kept in the emacs library.
        !           118: (All of this is done automatically by making "install")
        !           119: 
        !           120: The utility programs stat_proc.c and see_it.c have been sent along
        !           121: with the EMACS sources.  Both simply require compilation.  stat_proc
        !           122: processes the statistics file.  Invoked with the name of the file to
        !           123: crunch, it produces a summary, and a list of users and the number of
        !           124: times each invoked EMACS.  Invoked with a user name as the second
        !           125: parameter, statistics for that user alone are given.  If a - is
        !           126: given as the second parameter, one summary is produced for each user.
        !           127: 
        !           128: see_it works like cat, but translates non-ascii and control
        !           129: characters into multi-character sequences, like EMACS.  Thus the
        !           130: character 201(octal) in the input would produce M-^A in the output. 
        !           131: Normally, all control characters except newline are translated.  If
        !           132: the -t option is given, tabs will also pass untranslated.
        !           133: 
        !           134: Emacs_vt.c is a collection of screen manipulation routines based on
        !           135: emacs.  The makefile entry for emacs_vt.o will compile it, and the
        !           136: mm source file emacs_vt.mm gives instructions for its use.
        !           137: 
        !           138: Xusend.c is a write-around for a mis-feature of the usend file
        !           139: sending command.  It segments a list of files to avoid over running
        !           140: the byte count limit of usend.  Use should be self-explanatory.
        !           141: 
        !           142: The cpio archive files MACROS and MACRO_SOURCE contain a collection
        !           143: of sample macros that do various things.  Macros for which source
        !           144: code exists are distributed in MACRO_SOURCE.  object code for all
        !           145: macros is in MACROS.  These will be automatically extracted into a
        !           146: macros directory when you run the makefile.  Most contain some
        !           147: limited documentation in addition to that available from the help
        !           148: command help.  The file CATALOG in the macro library summarizes what
        !           149: is available.
        !           150: 
        !           151: The cpio archive file TERMINALS contains the terminal support
        !           152: description files.  When you first make emacs, a directory
        !           153: "terminals" will be created and the terminal descriptions will be
        !           154: loaded into it.  You may wish to change some of the entries, or add
        !           155: your own, depending on the terminals used on your machine and the
        !           156: naming conventions for terminals.
        !           157: 
        !           158: The file term_support contains a description of the terminal
        !           159: description files, and instructions for adding support for a new terminal.
        !           160: 
        !           161: The file hyde.c is a crude expert system inference engine used for
        !           162: the troubleshooter.  The kbase is it's knowledge base which
        !           163: describes the specific problems in emacs.
        !           164: 
        !           165: SPECIAL INSTRUCTIONS FOR SPECIAL SITUATIONS:
        !           166: 
        !           167: PORTABILITY:
        !           168: 
        !           169: EMACS should be portable to a different machine with relatively
        !           170: little effort.  Parts of it depend on a Unix environment, and parts
        !           171: have been optimized to allow it to work in a 64K byte address space,
        !           172: but most code is quite portable.  Known points of
        !           173: machine dependence are:
        !           174: 
        !           175:        The makefile unpacks several archives.  These are in ascii
        !           176:        (-c) cpio format and should be portable to any unix system
        !           177:        having cpio.
        !           178: 
        !           179:        Several functions taking variable arguments depend on the
        !           180:        PDP-11 argument passing convention of storing the arguments
        !           181:        to a function consecutively on the stack.
        !           182:        
        !           183:        EMACS allocates storage above the end of its data area (the
        !           184:        symbol _end) by calling sbrk() directly to allocate more
        !           185:        space there. You cannot add code to emacs that calls on
        !           186:        malloc() or other dynamic storage allocators that call brk
        !           187:        or sbrk without modifying emacs.
        !           188:        
        !           189:        The normal terminal support code depends on types 
        !           190:        (int) and (char *) occupying the same physical
        !           191:        space, and on external symbols being allocated consecutive
        !           192:        storage locations in the order in which  they are declared.
        !           193:        This is true of most implementations of UNIX.  Setting the
        !           194:        "PORTEXT" flag will eliminate this dependency with some loss
        !           195:        of speed on start-up and some expansion of the code.
        !           196:        
        !           197:        You may get some type clash warnings from some versions of the
        !           198:        C compiler.  As long as they are all warnings, there
        !           199:        is no problem.
        !           200:        
        !           201: SYSTEM INFORMATION:
        !           202: 
        !           203: EMACS consumes lots of disk space for holding the buffer files and
        !           204: the text in the kill stack.  Currently, this is allocated in /tmp. 
        !           205: If space is scarce there, you can change the pathnames of the
        !           206: temporary files by changing the definition of BTEMPATH in
        !           207: emacs_buf.h, or by setting -DBTEMPATH=\"/wherever/tmp\" in the
        !           208: VFLAGS line of the makefile.  
        !           209: 
        !           210: If your system has the termcap database installed, you
        !           211: can use it instead of the internal 
        !           212: terminal support.  You must set "-DTERMCAP" in the VFLAGS parameter,
        !           213: and modify the makefile entry for xemacs so that the final load is
        !           214: done with the library containing the termcap access routines.  I do
        !           215: not guarantee that every termcap supported terminal will work
        !           216: optimally, since some of the parameters are not the same, however
        !           217: most if not all should work acceptably.
        !           218: 
        !           219: If you have the terminfo system, you can compile emacs to use it with
        !           220: "-DTERMINFO".  The makefile must be modified to include "-lcurses"
        !           221: in the compilation entry for xemacs.  Here are a couple of notes
        !           222: about the terminfo/curses version:
        !           223: 
        !           224: 1)     If you have a version of the curses package compiled for a
        !           225:        single terminal (-DSINGLE), use it, as emacs needs only one
        !           226:        terminal and this compiles somewhat more compact and
        !           227:        efficient code.
        !           228:        
        !           229: 2)     In order to avoid dynamic memory allocation, emacs fiddles
        !           230:        with the cur_term structure, and is thus dependent on the
        !           231:        implementation of curses.  If anything in the curses library
        !           232:        (or any other library) calls malloc() for dynamic memory
        !           233:        allocation, severe errors can result.  If you suspect a
        !           234:        problem here, check it by looking for malloc in a name list
        !           235:        of functions loaded in xemacs.
        !           236:        
        !           237: As distributed, emacs will time out input reads approximately every
        !           238: 30 seconds to go and look for newly arrived mail and to update the
        !           239: time display for time mode.  The cost of this is that on a system
        !           240: with little memory, it will force the emacs process to stay resident
        !           241: or swap in frequently even if no input is entered.  This can be
        !           242: turned off by modifying the statement that sets the VMIN parameter
        !           243: in emacs_io.c to set it to 1. instead of 0.
        !           244: 
        !           245: The compilation parameter "MINFILES" controls the use of temporary
        !           246: files.  Without this parameter set, emacs keeps the data associated
        !           247: with each buffer in a separate temporary file and keeps all of these
        !           248: files open when running.  On a heavily loaded unix system with a lot
        !           249: of emacs users, this may result in overflowing the system "inode" or
        !           250: file tables, which causes open(), pipe(), and other system calls
        !           251: which open files to fail.  Setting the parameter -DMINFILES in the
        !           252: definition of VFLAGS causes emacs to only keep one of its temporary
        !           253: files open at a time, thus reducing the use of inodes.  Doing this
        !           254: slows down emacs somewhat (for the time required to open and close
        !           255: temporary files every time you switch buffers), and can cause
        !           256: temporary files to be left in /tmp if emacs terminates abnormally. 
        !           257: Thus this setting is recommended only if your system has trouble
        !           258: with file or inode table overflows.  If you set it, watch for files
        !           259: with names of the form em.buffer_number.process_id accumulating
        !           260: in /tmp (or wherever you put the temporary files).
        !           261: 
        !           262: Emacs will compile for most AT&T and Berkeley versions of unix. 
        !           263: There are some minor variations in functionality depending on what
        !           264: version you pick.
        !           265: 
        !           266: FUNCTION               VARIATIONS
        !           267: 
        !           268: display of time                These update every 30 seconds on AT&T 3.0 or
        !           269: and mail messages      more recent, and on Berkeley systems with
        !           270:                        select() (4.2bsd).
        !           271: 
        !           272: flow_lim mode          Works on AT&T 3.0 or more recent and
        !           273:                        Berkeley systems with cbreak mode.  On
        !           274:                        Berkeley systems, this can consume some
        !           275:                        extra cpu time.  It is also more likely that
        !           276:                        ^S or ^Q typed as commands will be
        !           277:                        interpreted as flow control.  This mode
        !           278:                        should be used only when absolutely
        !           279:                        necessary.
        !           280:                        
        !           281: Handling of BREAK:     AT&T 3.0 or more recent and all Berkeley
        !           282:                        unix with cbreak mode.
        !           283:                        
        !           284: ^@ (mark) command      ^@ is a synonym for mark on AT&T systems,
        !           285:                        but is not available on Berkeley unix
        !           286:                        systems.  ^@ will behave like break on
        !           287:                        these.
        !           288:                        
        !           289: Sub-processes:         Work on both AT&T and Berkeley unix.  On
        !           290:                        Berkeley unix, emacs will notice output from
        !           291:                        the sub-process immediately, while on AT&T
        !           292:                        systems there will be some delay.  On
        !           293:                        certain unix/370 or Amdahl systems with
        !           294:                        front processors, there is a bug that
        !           295:                        prevents timing out reads to the terminal,
        !           296:                        and on these systems, emacs will not notice
        !           297:                        output from the sub-process until you stop
        !           298:                        typing.
        !           299:                        
        !           300: Suspension of emacs:   Suspending emacs with the M-^Z command works
        !           301:                        fine on Berkeley unix.  On system V unix
        !           302:                        running under "shl", you have to type an
        !           303:                        extra ^Z to get it to suspend.
        !           304:                        
        !           305: A version of emacs is available to run on an IBM personal computer. 
        !           306: In order to prevent the massive unauthorized proliferation of copies
        !           307: that occurred with the unix version of emacs, distribution is being
        !           308: more carefully controlled.  If you would like a copy, contact me by
        !           309: unix mail to ihesa!warren.
        !           310: 
        !           311: Running on a shared I&D space pdp-11:
        !           312: 
        !           313:        Because of growth in features and terminal support, fitting
        !           314:        emacs into a 64k address space is getting hard.  To run
        !           315:        effectively, you will have to remove something.  The main
        !           316:        effect of the limit is to limit the size of file  (number of
        !           317:        lines) you can edit.  Two bytes of data space are needed for
        !           318:        each line.  Here are
        !           319:        some hints on things that don't matter very much that can be
        !           320:        removed without serious degradation.
        !           321:        
        !           322:        NSCRCOL:  Changing NSCRCOL (emacs_disp.h) from 128 to 80
        !           323:        saves over 1000 bytes, and has no impact unless you support
        !           324:        terminals with more than 80 columns of display.
        !           325:        
        !           326:        NBLOCK (emacs_gb.h)  NBLOCK can be reduced from 16 to 2, saving
        !           327:        512 bytes for each unit of reduction.  Reducing it limits
        !           328:        the space available for macros, and thus the number of
        !           329:        macros that can be loaded.  It also increases disk I/O somewhat.
        !           330:        
        !           331:        NBUF (emacs_buf.h)  NBUF determines how many editor buffers
        !           332:        you can have.  Reducing it saves about 150 bytes for each
        !           333:        one you get rid of.
        !           334:        
        !           335:        Time mode (functions dtime, tzset, localtime asctime, etc.) Getting
        !           336:        rid of all of the time mode related stuff will save about
        !           337:        800 bytes.  This is a seldom used feature.
        !           338:        
        !           339:        Statistics (functions statout & stats)  These are seldom
        !           340:        used, and save about 300 bytes.
        !           341:        
        !           342:        M-".  This command is almost never used, and saves ~300 bytes.
        !           343:        
        !           344:        insert/delete line and character.  With a fast terminal,
        !           345:        these don't matter much, and getting rid of the code
        !           346:        (functions vadjust, lshift, rshift, and code to invoke them)
        !           347:        saves 800 bytes.
        !           348:        
        !           349:        Regular expressions.  These are useful, but large (2000 bytes).
        !           350: 
        !           351:        Macros, very useful, but take a lot of code.
        !           352:        
        !           353: Good luck!
        !           354: 

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.