Annotation of researchv9/cmd/emacs/macros/CATALOG, revision 1.1.1.1

1.1       root        1: This is a catalog of EMACS macros in the library
                      2: 
                      3: balance: W. A. Montgomery (Version 3.4)
                      4:        This file contains macros to display for each closing
                      5:        parenthesis, brace, or bracket, the matching opening
                      6:        character.  It re-defines these characters to do so, and
                      7:        beeps if no match is found.  The effect on the file is the
                      8:        same as if the macro library were not there with the
                      9:        exception that } always behaves as it does in C mode.  The
                     10:        maximum nesting depth that can be handled is about 20.
                     11:        
                     12: rmail:  W. A. Montgomery (version 3.4)
                     13:        This file contains a macro put on ^Xr for processing mail. 
                     14:        It gathers new and old mail (old mail from $HOME/rmail) and
                     15:        allows the user to peruse it.  ? provides a brief
                     16:        description of the available commands.  Among others, you
                     17:        can selectively delete and undelete messages, reply to
                     18:        messages, write messages to files, and gather the most
                     19:        recent UNIX news items.
                     20:        
                     21: vmail:  W. A. Montgomery (version 4.0)
                     22:        This file contains a macro that responds to your mail while
                     23:        you are vacation.  It will copy all new mail into
                     24:        $HOME/rmail, and respond to each message, giving the date of
                     25:        the message, the file $HOME/response, and your signature to
                     26:        each.  The macro is put on ^Xv when loaded.
                     27:        The intended use of this package is to set it up to run
                     28:        periodically while you are away on vacation (or for some
                     29:        other extended period of time) via at(1) jobs or the like. 
                     30:        You do this by having the job run emacs -i <foo> where foo
                     31:        is a file that does ^X^Lvmail\n^Xv^Z.  Each time you run it,
                     32:        all new mail is replied to, and accumulates in $HOME/rmail
                     33:        awating your return.
                     34: 
                     35: abbrev: W. A. Montgomery (version 3.2)
                     36:        This file contains a single macro that is put on @ that
                     37:        causes abbreviations to be expanded.  The word preceeding
                     38:        the '@' is looked up in a list of abbreviations for
                     39:        expansion. The abbreviation list
                     40:        is taken from the file .abbrevs in the current directory. 
                     41:        The file contains a series of entries of the form:
                     42:        
                     43:        abbreviation@ what it expands to.  
                     44: 
                     45:        Everything after the "@ " up to the next line containing
                     46:        an '@' becomes the expansion of "abbreviation", so that you
                     47:        may have multi-line abbreviations if you like.
                     48:        
                     49: appropos: W. A. Montgomery (version 3.2)
                     50:        This file contains a single macro on ^X? that provides a
                     51:        different form of help information.  ^X? will prompt for a
                     52:        subject, and display help explanations for all commands and
                     53:        macros that pertain to that subject.  (actually, the subject
                     54:        is used as a search string and all help explanations that
                     55:        include the subject are displayed).
                     56:        
                     57: lcase: W. A. Montgomery (version 3.4)
                     58:        This file contains macros for converting letters or words to lower
                     59:        case.  M-l converts a single letter to lower case, while ^Xl
                     60:        converrts an entire word to lower case.
                     61:        
                     62: refmac: W. A. Montgomery (version 3.2)
                     63:        This file contains macros to interface with J. W. Leth's
                     64:        nroff pre processor (nrpp) to maintain reference lists in
                     65:        memoranda.  M-R places the user in the bibliography
                     66:        file, and allows the user to move around in the
                     67:        bibliography file through ordinary emacs commands. 
                     68:        When the user exits from the bilbliography file via
                     69:        ^Z, the reference definition at the cursor position in the
                     70:        bibliography is put into the file being edited at the cursor
                     71:        position where M-R was invoked.  If the cursor position in
                     72:        the bibliography is at the beginning of the buffer, no
                     73:        reference definition is inserted into the edited file.
                     74:        ^XR can be used
                     75:        while in the bibliography file to send the reference
                     76:        description at the cursor position to the department
                     77:        clerk for inclusion in the department bibliography.
                     78:        
                     79: spell: W. A. Montgomery (Version 3.4)
                     80:        This macro package contains a single macro on M-S
                     81:        that causes the spell program to be invoked on the
                     82:        file in the buffer, and causes the result to be
                     83:        analyzed.  The words found by spell are filtered through a
                     84:        local dictionary (maintained in $HOME/.dict) so that you can
                     85:        add words to your local dictionary that are not in the spell
                     86:        dictionary. 
                     87: 
                     88:        For each misspelled word, spell will prompt for
                     89:        action.  You can file the word in your local dictionary by
                     90:        typing 'd'. 'n' goes to the next word without looking up the
                     91:        occurances of the current word.  '?' displays instructions. 
                     92: 
                     93:        A space causes the cursor to move to the first occurance of
                     94:        the misspelled word.  You can then edit the file to correct
                     95:        the word and type ^Z to move on to the next occurance.  When
                     96:        you reach the last occurance, spell moves on to the next word. 
                     97: 
                     98: tags:  W. A. Montgomery (Version 3.6)
                     99:        Tags is a macro library that facilitates working with
                    100:        a collection of related files.  This package works
                    101:        with a tags file, which defines a set of names for
                    102:        positions in the files.  The macro placed on
                    103:        ^Xf will prompt for a tag name, reads the file
                    104:        containing the position implied by the specified
                    105:        tag, and moves to the indicated position.  This is
                    106:        useful, for example, with a set of source files that
                    107:        contain C function definitions when you want to find
                    108:        a function and don't know or care what file it is in.
                    109:        
                    110:        A second macro in this package (C_TAGS) can be used
                    111:        to construct a tags file from a C source file.  When
                    112:        C_TAGS is invoked, it scans the current buffer for
                    113:        function definitions, and prompts you.  If you enter
                    114:        a space, it defines a tag whose name is the function.
                    115:        Any other character causes the current definition to
                    116:        be ignored.  Note:  If you declare functions with
                    117:        types, like char *foobar(x,y), put the type on one
                    118:        line and the function definition on a line by
                    119:        itself, otherwise this will not work.
                    120: 
                    121:        The command ^xt defines a tag from the current line of the
                    122:        current file, and can be used to update tags files. 
                    123: 
                    124:        The tags are accumulated in a buffer called .tags
                    125:        which should be saved before you exit emacs.  Tags
                    126:        from several files can be put in the same tags file
                    127:        simply by running C_TAGS on several source files. 
                    128:        There is currently no check for an attempt to
                    129:        re-define the same tag name, which will fail.   
                    130: 
                    131:        For those who like the nitty gritty, the format of
                    132:        the tags file is a series of entries of the form
                    133: 
                    134:        @<tag_name>:<file_name>:<search_string>:
                    135: 
                    136:        Any of the fields can contain any character
                    137:        (including newline) except : and @.  
                    138:        
                    139: crypt: W. A. Montgomery (Version 4.0)
                    140:        This macro library contains macros for reading and writing
                    141:        files encrypted with crypt (1).  The library has three macros:
                    142:        
                    143:        ^XR (READ_ENCRYPTED)  This macro prompts the user for a key
                    144:        and a file name and reads the specfied file into the current
                    145:        buffer.
                    146:        
                    147:        ^XW (WRITE_ENCRYPTED)  This macro prompts for a key and a
                    148:        file name and writes the buffer to the file, using the key
                    149:        specified.
                    150:        
                    151:        ^XS (SAVE_ENCRYPTED)  Prompts for a key and writes saves the
                    152:        current buffer under the specified key.
                    153:        
                    154:        All of these commands are rather slow, as they use the crypt
                    155:        command to do the reading and writing.
                    156: 
                    157: debug: W. A. Montgomery (Version 4.0)
                    158: 
                    159:        This library contains several useful macros for debugging
                    160:        and generaal programming.
                    161:        
                    162:        display_killstack:  Puts the items in the kill stack into a
                    163:        buffer, and allows you to examine them.
                    164:        
                    165:        PNUMB:  Converts its argument to a character string and
                    166:        leaves the result in the buffer at the current position.
                    167:        
                    168:        TO_DECIMAL:  Converts the top item of the kill stack to
                    169:        a decimal integer and returns the result.
                    170:        
                    171: loader:  W. A. Montgomery (Version 4.1)
                    172: 
                    173:        This file contains a number of macros to load macros from
                    174:        this library when invoked.  If you use macros like spell,
                    175:        rmail, refmac, and crypt, infrequently, load loader instead.
                    176:        When you first invoke a macro in any of those libraries it
                    177:        will be automatically loaded for you.
                    178:        
                    179: shell: Joe Steffen and Bill Paulson (Version 4.4)
                    180:        This file contains macros that provide convenient execution
                    181:        of your frequently executed shell commands, and allow you to
                    182:        see the output of several commands at once.
                    183:        
                    184:        The M-E macro allows you to edit a file of shell commands
                    185:        called $HOME/.commands.  Enter the
                    186:        command(s) you want to execute on a line, or move the cursor to a
                    187:        different line of commands, and optionally enter ^Z to exit.  Enter
                    188:        M-^E to execute the command line the cursor was pointing at.  The
                    189:        shell output will be put into the .exec buffer and
                    190:        displayed in the bottom emacs window, unless
                    191:        the command line started with a '!', in which case the
                    192:        output will be displayed as the commands execute.
                    193: 
                    194:        The M-C macro displays the current line in
                    195:        this file in case you forget.  M-N and M-P move the cursor down and up,
                    196:        respectively, in the file and display the current line.  They take an
                    197:        argument just like ^N and ^P.  These commands make it easy to switch
                    198:        between several command lines without using the M-E macro.
                    199: 
                    200:        The ^Xs macro executes the shell interactively
                    201:        instead of prompting for each command.  This allows cd
                    202:        commands to stay in effect and allows you to see the results of
                    203:        several commands.  The prompt is changed to 'emacs' to remind you
                    204:        that you are still within emacs.  Enter ^D instead of a null line to
                    205:        return to emacs.
                    206: 
                    207: list:  C. Douglas Blewett (DR30L19) Version 4
                    208:        
                    209:        This file contains a command that allows the user to edit
                    210:        (recursively) a list of files.  This is much like vi's :next
                    211:        command.  The list of files is collected in .exec and the files
                    212:        are edited in .list.  This is useful for making changes in a global
                    213:        variable that appears in a list of files (e.g. ^XL *.c).
                    214:        
                    215:        If an argument other than 1 is given then the command looks up the
                    216:        file name in the directories known to contain manual pages.  This
                    217:        routine contains a string with embedded paths to the manual
                    218:        directories.
                    219:        
                    220:        An "ls -d" is performed, so full Bourne shell style wild carding is
                    221:        available.  This is very useful for manual page searches
                    222:        (e.g. ^U^XL *open*).
                    223:        
                    224:        Modified to preserve the sanity of .exec. Saves the point, mark,
                    225:        and extent of .exec.
                    226: 
                    227: registers: C. Douglas Blewett (DR30L19) Version 4
                    228: 
                    229:        This file contains two routines for implementing registers
                    230:        (like those found in MIT EMACS or TECO).  M-P copies the current
                    231:        area into the named register.  M-G copies the named register
                    232:        to the current point.
                    233: 
                    234:        The registers are kept in a buffer named .registers
                    235: 
                    236: wild:  C. Douglas Blewett (DR30L19) Version 4
                    237:        
                    238:        This file contains assorted wild carding routines.  The
                    239:        macro "Wild" wild cards 
                    240:        the string found in the kill stack and returns its result in the
                    241:        kill stack.  The interface routines (those called directly by the
                    242:        user) prompt for a string containing wild carding characters.
                    243:        
                    244:        Modified to preserve the sanity of .exec.  Saves the point, mark,
                    245:        and extent of .exec.
                    246:        
                    247:         Interface routines
                    248:                ^Xc change directory
                    249:                ^Xr read file
                    250:                ^Xf find file
                    251:        
                    252: shift: C. Douglas Blewett (DR30L19) Version 4
                    253: 
                    254:        Shift a region right or left.  An argument of != 1 shift
                    255:        left, otherwise right.  This is very useful for programing
                    256:        a highly indented language.
                    257: 
                    258: Concept100.pad: C. Douglas Blewett (DR30L19) Version 4
                    259: 
                    260:        This routine handles all of the Concept100 cursor pad keys.
                    261: 
                    262:        This routine assumes that the escape character for the Concept
                    263:        has been changed to ^\.  This should have been done in the
                    264:        c100* terminal data base file.  All escapes are changed to ^\.
                    265:        This routine also takes advantage of the different handling of
                    266:        the comment character interactively and in macros by EMACS.
                    267: 
                    268:        Keys handled                    Approximate translation
                    269:                HOME                            M-g
                    270:                PAGE (upper and lower)          M-v and ^V
                    271:                SCROL (upper and lower)         M-3^P and M-3^N
                    272:                B TAB                           ^R^I
                    273:                BREAK                           ^G
                    274:                All of the arrowed keys         line or character movement
                    275: 
                    276:        Arguments supplied to these commands multiply the affect.
                    277: 
                    278:        The first five programmable function keys (upper and lower) are
                    279:        defined in the data base file
                    280:        (INSRT, DEL CHAR, DEL & INS LINE, CLEAR EOP & EOL, and SEND).
                    281: 
                    282:        Modified to my own tastes 7/5/81: added MULT, reset & stat,
                    283:        print and tape  
                    284: 
                    285: cc_list        C. Douglas Blewett (DR30L19) Version 4
                    286: 
                    287:        Compiler and list interface (arg>1 file list), (arg<1 manual pages)
                    288:        Interface routines
                    289:        
                    290:                ^XL     - the main mono-lith - controls editing lists of files
                    291:                ^X^@    - Creates the new command (or filename) generating routine
                    292:                ^X^_    - Command or file name routine - returns on the kill stack
                    293:        
                    294:        Compiler and list interface routine.  This routine prompts for a compiler
                    295:        command (i.e. cc or make), runs it, and catches the output.  If line numbers
                    296:        are present in the output, the routine will position to the correct line.
                    297:        Three formats can be handled by this routine.
                    298:        
                    299:                "filename.c", line 23: etc.
                    300:                        or
                    301:                filename.c: 23: etc.
                    302:                        or
                    303:                filename.c
                    304:        
                    305:        The last format is typical ls stuff.
                    306:        
                    307:        With an argument < 1 the routine prompts for a manual page specification
                    308:        and searches the known directories for manual pages.
                    309:        
                    310:        With an argument > 1 the routine prompts for a file specification and
                    311:        searches using an "ls -d file_spec"
                    312:        
                    313:        SPECIAL STUFF FOR DEFAULT COMMANDS: WARNING creates a new routine
                    314:        
                    315:        This routine, ^XL, when used as a compiler interface calls ^X^_ to detemine
                    316:        what command to issue.  ^X^_  can be setup to return a default command
                    317:        (rather than prompting the user) by running the ^X^@ command.  ^X^@
                    318:        actually creates a new macro for ^X^_.  It isn't LISP, but it works.
                    319:        
                    320:        The compiler interface (arg == 1) reads files in using ^X^F.  No
                    321:        attempt is made to garbage collect buffers.  This does not pose a
                    322:        real problem, becuase the routine places the user in the buffer .list
                    323:        when this happens.  At that point the user can use ^X^K to remove
                    324:        un-needed buffers.  ^X^F is used instead of ^X^R because it is very
                    325:        likely with compiles that the user already has the file in a buffer
                    326:        and want to keep it there (and current).
                    327:        
                    328:        The list (arg > 1) and manual page (arg < 1) facility uses the
                    329:        buffer .list to read files using ^X^R.  These routines more or less
                    330:        automatically garbage collect buffer space.
                    331: 
                    332: home:  C. Douglas Blewett (DR30L19) Version 4
                    333:        
                    334:        This file contains assorted macors that help the user move quickly or
                    335:        accurately around the screen.  The central rountines are M-H and
                    336:        M-L (top and bottom of the screen).
                    337:        
                    338:         Interface routines
                    339:                M-H - home or top of screen
                    340:                M-L - last or bottom of screen
                    341:                M-M - Middle of screen
                    342:                ^\  - back one line - adds a line at the top of the screen
                    343:                ^_  - forward one line - adds a line at the bottom of the screen
                    344:        
                    345: filter: Warren Montgomery, 6E-314, Version 4.3
                    346: 
                    347:        This file contains one macro, filter_region, which is put on
                    348:        the key M-#.
                    349: 
                    350:        This macro takes the marked region of the current buffer, prompts
                    351:        for a command to run, passes the text from the marked region to the
                    352:        specified command, and replaces the text from the marked
                    353:        region with the output.  Thus marking a list of names
                    354:        appearing in an nroff source and invoking M-# with the
                    355:        command "sort" will cause the list to be sorted.  The macro
                    356:        makes use of a temporary file (/tmp/$LOGNAME.emacs) to hold
                    357:        some intermediate results.
                    358: 
                    359:        
                    360: nlpack: Warren Montgomery 6E-314, Version 4.3
                    361:        This file contains a macro that implements a move to
                    362:        next(previous) line command that moves to the same screen
                    363:        position in the next line.  The macro is put on ^N.  It
                    364:        moves to the same cursor position in the line that follows.
                    365:        If a sequence of ^N or ^P commands is given, it tries to
                    366:        stay in the same column, even if some of the intermediate
                    367:        lines are too short.
                    368:        
                    369:        Actually, the ^N macro reads characters and carries out the
                    370:        movement so long as the character read is a ^N or a ^P.  Any
                    371:        other character breaks out of ^N.
                    372:        
                    373:        To get the same effect on ^P, invoke M-:^P^N.  when nlpack
                    374:        has been loaded.
                    375:        
                    376:        Note that this macro may be significantly slower than the
                    377:        built in movement commands.  Also, since it changes the
                    378:        built in commands ^P and ^N, it may interact with other
                    379:        macros that use them.
                    380: 
                    381: 
                    382: Draw: W. A. Montgomery (Version 4.5)
                    383: 
                    384:        This file contains several macros that are useful for
                    385:        drawing pictures on the screen.  These should be run in
                    386:        picture mode, with nodelete and overwrite modes set as well.
                    387: 
                    388:        The draw macro allows  the user to draw on the screen in
                    389:        picture mode by steering the cursor with the "home" keys of
                    390:        the right hand.  The keys uiojlm,. are used to indicate up
                    391:        and left, up, up and right, left, right, down and left,
                    392:        down, and down and right.  Each key replaces the character
                    393:        under the cursor by one of:  '-' '|' '\' or '/' and moves
                    394:        the cursor in the indicated direction.  This provides a
                    395:        simple way of drawing stick figures on the screen for use
                    396:        with gc. 
                    397:        
                    398:        The downline macro draws a verticle line of length equal to
                    399:        its argument down the screen starting from the current
                    400:        position.  This is an internal macro used by the box
                    401:        command, however it is useful in itself.  It is put on M-|
                    402:        
                    403:        The box macro draws boxes using | and -.  It draws a box
                    404:        with corners where the current position and the mark are
                    405:        set.  These can be in any corners of the desired box.  The
                    406:        cursor is left at the lower right hand corner of the box.
                    407: 
                    408: Keyboard Macro enhancements
                    409: Author: George Furnas (alice!gwf)
                    410: Date: 11/1/82
                    411: Version: 4.5
                    412: 
                    413: The allow saving a small ad hoc library of keyboard macross that can
                    414: be referred to by name. It also allows editing the macros easily and
                    415: is set up to encourage keeping documentation on the macros up to
                    416: date. 
                    417: 
                    418: Macros are saved in a directory $HOME/.kbdmac.dir under names
                    419: km.NAME where NAME is the user specified name by which the keyboard
                    420: macro is to be known, called, etc.  (The directory must be created
                    421: ahead of time.)  
                    422: 
                    423: Since the macros allow no internal documentation, a brief amount
                    424: documentation is kept in a file called $HOME/.kbdmac.dir/README.doc
                    425: The keyboard macro editing and renaming  macros always finish up by
                    426: pausing with a buffer of this documentation which is to be edited
                    427: recursively to keep it up to date. They go to old entries or create
                    428: new ones as needed.
                    429: 
                    430: 
                    431: M-^N: name_kbdmac      names keyboard macro. prompts for name
                    432:        This allows you to save the current standard (unnamed)
                    433:        keyboard macro under the name specified. First, however,
                    434:        it pulls the macro into a buffer for perusal and/or editing 
                    435:        (idea was to at the very least make usre you knew what you
                    436:        were naming.) Then it asks for a name, and finally it
                    437:        gives you the README.doc file for any short one-line comments
                    438:        you might like to make on the newly named macro. (A
                    439:        recursive edit, exited as usual by ^Z)
                    440: 
                    441: M-X: execute_named_kbdmac executes named keyboard macro <arg> times
                    442:        This simply prompts for the name of the previously stored 
                    443:        keyboard macro, and executes it. It it is called with an
                    444:        argument, it executes it <arg> times.
                    445: 
                    446: M-^E: edit_named_kbdmac edits named keyboard macro
                    447:        This allows you to alter (edit recursively) a previously named 
                    448:        keyboard macro. It prompts for the name, pulls in the
                    449:        appropriate file, and enters a recursive edit. When you are done
                    450:        editing it (hitting ^Z, as usual) it goes and gets the
                    451:        README.doc file, at the appropriate line, in case you want to
                    452:        edit the comments on the macro. (Also a recursive edit,
                    453:        exited by ^Z)

unix.superglobalmegacorp.com

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