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

1.1       root        1: �template expand template and execute commands [MACRO]
                      2: 
                      3: 
                      4: Modified by K. R. Stanley, IH 4F-321, Version 4.2    8/31/81
                      5: Based on abbrev macro
                      6: Uses TEMPLATE FILE: for file name
                      7: last modified 11/17/82
                      8: uses a caret "^" to delineate where the cursor will go.
                      9: 
                     10: restrictions: uses mark 15 as temporary  marker
                     11: 
                     12: It uses the name after TEMPLATE FILE: as the file to use
                     13: in the $HOME directory.
                     14: B�           save buffer, and delete previous word then add an @
                     15: +<@
                     16: <^
                     17: 
                     18: +                   make a copy starting with a newline
                     19:                       search for string  "TEMPLATE FILE:" in
                     20:                       first 10 lines
                     21: 15�10�      mark here - go to 10'th line
                     22: <TEMPLATE FILE:
                     23:                       look for string starting with "TEMPLATE FILE:"
                     24: |� �                in front of this line  -  if found
                     25: 14�-      get file name, delete, and reinsert
                     26: <$HOME/
                     27: +�           start file name at home and add new file name
                     28: �                     else
                     29: � <$HOME/.templates
                     30: ��            put default file name in,end if and go back to
                     31: 1515�     where should be and set mark 15
                     32: -          switch to file  (but don't complain if new)
                     33: 2>B                Prepare to check if in same buffer (get old buffer
                     34:                       name and check present against it)
                     35: |�           See if in buffer
                     36:        �&-2-�    in buffer, just ignore it
                     37:                       (dump 2 copies of abbreviation and buffer name)
                     38:        � �|� Not in buffer, process abbrevs
                     39:                �-�< 
                     40:                       search for abbreviation from back and if found
                     41:                -�<@
                     42:                       find space and mark next character go to next line
                     43:                |��&�search for next at and go to end of 
                     44:                                       previous line
                     45:                        � �&��or go to end of buffer and
                     46:                               back up to end of next line
                     47:                �      put abbreviation on kill stack
                     48:                <...
                     49:                -</usr/tmp/emacs$LOGNAME
                     50: 
                     51:                B%go to home buffer and destroy temp buff
                     52:                </usr/tmp/emacs$LOGNAME
                     53:                       execute input
                     54:                �&delete newline and indentation
                     55:                15�go to start of abbrev and do M-^
                     56:                �end of found
                     57:                � %-
                     58:                                                        question
                     59:                        ����if found if in buffer
                     60: 
                     61: �d_caret find and delete the next caret
                     62: <^
                     63: 

unix.superglobalmegacorp.com

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