Packages Related to Template
There are template packages of two different categories, which are determined by one question:
What do you want to do with templates? Do you want to use templates when creating new files, or do you want to insert some stuff during editing (but you are not satisfied with the standard macro mechanism)?
Well, templates could be seen as both new-file templates and macro-like template, but the main application of templates determines the answers for the following questions:
- How do you define a template? You can define it by one file per template or by customizing some Emacs variables. The first solution (which is used by package Template) avoids Emacs hacking but might not be optimal if you just want to define complex macros or if you want to use templates to program a new Emacs major-mode.
- How is an appropriate template selected? If you want to use complex macro during editing, the answer is clear: the user have to provide the name of the template. For new files, the appropriate template should be automatically selected. But of course, you don't want to loose any flexibility and you don't want to customize your Emacs for every project you start.
- How do you do "clever" things in the template? The aims are to have many predefined expansions (e.g., the current date) and to define some non-trivial things without learning Lisp. Any functionality here is the overlapping point of both template categories.
Here is a little list of related files, collected around 1998, some discarded later (no URLs, no active updating, but you can send me a mail):
- Package autoinsert.el uses templates when creating new files. These templates are defined via files or by customizing Emacs. For each new template you want to introduce, you must customize your Emacs, the selection is restricted to one template per major-mode or regexp match. No predefined expansions; clever things are provided by usual Lisp expressions or the macro-like templates of package skeleton.
- Package skeleton.el is a Lisp language extension for writing statement skeletons, i.e., you get macro-like Lisp commands.
-
Package tempo.el helps you defining and using named macro-like
templates. Its predefined macros are similar to some predefined expansions of
package Template. A specific template is used by
html-helper-mode
when creating a new html file. (This is turned off with the default installation of package Template.) - Package hm--html-menus provides a command to insert templates editing. These templates are defined via files. There are no predefined expansions (except setting point), non-trivial expansions are defined via Lisp.