GNU ELPA - ada-mode


major-mode for editing Ada sources
ada-mode-7.0.1.tar, 2020-Jan-31, 6.02 MiB
Stephen Leake <>
Home page
Browse ELPA's repository
CGit or Gitweb

To install this package, run in Emacs:

M-x package-install RET ada-mode RET

Full description

Emacs Ada mode version 7.0.1

Ada mode provides auto-casing, fontification, navigation, and
indentation for Ada source code files.

Cross-reference information output by the compiler is used to provide
powerful code navigation (jump to definition, find all uses, show
overriding, etc). By default, only the AdaCore GNAT compiler is
supported; other compilers can be supported. Ada mode uses gpr_query
to query compiler-generated cross reference information. 

Ada mode uses a parser to provide fontification, navigation, and
indentation. The parser is implemented in Ada, is fast enough even for very 
large files (via partial parsing), and recovers from almost all syntax

gpr_query and the parser are provided as Ada source code that must be
compiled and installed:

cd ~/.emacs.d/elpa/ada-mode-i.j.k
./ can take an option "--prefix=<dir>" to set the installation

See section Installation for more information on
installing; you may need additional packages.

Ada mode will be automatically loaded when you open a file
with a matching extension (default *.ads, *.adb).

Ada mode uses project files to define large (multi-directory)
projects, and to define casing exceptions.

See for help on using and customizing Ada mode.

Old versions

ada-mode-6.2.1.tar2019-Aug-185.68 MiB
ada-mode-6.2.0.tar2019-Aug-175.66 MiB
ada-mode-6.1.1.tar2019-Jul-126.21 MiB
ada-mode-6.1.0.tar2019-Mar-225.95 MiB
ada-mode-6.0.1.tar2018-Dec-086.47 MiB
ada-mode-6.0.0.tar2018-Dec-0343.8 MiB
ada-mode-5.3.2.tar2018-Nov-141.58 MiB
ada-mode-5.3.1.tar2017-Oct-031.58 MiB
ada-mode-5.2.2.tar2017-Jul-091.57 MiB
ada-mode-5.2.1.tar2016-Oct-311.17 MiB
ada-mode-5.2.0.tar2016-Jul-271.17 MiB
ada-mode-5.1.9.tar2016-Jan-221.14 MiB
ada-mode-5.1.8.tar2015-Apr-131.14 MiB
ada-mode-5.1.7.tar2014-Nov-271.14 MiB
ada-mode-5.1.6.tar2014-Sep-291.11 MiB
ada-mode-5.1.5.tar2014-Jul-191.10 MiB
ada-mode-5.1.4.tar2014-May-271.03 MiB
ada-mode-5.1.3.tar2014-Apr-201.02 MiB
ada-mode-5.1.1.tar2014-Mar-151010 KiB
ada-mode-5.1.0.tar2014-Mar-141010 KiB
ada-mode-5.0.1.tar2014-Feb-03 990 KiB
ada-mode-5.0.tar2013-Dec-25 980 KiB


GNU Emacs Ada mode NEWS -- history of user-visible changes.

Copyright (C) 2014 - 2020 Free Software Foundation, Inc.

Please send ada-mode bug reports to, with
'ada-mode' in the subject. If possible, use M-x report-emacs-bug.

* Ada Mode 7.0.1
30 Jan 2020

** fix packaging bugs

** is now split into and; the latter
   takes --prefix and may need to be run as root.

** improve xref integration

* Ada Mode 7.0.0
19 Dec 2019

** parser Ada language protocol version 3

** Added support for the Ada 2020 features
   iterated_component_association (ai12-0061), target_name
   (ai12-0125), delta_aggregate (ai12-0127); these are supported in
   GNAT Community 2019.

** Major restructuring of code, moving many functions from ada-mode to
   wisi for use in other language modes, and using cl-defgeneric
   dispatching instead of function variables. Normal users should see
   no changes, except that some ada-mode functions will warn about
   being obsolete. If you've written custom code that depends on
   ada-mode functions, you may have to change it.

** gpr-mode fully supports auto-casing; new user variables
   gpr-auto-case, gpr-case-keyword, gpr-case-strict,
   gpr-case-identifier, respects 'casing' project file settings.

** New commands `wisi-goto-containing-statement-start',
   `wisi-indent-containing-statement' are in the menu.
   `wisi-indent-containing-statement' is bound to 'C-c S-i'.

** `ada-goto-declarative-region-start' now goes to the containing
   region, when the start point is before the 'is' in the current
   declaration (previously, it went to the declarative region of the
   current declaration). This is required for adding a use_clause for
   an identifier/operator in a format_part or aspect_clause.

** Delete not-upper-case setting for ada-auto-case; instead, set
   ada-case-strict to nil.

** wisi-prj-identifier-at-point (previously ada-identifier-at-point)
   now handles non-ASCII characters.

* Ada Mode 6.2.1
17 Aug 2019

** fix packaging bugs

* Ada Mode 6.2.0
13 Aug 2019

** parser Ada language protocol version 2

** The elisp parser is deleted; only the Ada process parser is

** New Ada menu entry "Refactor" supports converting between
   Object.Method (...) and Method (Object, ...), and between Object
   (Index) and Element (Object, Index). The same commands are on a
   menu shown by `ada-refactor-menu-popup', which may be bound to a
   keystroke or mouseclick.

** Ada mode now provides a project.el backend, in ada-project.el.
   `project-find-file' does file name completion on files in the
   current project, using the `uniquify-files' completion style. To
   use this backend with an existing Ada mode project file:

   (setq ada-project-current (make-ada-project :ada-prj-file <exising-file.prj>))
   (add-to-list 'project-find-functions #'ada-project-current)

   You may want to define other functions for project-find-functions.

* Ada Mode 6.1.1
11 Jul 2019

** parser Ada language protocol version 1
** parser gpr language protocol version 1

** ada-auto-case can now take the value `not-upper-case'; typed words
   that are all upper case are not adjusted.

** which-function-mode in large Ada buffers now uses partial parse;
   the new user variable `ada-which-func-parse-size' sets the minimum
   region to parse, centered on point. It should be set to the largest
   subprogram size that parses in an acceptable time.

** gpr-mode supports new gpr syntax "at n" in an attribute specification.

** The ada-mode xref backend now includes object names in the local
   file name completion table.

* Ada mode 6.1.0
21 Mar 2019

** Add support for partial parsing; useful in very large files. Files
   larger than wisi-partial-parse-threshold (default 100_001) will be
   parsed partially. In general, partial parsing may yield incorrect
   results for indentation; the Ada menu entry
   "Edit | Indent lines in file" will parse the entire file and indent

** Better error correction in the Ada process parser; insert minimimal
  tokens to complete a statement/declaration before or after the error

** New indent option: 'ada-indent-after-trailing-comment' If t (the
 default), align comment lines imediately following a comment on the
 same line as code with the preceding comment. Otherwise, ignore the
 preceding comment.

** Delete support for the GPS backend; no need, given partial parsing
   and error correction.

** Miscellaneous bug fixes.

* Ada mode 6.0.1
8 Dec 2018

** Compress ada_lr1_parse_table.txt

** Assign copyright in Ada files to FSF

* Ada mode 6.0.0
17 Nov 2018

** Use wisi 2.0; indentation computed directly in parser actions. This
   has a few user visible changes in indention, making it more
   consistent. It also makes it faster, so larger files are handled
   more smoothly.

** Support wisitoken generated Ada code parser, with error correction.
   The parser runs in a background process.

** ada-fix-compiler-error can now fix errors reported by the
   background process parser.

** ada-format-paramlist repairs syntax errors in buffer text before scanning.

** Display marks in fringe at location of errors detected by
   background parser.

** Colorization of type and package names is somewhat improved, but
   requires full name resolution to get fully correct.

** new user option: ada-end-name-optional, default nil. If non-nil,
   names at ends of blocks/subprograms are optional (as in standard
   Ada). Setting this nil matches standard AdaCore style, and
   significantly improves error correction in the parser (it can use
   name matching to locate errors).

** new user setting: ada-process-parse-exec,
   ada-process-parse-exec-opts, gpr-process-parse-exec,
   gpr-process-parse-exec-opts: the executable and options to run the
   external parser for Ada and gpr modes. Default to the executables
   built by the script included in the ELPA package, empty

   A useful setting for -exec-opts is '("--recover-log" "<log file
   name>"); this will log every error recovery to a file, so you can
   examine how well it is working.

** new user setting: ada-parser; must be one of 'elisp, 'process.
   Defaults to 'process if the executable named by
   ada-process-parse-exec is found, 'elisp otherwise.

** new user setting: ada-fallback; must be one of nil, 'simple or
   'gps. Identifies fallback indentation algorithm used when parser
   fails; 'simple is "indent to previous line", 'gps is "use the gps
   indent engine". nil means set to 'gps if the executable named by
   ada-gps-indent-exec is found.

** new user command: ada-refresh-prj-file. Useful when the project
   file has been edited.

** Implement an xref backend for Ada, using gpr-query. See (info
   "(emacs) Xref").

** The various "find other file" commands assume the use of the Gnu
   ELPA package other-frame-window; they no longer provide "other
   window" options.

** ada-xref-refresh (bound to "menu | Ada | Misc | refresh cross
   reference cache", C-c C-q) now takes a prefix arg to delete the
   xref files first as well. Useful when compiler options or version
   have changed.

* Ada mode 5.3.1
3 Oct 2017

** Ada mode 5.2.2 should have been numbered 5.3.0, since it introduced
   the GPS indentation backend major feature.

** GNAT GPL 2017 is supported for gpr_query and ada_mode_gps_indent;
   see for installation instructions.

** New Ada-mode submenu "Select Project" lists all loaded Ada-mode
   project, making it easier to switch between them.

** New Ada-mode menu entry "Delete project..." allows deleting a
   loaded project, to reduce clutter in the new "Select Project"

** `ada-add-log-for-current-function' (for a revision control commit)
   will return a type name. However, `ada-which-function' will not.

** New option `ada-fill-comment-adaptive', if non-nil, causes all
   comments to be filled to the same width, rather than to the same
   column. This looks better in deeply nested code.

** When 'ada-auto-case' is nil, 'ada-case-adjust-at-point' used to do
   nothing; it now capitalizes the word at point. This helps with some
   alternate casing styles.

** Improve handling of GPR_PROJECT_PATH in 'compilation-environment'
   when selecting/deselection ada-mode project files.

** ada-gnat-xref-all (used by ada-show-references) now preserves point
   when appending more references.

** Minor bug fixes.

* Ada mode 5.2.2
9 Jul 2017

** GNAT GPL 2017 is _not_ supported for gpr_query; GNAT GPL 2016 is

** New option ada-indent-hanging-rel-exp; if non-nil, indent hanging
   lines relative to start of expression. Otherwise, indent relative
   to previous line. Default nil.

** xref-ada allows entering an identifier to search for with
   completion. The search is only in the current file.

** ada-show-references, ada-show-local-references now take an 'append'
   argument, set by interactive prefix; if non-nil, preserve previous
   output in references buffer.

** Support GPS indentation engine, either as primary or backup. See
   user guide for how to set it up; it requires compiling Ada code.

** ada_mode_gps_indent patch level 001 fixes ada-gps bugs 2, 6. See
   test/ada-gps for bug descriptions/tests.

** ada-identifier-at-point properly handles adjacent operator and
   identifier (ie +Tree).

** When a 'use type' clause is inserted by the compile error
   correction code, 'use all type' is inserted if the lanuage version
   is 2012 (the default).

** The context menu is simplified.

** The 'obj_dir' project variable is supported.

** ada-next-statement-keyword, ada-prev-statement-keyword are deleted;
   use forward-sexp instead.

** The license inserted by ada-skel-modified-gpl uses GPL version 3

** Several indentation bugs are fixed.

** New option ada-gnat-debug-run controls echoing GNAT commands in
   GNAT buffers.

* Ada mode 5.2.1
31 Oct 2016

** A line starting with '(' is now always indented with
   ada-indent-broken. Previously, in some cases it was indented by
   ada-indent - 1. Since the defaults set ada-indent = 3,
   ada-indent-broken = 2, this is transparent unless you use other

** GPR_PROJECT_PATH is set in the compilation process environment when
   the Ada project is selected, and cleared when the project is
   deselected. This allows selecting other Emacs projects, then
   returning to an Ada project.

** New function ada-show-local-references (bound to C-c C-l) searches
   for references within the current file only.

** New option ada-xref-full-path (default nil) if t, shows full paths
   in cross references.

** The indentation functions are significantly rewritten to make them
   better organized and easier to understand and maintain. This
   resulted in some minor indentation changes, mostly for consistency;
   in particular, case expressions are indented by ada-indent-broken,
   to match if espressions.

* Ada mode 5.2.0
26 Jul 2016

** GNAT 2016 drops support for 'gnat find'; users must use gpr_query.

** ada-xref-tool now defaults to gpr_query if gpr_query executable is
   found in PATH.

** source code for compiling gpr_query is installed with the Gnu ELPA
   package; instructions for compiling and installing it are in

** better handling of cross-compile targets.

** Allow trailing label in a sequence_of_statements:
      goto Next;
   end loop;

** Handle package aspects.

** tested with GNAT GPL 2016.

** several bug fixes

* Ada mode 5.1.9
20 Jan 2016

** New option ada-indent-comment-gnat matches the GNAT style check for
   comments in all cases (previously, there were some cases where the
   comment indent algorithm did not match the GNAT check).

** New menu command "Show source file search path"; displays
   compilation-search-path in a buffer.

** Adding missing grammar statements to allow removing parens around
   conditional and quantified expressions.

** Key binding for ada-case-create-partial-exception in ada-mode
   changed to C-c C-M-y; this is easier to type, and matches the key
   binding in gpr-mode.

** ada-case-keyword changed to accept the symbols 'lower-case,
   'upper-case instead of the functions downcase-word, upcase-word.

** ada-case-identifier changed to accept the symbols 'mixed-case,
   'lower-case, 'upper-case instead of the functions 'ada-mixed-case,
   'ada-lower-case, 'ada-upper-case.

** ada-fix-add-context-clause now sorts "limited with" and "private
   with" clauses after other clauses.

** ada-align now aligns '=>' in case expressions.

** ada-align-paramlist now handles access function parameters:

   procedure Choose
     (X, Y, Z    :        Integer;
      Preference : access function (A, B : Integer) return Boolean);

** ada-next-statement-keyword now moves to matching close paren if on
   open paren, ada-prev-statement-keyword moves from close paren to
   open paren.

** New hook ada-prj-parse-hook, run from ada-parse-prj-file.

** GPR mode now does case adjust similar to Ada mode.

** gpr parser handles nested case statements without blowing up.

** gpr parser handles package renames

** fix other bugs

* Ada mode 5.1.8
10 Apr 2015

** requires OpenToken 6.0

** ada-align handle identifiers that start with Ada keywords

** functions for ada-case-identifier now take three args: start, end,

** parsing is not required by find-other-file if the current buffer is
   larger than wisi-size-threshold

** fix misc bugs

* Ada mode 5.1.7
18 Nov 2014

** add ada-find-file that prompts for a file from the current project,
   with completion.

** fix bug that prevented
    Y : Boolean := Boolean'(if True then False);

** add ada-create-select-default-prj, to simplify working with small

** Handle deleting whitespace between words, inserting whitespace in
   the middle of a word properly.

** Change ada-case-adjust to capitalize words in comments and strings
   by default; C-u adjusts case as if code.

** allow 'raise' in expressions for GNAT GPL 2014 aspects

** move all except keyword face highighting to grammar; much more
   accurate, easier to maintain, simpler, faster.

** delete gnatinspect support; gpr_query is better

** misc bug fixes

* Ada mode 5.1.6
28 Sep 2014

** improve syntax highlighting of names after 'of', 'new', 'renames'

** fix ada-format-paramlist to handle 'aliased' keyword (new in Ada
   2012), and 'not null' without 'access'.

** fix ada-find-other-file in separate bodies; now navigates to the

** restore ada-indent-newline-indent for [return]

* Ada mode 5.1.5
12 Jul 2014

** add C-c <, C-c >; goto-declaration-start, -end

** improve parsing speed significantly

* Ada mode 5.1.4
26 May 2014

** support expression functions

** beginning-of-defun-function, end-of-defun-function are now set. A
   "defun" is a generic, package, protected, subprogram, or task spec
   or body.

** C-c C-s is now bound to ada-goto-previous-pos, which goes to the
   first position in ada-goto-pos-ring. Most navigation functions set
   ada-goto-pos-ring. This allows easy navigation back to the start of
   a cross-reference chain.

** xref tool error handlers no longer show the xref tool buffer; the
   new Ada menu item 'show xref tool buffer' can be used instead.

** The parser supports more deeply nested case statements.

* Ada mode 5.1.3
19 Apr 2014

** more GNAT error message auto-fixes

** support aspects on subprogram declarations; format same as SPARK examples.

** fix bug in ada-syntax-propertize that caused query-replace to screw up

** inhibit reparse due to case adjust; case adjust entire buffer is
   now _much_ faster.

** Non-ASCII characters supported in Ada mode buffers, including GNAT
   bracket notation.

* Ada mode 5.1.2
16 Mar 2014

** fix another packaging bug; forgot to add files to ELPA git!

* Ada mode 5.1.1
14 Mar 2014

** require wisi-1.0.2, to fix packaging bug

** gnat-find now called with -a to include read-only .ali files in the results.

* Ada mode 5.1.0
13 Mar 2014

** Emacs 24.2 supported, via cl-lib in Gnu ELPA

** Better handling of aspects.

** 'record' is aligned with 'type' in derived types

** Several minor indentation bugs have been fixed.

** Added "2.2 Upgrading from previous versions" to the user guide.

** ada-align now properly handles subprograms with the opening paren
   on the same line as the preceding code and code on the same line as
   the closing paren:

    function Foo (Param_1 : Integer;
                  Param_2 : Integer) return Integer;

** When no project file is selected, the default variables are
   consistently used instead. Previously, the default variables were
   only used when parsing a project file.

** info files are properly visible in main info menu

** 'C-c ;' used to run `comment-dim', which is bound to 'M-;' in the
   global keymap. 'C-c ;' now gives an error with a message saying
   'use M-; instead'.

* Ada mode 5.0.1
Feb 2 2014

First public release, via ELPA

* Ada mode 5.0.0
Dec 24 2013

** first release in ELPA

** Previous version was 4.00, in Emacs core. 5.0.1 is a complete
   rewrite, using a generalized LALR parser that caches syntactic
   information in text properties.