Node:Using non-standard file names



Using non-standard file names

By default, Emacs is configured to use the GNAT style file names, where file names are the package names, and the extension for spec and bodies are respectively .ads and .adb.

If you want to use other types of file names, you will need to modify your .emacs configuration file.

Adding new possible extensions is easy. Since the ada-mode needs to know how to go from the body to the spec (and back), you always have to specify both. A function is provided with the ada-mode to add new extensions.

For instance, if your files are called <unit>_s.ada and <unit>_b.ada respectively for spec and bodies, you need to add the following to your .emacs :

(ada-add-extensions "_s.ada" "_b.ada")

Note that it is possible to redefine the extension, even if they already exist, as in:

(ada-add-extensions ".ads" "_b.ada")
(ada-add-extensions ".ads" ".body")

This simply means that whenever the ada-mode will look for the body for a file whose extension is .ads, it will take the first available file that ends with either .adb (standard), _b.ada or .body.

If the filename is not the unit name, then things are a little more complicated. You then need to rewrite the function ada-make-filename-from-adaname (see the file ada-mode.el for an example).