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 (see Abbrevs in The GNU Emacs Manual).
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.
|Using Skeletons||How to insert a skeleton into your text.|
|Wrapping Skeletons||Putting existing text within a skeleton.|
|Skeletons as Abbrevs||An alternative for issuing skeleton commands.|
|Inserting Pairs||Typing one character and getting another after point.|
|Autoinserting||Filling up empty files as soon as you visit them.|
|Copyrights||Inserting and updating copyrights.|
|Executables||Turning interpreter scripts into executables.|
|Timestamps||Updating dates and times in modified files.|
|QuickURL||Inserting URLs based on text at point.|
|Tempo||Flexible template insertion.|
|Hippie Expand||Expansion of text trying various methods.|
|Skeleton Language||Making skeleton commands insert what you want.|
|GNU Free Documentation License||The license for this documentation.|
Copyright © 1994–1995, 1999, 2001–2020 Free Software Foundation, Inc.
Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.3 or any later version published by the Free Software Foundation; with no Invariant Sections, with the Front-Cover Texts being “A GNU Manual”, and with the Back-Cover Texts as in (a) below. A copy of the license is included in the section entitled “GNU Free Documentation License”.
(a) The FSF’s Back-Cover Text is: “You have the freedom to copy and modify this GNU manual.”