Logged in as Guest
Open Source Visual RAD

Home >
Getting Started >
The GNAVI Project >
GNAVI Extras >
Join >
Latest Additions >
Press Releases >
Links >
Contact >
About >
Login >

Project Notes - emacs_quickref
GNAVI Projects Notes

Moving Through Ada Code

   There are several  easy to use commands to stroll  through Ada code.
All these functions are available through the Ada menu, and you can
also use the following key bindings or the command names:

     Move to the next function/procedure/task, which ever comes next

     Move to previous function/procedure/task

`M-x ada-next-package'
     Move to next package.

`M-x ada-prev-package'
     Move to previous package.

`C-c C-a'
     Move to matching start of `end' (`ada-move-to-start').  If point
     is at the end of a subprogram, this command jumps to the
     corresponding `begin' if the user option `ada-move-to-declaration'
     is `nil' (default), it jumps to the subprogram declaration

`C-c C-e'
     Move point to end of current block (`ada-move-to-end').

`C-c o'
     Switch between corresponding spec and body file
     (`ff-find-other-file').  If the cursor is on a subprogram, switch
     between declaration and body.

`C-c c-d'
     Move  from   any  reference  to  its  declaration   and  switch
     between declaration  and body  (for  procedures, tasks,  private
     and  incomplete types).

`C-c C-r'
     runs the `gnatfind' command to search for all references to the
     entity pointed by the cursor (`ada-find-references').  Use `C-x `'
     (`next-error') to visit each reference (as for compilation errors).

   These  functions use  the  information in  the  output of  the Gnat
Ada compiler.   However,   if  your   application  was  compiled   with
the `-gnatx'  switch, these  functions will  not work,  since  no extra
information  is generated by  GNAT. See  GNAT documentation  for further

   Emacs will  try to  run    Gnat for  you whenever the
cross-reference informations  are     older   than your   source   file
 (provided  the `ada-xref-create-ali' variable is  non-`nil').  Gnat
then produces a file with the same name  as the current  Ada file but
with the extension changed to `.ali'. This files are normally used  by
the binder, but they will also contain additional cross-referencing

Comment Handling

   By default, comment lines get indented like Ada code. There are a few
additional functions to handle comments:

     Start a comment in default column.

     Continue comment on next line.

`C-c ;'
     Comment the selected region (add - at the beginning of lines).

`C-c :'
     Uncomment the selected region

     autofill the current comment.

Automatic Casing

   Automatic casing can be performed on port or whole buffer using:

`C-c C-b'
     Adjust case in the whole buffer (`ada-adjust-case-buffer').

`C-c C-y'
     Create a new entry in the exception dictionary, with the word under
     the cursor (`ada-create-case-exception')

`C-c C-t'
     Rereads the exception dictionary from the file
     `ada-case-exception-file' (`ada-case-read-exceptions').

(c) 1999-2004 All Rights Reserved David Botton