Autotyping
**********
Under certain circumstances you will find yourself typing similar
things over and over again. This is especially true of form letters
and programming language constructs. Project-specific header comments,
flow-control constructs or magic numbers are essentially the same every
time. Emacs has various features for doing tedious and repetitive
typing chores for you in addition to the Abbrev features (Note:(emacs)Abbrevs).
One solution is using skeletons, flexible rules that say what to
insert, and how to do it. Various programming language modes offer some
ready-to-use skeletons, and you can adapt them to suit your needs or
taste, or define new ones.
Another feature is automatic insertion of what you want into empty
files, depending on the file-name or the mode as appropriate. You can
have a file or a skeleton inserted, or you can call a function. Then
there is the possibility to have Un*x interpreter scripts automatically
take on a magic number and be executable as soon as they are saved. Or
you can have a copyright notice's year updated, if necessary, every
time you save a file. Similarly for time stamps in the file.
URLs can be inserted based on a word at point. Flexible templates
can be defined for inserting and navigating between text more
generally. A sort of meta-expansion facility can be used to try a set
of alternative completions and expansions of text at point.