SourceFiles.org - Use the Source, Luke
Home | Register | News | Forums | Guide | MyLinks | Bookmark

Related Sites

Latest News
  General News
  Reviews
  Press Releases
  Software
  Hardware
  Security
  Tutorials
  Off Topic


Back to files

ConTemplate

Contextual Templates for Emacs

http://eyeofdog.org/foof/emacs/contemplate

                           version 0.4.1
                            Oct 30, 2000

This directory contains a set of context-based templates for Emacs, to allowing quick insertion of common text in various modes, with intelligent prompting and calculating of contemplate fields. The latest version and information can be found at http://eyeofdog.org/foof/emacs/contemplate.

To use ConTemplate, make sure the relevant files are in your Emacs load-path, by putting them in a standard Emacs Lisp directory, or adding to your load-path. Thus, if you placed these files in your ~/emacs/contemplate directory, you could add the following to your ~/.emacs:

(setq load-path (cons "~/emacs/contemplate" load-path))

and then define where to find the contemplate-mode function with

(autoload 'contemplate-mode "contemplate" "Contextual Templates" t)

This will make the contemplate-mode available. To use it, either call it manually with M-x contemplate-mode, or, so that you don't have to run this in every file, you can add it to the relevant mode-hook, e.g.

(add-hook 'c-mode-common-hook 'contemplate-mode)

Another convenience function you may like is auto-insert-file-header. This will automatically insert the appropriate file header contemplate whenever you open a new file.

(autoload 'auto-insert-file-header "contemplate" "Auto File Header" t) (add-hook 'c-mode-common-hook 'auto-insert-file-header)

In summary, and for ease of cut and paste, if you put these files in ~/emacs/contemplate add the following to your ~/.emacs (substituting "c-" with "el-" or "html-" or whatever language you want):

(setq load-path (cons "~/emacs/contemplate" load-path)) (autoload 'contemplate-mode "contemplate" "Contextual Templates" t) (autoload 'auto-insert-file-header "contemplate" "Auto File Header" t) (add-hook 'c-mode-common-hook 'contemplate-mode) (add-hook 'c-mode-common-hook 'auto-insert-file-header)

See the info documentation for more details.


Other Sites

Discussion Groups
  Beginners
  Distributions
  Networking / Security
  Software
  PDAs

About | FAQ | Privacy | Awards | Contact
Comments to the webmaster are welcome.
Copyright 2006 Sourcefiles.org All rights reserved.