2006-10-31 00:57:56 +00:00
|
|
|
;; ada-xref.el --- for lookup and completion in Ada mode
|
1999-10-07 14:25:59 +00:00
|
|
|
|
2005-08-01 08:43:45 +00:00
|
|
|
;; Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003,
|
2006-02-10 09:00:31 +00:00
|
|
|
;; 2004, 2005, 2006 Free Software Foundation, Inc.
|
1999-10-07 14:25:59 +00:00
|
|
|
|
|
|
|
;; Author: Markus Heritsch <Markus.Heritsch@studbox.uni-stuttgart.de>
|
|
|
|
;; Rolf Ebert <ebert@inf.enst.fr>
|
|
|
|
;; Emmanuel Briot <briot@gnat.com>
|
2006-10-31 00:57:56 +00:00
|
|
|
;; Maintainer: Stephen Leake <stephen_leake@stephe-leake.org>
|
1999-10-07 14:25:59 +00:00
|
|
|
;; Keywords: languages ada xref
|
|
|
|
|
2001-07-11 10:21:04 +00:00
|
|
|
;; This file is part of GNU Emacs.
|
1999-10-07 14:25:59 +00:00
|
|
|
|
2001-07-13 12:59:13 +00:00
|
|
|
;; GNU Emacs is free software; you can redistribute it and/or modify
|
1999-10-07 14:25:59 +00:00
|
|
|
;; it under the terms of the GNU General Public License as published by
|
|
|
|
;; the Free Software Foundation; either version 2, or (at your option)
|
|
|
|
;; any later version.
|
|
|
|
|
2001-07-13 12:59:13 +00:00
|
|
|
;; GNU Emacs is distributed in the hope that it will be useful,
|
1999-10-07 14:25:59 +00:00
|
|
|
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
;; GNU General Public License for more details.
|
|
|
|
|
|
|
|
;; You should have received a copy of the GNU General Public License
|
2001-07-13 12:59:13 +00:00
|
|
|
;; along with GNU Emacs; see the file COPYING. If not, write to the
|
2005-07-04 17:55:18 +00:00
|
|
|
;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
|
|
|
;; Boston, MA 02110-1301, USA.
|
1999-10-07 14:25:59 +00:00
|
|
|
|
|
|
|
;;; Commentary:
|
|
|
|
;;; This Package provides a set of functions to use the output of the
|
|
|
|
;;; cross reference capabilities of the GNAT Ada compiler
|
|
|
|
;;; for lookup and completion in Ada mode.
|
|
|
|
;;;
|
|
|
|
;;; If a file *.`adp' exists in the ada-file directory, then it is
|
2004-08-22 17:14:02 +00:00
|
|
|
;;; read for configuration informations. It is read only the first
|
1999-10-07 14:25:59 +00:00
|
|
|
;;; time a cross-reference is asked for, and is not read later.
|
|
|
|
|
|
|
|
;;; You need Emacs >= 20.2 to run this package
|
|
|
|
|
2006-10-31 00:57:56 +00:00
|
|
|
|
|
|
|
;;; History:
|
|
|
|
;;
|
|
|
|
|
2001-07-16 07:46:48 +00:00
|
|
|
;;; Code:
|
|
|
|
|
1999-10-07 14:25:59 +00:00
|
|
|
;; ----- Requirements -----------------------------------------------------
|
|
|
|
|
|
|
|
(require 'compile)
|
|
|
|
(require 'comint)
|
2003-05-04 19:54:00 +00:00
|
|
|
(require 'find-file)
|
|
|
|
(require 'ada-mode)
|
1999-10-07 14:25:59 +00:00
|
|
|
|
2006-10-31 00:57:56 +00:00
|
|
|
;; ------ User variables
|
1999-10-07 14:25:59 +00:00
|
|
|
(defcustom ada-xref-other-buffer t
|
1999-10-28 11:12:54 +00:00
|
|
|
"*If nil, always display the cross-references in the same buffer.
|
|
|
|
Otherwise create either a new buffer or a new frame."
|
1999-10-07 14:25:59 +00:00
|
|
|
:type 'boolean :group 'ada)
|
|
|
|
|
Update copyright notice.
(ada-xref-create-ali): The default is now not to create automatically the
ALI files by compiling the unit, since this isn't always reliable and
requires an up-to-date project file.
(ada-prj-default-comp-cmd): No longer use gcc directly to compile
a file, but use gnatmake instead, since this gives access to the GNAT
project files.
(ada-xref-search-with-egrep): New variable, suggested by P. Waroquiers.
(ada-load-project-hook): New variable, for support of GNAT project files.
(ada-update-project-menu): Fix the detection of the project file name.
(ada-add-keymap): Change key binding for ada-find-file, that conflicted
with another binding in ada-mode.el.
(ada-add-menu): New menu "List Local References", to list the reference
to the entity only in the current file, instead of looking in the whole
project. Much faster.
(ada-find-references): New parameters arg and local-only.
(ada-find-any-references): New parameters local-only and append.
(ada-goto-declaration): Fix handling of predefined entities in xref.
(ada-get-all-references): Updated to the new xref format in GNAT 3.15,
still compatible with GNAT 3.14 of course. Fix various calls to
count-lines, that didn't work correctly when the buffer was narrowed.
2002-06-20 17:31:56 +00:00
|
|
|
(defcustom ada-xref-create-ali nil
|
1999-10-28 11:12:54 +00:00
|
|
|
"*If non-nil, run gcc whenever the cross-references are not up-to-date.
|
2004-08-22 17:14:02 +00:00
|
|
|
If nil, the cross-reference mode never runs gcc."
|
1999-10-07 14:25:59 +00:00
|
|
|
:type 'boolean :group 'ada)
|
|
|
|
|
|
|
|
(defcustom ada-xref-confirm-compile nil
|
2006-10-31 00:57:56 +00:00
|
|
|
"*Non-nil means ask for confirmation before compiling or running the application."
|
1999-10-07 14:25:59 +00:00
|
|
|
:type 'boolean :group 'ada)
|
|
|
|
|
|
|
|
(defcustom ada-krunch-args "0"
|
2004-08-22 17:14:02 +00:00
|
|
|
"*Maximum number of characters for filenames created by `gnatkr'.
|
|
|
|
Set to 0, if you don't use crunched filenames. This should be a string."
|
1999-10-07 14:25:59 +00:00
|
|
|
:type 'string :group 'ada)
|
|
|
|
|
2003-04-29 23:40:08 +00:00
|
|
|
(defcustom ada-gnatls-args '("-v")
|
2004-08-22 17:14:02 +00:00
|
|
|
"*Arguments to pass to `gnatfind' to find location of the runtime.
|
|
|
|
Typical use is to pass `--RTS=soft-floats' on some systems that support it.
|
2003-04-29 23:40:08 +00:00
|
|
|
|
2004-08-22 17:14:02 +00:00
|
|
|
You can also add `-I-' if you do not want the current directory to be included.
|
2003-04-29 23:40:08 +00:00
|
|
|
Otherwise, going from specs to bodies and back will first look for files in the
|
2004-08-22 17:14:02 +00:00
|
|
|
current directory. This only has an impact if you are not using project files,
|
2003-04-29 23:40:08 +00:00
|
|
|
but only ADA_INCLUDE_PATH."
|
|
|
|
:type '(repeat string) :group 'ada)
|
|
|
|
|
2002-04-09 18:54:20 +00:00
|
|
|
(defcustom ada-prj-default-comp-opt "-gnatq -gnatQ"
|
Got rid of all byte-compiler warnings on Emacs.
Add to the menu when the file is loaded, not in ada-mode-hook.
Add -toolbar to the default ddd command Switches moved from
ada-prj-default-comp-cmd and ada-prj-default-make-cmd to
ada-prj-default-comp-opt
(ada-add-ada-menu): Remove the map and name parameters Add the Ada
Reference Manual to the menu
(ada-check-current): rewritten as a call to ada-compile-current
(ada-compile): Removed.
(ada-compile-application, ada-compile-current, ada-check-current):
Set the compilation-search-path so that compile.el automatically
finds the sources in src_dir. Automatic scrollong of the
compilation buffer. C-uC-cC-c asks for confirmation before
compiling
(ada-compile-current): New parameter, prj-field
(ada-complete-identifier): Load the .ali file before doing
processing
(ada-find-ali-file-in-dir): prepend build_dir to obj_dir to
conform to gnatmake's behavior.
(ada-find-file-in-dir): New function
(ada-find-references): Set the environment variables for gnatfind
(ada-find-src-file-in-dir): New function.
(ada-first-non-nil): Removed
(ada-gdb-application): Add support for jdb, the java debugger.
(ada-get-ada-file-name): Load the original-file first if not done
yet.
(ada-get-all-references): Handles the new ali syntax (parent types
are found between <>).
(ada-initialize-runtime-library): New function
(ada-mode-hook): Always load a project file when a file is opened,
so that the casing exceptions are correctly read.
(ada-operator-re): Add all missing operators ("abs", "rem", "**").
(ada-parse-prj-file): Use find-file-noselect instead of find-file
to open the project file, since the latter does not work with
speedbar Get default values before loading the prj file, or the
default executable file name is wrong. Use the absolute value of
src_dir to initialize ada-search-directories and
compilation-search-path,... Add the standard runtime library to
the search path for find-file.
(ada-prj-default-debugger): Was missing an opening '{'
(ada-prj-default-bind-opt, ada-prj-default-link-opt): New
variables.
(ada-prj-default-gnatmake-opt): New variable
(ada-prj-find-prj-file): Handles non-file buffers For non-Ada
buffers, the project file is the default one Save the windows
configuration before displaying the menu.
(ada-prj-src-dir, ada-prj-obj-dir, ada-prj-comp-opt,...): Removed
(ada-read-identifier): Fix xrefs on operators (for "mod", "and",
...) regexp-quote identifiers names to support operators +,
-,... in regexps.
(ada-remote): New function.
(ada-run-application): Erase the output buffer before starting the
run Support remote execution of the application. Use
call-process, or the arguments are incorrectly parsed
(ada-set-default-project-file): Reread the content of the active
project file, not the one from the current buffer When a project
file is set as the default project, all directories are
automatically associated with it.
(ada-set-environment): New function
(ada-treat-cmd-string): New special variable ${current}
(ada-treat-cmd-string): Revised. The substitution is now done for
any ${...} substring
(ada-xref-current): If no body was found, compiles the spec
instead. Setup ADA_{SOURCE,OBJECTS}_PATH before running the
compiler to get rid of command line length limitations.
(ada-xref-get-project-field): New function
(ada-xref-project-files): New variable
(ada-xref-runtime-library-specs-path)
(ada-xref-runtime-library-ali-path): New variables
(ada-xref-set-default-prj-values): Default run command now does a
cd to the build directory. New field: main_unit Provide a default
file name even if the current buffer has no prj file.
2000-07-24 11:13:11 +00:00
|
|
|
"Default compilation options."
|
|
|
|
:type 'string :group 'ada)
|
|
|
|
|
|
|
|
(defcustom ada-prj-default-bind-opt ""
|
|
|
|
"Default binder options."
|
|
|
|
:type 'string :group 'ada)
|
|
|
|
|
|
|
|
(defcustom ada-prj-default-link-opt ""
|
|
|
|
"Default linker options."
|
|
|
|
:type 'string :group 'ada)
|
|
|
|
|
|
|
|
(defcustom ada-prj-default-gnatmake-opt "-g"
|
2004-08-22 17:14:02 +00:00
|
|
|
"Default options for `gnatmake'."
|
Got rid of all byte-compiler warnings on Emacs.
Add to the menu when the file is loaded, not in ada-mode-hook.
Add -toolbar to the default ddd command Switches moved from
ada-prj-default-comp-cmd and ada-prj-default-make-cmd to
ada-prj-default-comp-opt
(ada-add-ada-menu): Remove the map and name parameters Add the Ada
Reference Manual to the menu
(ada-check-current): rewritten as a call to ada-compile-current
(ada-compile): Removed.
(ada-compile-application, ada-compile-current, ada-check-current):
Set the compilation-search-path so that compile.el automatically
finds the sources in src_dir. Automatic scrollong of the
compilation buffer. C-uC-cC-c asks for confirmation before
compiling
(ada-compile-current): New parameter, prj-field
(ada-complete-identifier): Load the .ali file before doing
processing
(ada-find-ali-file-in-dir): prepend build_dir to obj_dir to
conform to gnatmake's behavior.
(ada-find-file-in-dir): New function
(ada-find-references): Set the environment variables for gnatfind
(ada-find-src-file-in-dir): New function.
(ada-first-non-nil): Removed
(ada-gdb-application): Add support for jdb, the java debugger.
(ada-get-ada-file-name): Load the original-file first if not done
yet.
(ada-get-all-references): Handles the new ali syntax (parent types
are found between <>).
(ada-initialize-runtime-library): New function
(ada-mode-hook): Always load a project file when a file is opened,
so that the casing exceptions are correctly read.
(ada-operator-re): Add all missing operators ("abs", "rem", "**").
(ada-parse-prj-file): Use find-file-noselect instead of find-file
to open the project file, since the latter does not work with
speedbar Get default values before loading the prj file, or the
default executable file name is wrong. Use the absolute value of
src_dir to initialize ada-search-directories and
compilation-search-path,... Add the standard runtime library to
the search path for find-file.
(ada-prj-default-debugger): Was missing an opening '{'
(ada-prj-default-bind-opt, ada-prj-default-link-opt): New
variables.
(ada-prj-default-gnatmake-opt): New variable
(ada-prj-find-prj-file): Handles non-file buffers For non-Ada
buffers, the project file is the default one Save the windows
configuration before displaying the menu.
(ada-prj-src-dir, ada-prj-obj-dir, ada-prj-comp-opt,...): Removed
(ada-read-identifier): Fix xrefs on operators (for "mod", "and",
...) regexp-quote identifiers names to support operators +,
-,... in regexps.
(ada-remote): New function.
(ada-run-application): Erase the output buffer before starting the
run Support remote execution of the application. Use
call-process, or the arguments are incorrectly parsed
(ada-set-default-project-file): Reread the content of the active
project file, not the one from the current buffer When a project
file is set as the default project, all directories are
automatically associated with it.
(ada-set-environment): New function
(ada-treat-cmd-string): New special variable ${current}
(ada-treat-cmd-string): Revised. The substitution is now done for
any ${...} substring
(ada-xref-current): If no body was found, compiles the spec
instead. Setup ADA_{SOURCE,OBJECTS}_PATH before running the
compiler to get rid of command line length limitations.
(ada-xref-get-project-field): New function
(ada-xref-project-files): New variable
(ada-xref-runtime-library-specs-path)
(ada-xref-runtime-library-ali-path): New variables
(ada-xref-set-default-prj-values): Default run command now does a
cd to the build directory. New field: main_unit Provide a default
file name even if the current buffer has no prj file.
2000-07-24 11:13:11 +00:00
|
|
|
:type 'string :group 'ada)
|
|
|
|
|
2002-04-09 18:54:20 +00:00
|
|
|
(defcustom ada-prj-gnatfind-switches "-rf"
|
2004-08-22 17:14:02 +00:00
|
|
|
"Default switches to use for `gnatfind'.
|
|
|
|
You should modify this variable, for instance to add `-a', if you are working
|
2002-04-09 18:54:20 +00:00
|
|
|
in an environment where most ALI files are write-protected.
|
2004-08-22 17:14:02 +00:00
|
|
|
The command `gnatfind' is used every time you choose the menu
|
2002-04-09 18:54:20 +00:00
|
|
|
\"Show all references\"."
|
|
|
|
:type 'string :group 'ada)
|
|
|
|
|
1999-10-28 11:12:54 +00:00
|
|
|
(defcustom ada-prj-default-comp-cmd
|
Update copyright notice.
(ada-xref-create-ali): The default is now not to create automatically the
ALI files by compiling the unit, since this isn't always reliable and
requires an up-to-date project file.
(ada-prj-default-comp-cmd): No longer use gcc directly to compile
a file, but use gnatmake instead, since this gives access to the GNAT
project files.
(ada-xref-search-with-egrep): New variable, suggested by P. Waroquiers.
(ada-load-project-hook): New variable, for support of GNAT project files.
(ada-update-project-menu): Fix the detection of the project file name.
(ada-add-keymap): Change key binding for ada-find-file, that conflicted
with another binding in ada-mode.el.
(ada-add-menu): New menu "List Local References", to list the reference
to the entity only in the current file, instead of looking in the whole
project. Much faster.
(ada-find-references): New parameters arg and local-only.
(ada-find-any-references): New parameters local-only and append.
(ada-goto-declaration): Fix handling of predefined entities in xref.
(ada-get-all-references): Updated to the new xref format in GNAT 3.15,
still compatible with GNAT 3.14 of course. Fix various calls to
count-lines, that didn't work correctly when the buffer was narrowed.
2002-06-20 17:31:56 +00:00
|
|
|
(concat "${cross_prefix}gnatmake -u -c ${gnatmake_opt} ${full_current} -cargs"
|
|
|
|
" ${comp_opt}")
|
1999-10-07 14:25:59 +00:00
|
|
|
"*Default command to be used to compile a single file.
|
2006-10-31 00:57:56 +00:00
|
|
|
Emacs will substitute the current filename for ${full_current}, or add
|
|
|
|
the filename at the end. This is the same syntax as in the project file."
|
Got rid of all byte-compiler warnings on Emacs.
Add to the menu when the file is loaded, not in ada-mode-hook.
Add -toolbar to the default ddd command Switches moved from
ada-prj-default-comp-cmd and ada-prj-default-make-cmd to
ada-prj-default-comp-opt
(ada-add-ada-menu): Remove the map and name parameters Add the Ada
Reference Manual to the menu
(ada-check-current): rewritten as a call to ada-compile-current
(ada-compile): Removed.
(ada-compile-application, ada-compile-current, ada-check-current):
Set the compilation-search-path so that compile.el automatically
finds the sources in src_dir. Automatic scrollong of the
compilation buffer. C-uC-cC-c asks for confirmation before
compiling
(ada-compile-current): New parameter, prj-field
(ada-complete-identifier): Load the .ali file before doing
processing
(ada-find-ali-file-in-dir): prepend build_dir to obj_dir to
conform to gnatmake's behavior.
(ada-find-file-in-dir): New function
(ada-find-references): Set the environment variables for gnatfind
(ada-find-src-file-in-dir): New function.
(ada-first-non-nil): Removed
(ada-gdb-application): Add support for jdb, the java debugger.
(ada-get-ada-file-name): Load the original-file first if not done
yet.
(ada-get-all-references): Handles the new ali syntax (parent types
are found between <>).
(ada-initialize-runtime-library): New function
(ada-mode-hook): Always load a project file when a file is opened,
so that the casing exceptions are correctly read.
(ada-operator-re): Add all missing operators ("abs", "rem", "**").
(ada-parse-prj-file): Use find-file-noselect instead of find-file
to open the project file, since the latter does not work with
speedbar Get default values before loading the prj file, or the
default executable file name is wrong. Use the absolute value of
src_dir to initialize ada-search-directories and
compilation-search-path,... Add the standard runtime library to
the search path for find-file.
(ada-prj-default-debugger): Was missing an opening '{'
(ada-prj-default-bind-opt, ada-prj-default-link-opt): New
variables.
(ada-prj-default-gnatmake-opt): New variable
(ada-prj-find-prj-file): Handles non-file buffers For non-Ada
buffers, the project file is the default one Save the windows
configuration before displaying the menu.
(ada-prj-src-dir, ada-prj-obj-dir, ada-prj-comp-opt,...): Removed
(ada-read-identifier): Fix xrefs on operators (for "mod", "and",
...) regexp-quote identifiers names to support operators +,
-,... in regexps.
(ada-remote): New function.
(ada-run-application): Erase the output buffer before starting the
run Support remote execution of the application. Use
call-process, or the arguments are incorrectly parsed
(ada-set-default-project-file): Reread the content of the active
project file, not the one from the current buffer When a project
file is set as the default project, all directories are
automatically associated with it.
(ada-set-environment): New function
(ada-treat-cmd-string): New special variable ${current}
(ada-treat-cmd-string): Revised. The substitution is now done for
any ${...} substring
(ada-xref-current): If no body was found, compiles the spec
instead. Setup ADA_{SOURCE,OBJECTS}_PATH before running the
compiler to get rid of command line length limitations.
(ada-xref-get-project-field): New function
(ada-xref-project-files): New variable
(ada-xref-runtime-library-specs-path)
(ada-xref-runtime-library-ali-path): New variables
(ada-xref-set-default-prj-values): Default run command now does a
cd to the build directory. New field: main_unit Provide a default
file name even if the current buffer has no prj file.
2000-07-24 11:13:11 +00:00
|
|
|
:type 'string :group 'ada)
|
|
|
|
|
|
|
|
(defcustom ada-prj-default-debugger "${cross_prefix}gdb"
|
2006-10-31 00:57:56 +00:00
|
|
|
"*Default name of the debugger."
|
1999-10-07 14:25:59 +00:00
|
|
|
:type 'string :group 'ada)
|
|
|
|
|
|
|
|
(defcustom ada-prj-default-make-cmd
|
Got rid of all byte-compiler warnings on Emacs.
Add to the menu when the file is loaded, not in ada-mode-hook.
Add -toolbar to the default ddd command Switches moved from
ada-prj-default-comp-cmd and ada-prj-default-make-cmd to
ada-prj-default-comp-opt
(ada-add-ada-menu): Remove the map and name parameters Add the Ada
Reference Manual to the menu
(ada-check-current): rewritten as a call to ada-compile-current
(ada-compile): Removed.
(ada-compile-application, ada-compile-current, ada-check-current):
Set the compilation-search-path so that compile.el automatically
finds the sources in src_dir. Automatic scrollong of the
compilation buffer. C-uC-cC-c asks for confirmation before
compiling
(ada-compile-current): New parameter, prj-field
(ada-complete-identifier): Load the .ali file before doing
processing
(ada-find-ali-file-in-dir): prepend build_dir to obj_dir to
conform to gnatmake's behavior.
(ada-find-file-in-dir): New function
(ada-find-references): Set the environment variables for gnatfind
(ada-find-src-file-in-dir): New function.
(ada-first-non-nil): Removed
(ada-gdb-application): Add support for jdb, the java debugger.
(ada-get-ada-file-name): Load the original-file first if not done
yet.
(ada-get-all-references): Handles the new ali syntax (parent types
are found between <>).
(ada-initialize-runtime-library): New function
(ada-mode-hook): Always load a project file when a file is opened,
so that the casing exceptions are correctly read.
(ada-operator-re): Add all missing operators ("abs", "rem", "**").
(ada-parse-prj-file): Use find-file-noselect instead of find-file
to open the project file, since the latter does not work with
speedbar Get default values before loading the prj file, or the
default executable file name is wrong. Use the absolute value of
src_dir to initialize ada-search-directories and
compilation-search-path,... Add the standard runtime library to
the search path for find-file.
(ada-prj-default-debugger): Was missing an opening '{'
(ada-prj-default-bind-opt, ada-prj-default-link-opt): New
variables.
(ada-prj-default-gnatmake-opt): New variable
(ada-prj-find-prj-file): Handles non-file buffers For non-Ada
buffers, the project file is the default one Save the windows
configuration before displaying the menu.
(ada-prj-src-dir, ada-prj-obj-dir, ada-prj-comp-opt,...): Removed
(ada-read-identifier): Fix xrefs on operators (for "mod", "and",
...) regexp-quote identifiers names to support operators +,
-,... in regexps.
(ada-remote): New function.
(ada-run-application): Erase the output buffer before starting the
run Support remote execution of the application. Use
call-process, or the arguments are incorrectly parsed
(ada-set-default-project-file): Reread the content of the active
project file, not the one from the current buffer When a project
file is set as the default project, all directories are
automatically associated with it.
(ada-set-environment): New function
(ada-treat-cmd-string): New special variable ${current}
(ada-treat-cmd-string): Revised. The substitution is now done for
any ${...} substring
(ada-xref-current): If no body was found, compiles the spec
instead. Setup ADA_{SOURCE,OBJECTS}_PATH before running the
compiler to get rid of command line length limitations.
(ada-xref-get-project-field): New function
(ada-xref-project-files): New variable
(ada-xref-runtime-library-specs-path)
(ada-xref-runtime-library-ali-path): New variables
(ada-xref-set-default-prj-values): Default run command now does a
cd to the build directory. New field: main_unit Provide a default
file name even if the current buffer has no prj file.
2000-07-24 11:13:11 +00:00
|
|
|
(concat "${cross_prefix}gnatmake -o ${main} ${main_unit} ${gnatmake_opt} "
|
2006-10-31 00:57:56 +00:00
|
|
|
"-cargs ${comp_opt} -bargs ${bind_opt} -largs ${link_opt}")
|
1999-10-07 14:25:59 +00:00
|
|
|
"*Default command to be used to compile the application.
|
|
|
|
This is the same syntax as in the project file."
|
|
|
|
:type 'string :group 'ada)
|
|
|
|
|
|
|
|
(defcustom ada-prj-default-project-file ""
|
2006-10-31 00:57:56 +00:00
|
|
|
"*Name of the current project file.
|
|
|
|
Emacs will not try to use the search algorithm to find the project file if
|
|
|
|
this string is not empty. It is set whenever a project file is found."
|
1999-10-07 14:25:59 +00:00
|
|
|
:type '(file :must-match t) :group 'ada)
|
|
|
|
|
|
|
|
(defcustom ada-gnatstub-opts "-q -I${src_dir}"
|
2004-08-22 17:14:02 +00:00
|
|
|
"*List of the options to pass to `gnatsub' to generate the body of a package.
|
1999-10-28 11:12:54 +00:00
|
|
|
This has the same syntax as in the project file (with variable substitution)."
|
1999-10-07 14:25:59 +00:00
|
|
|
:type 'string :group 'ada)
|
|
|
|
|
|
|
|
(defcustom ada-always-ask-project nil
|
1999-10-28 11:12:54 +00:00
|
|
|
"*If nil, use default values when no project file was found.
|
Got rid of all byte-compiler warnings on Emacs.
Add to the menu when the file is loaded, not in ada-mode-hook.
Add -toolbar to the default ddd command Switches moved from
ada-prj-default-comp-cmd and ada-prj-default-make-cmd to
ada-prj-default-comp-opt
(ada-add-ada-menu): Remove the map and name parameters Add the Ada
Reference Manual to the menu
(ada-check-current): rewritten as a call to ada-compile-current
(ada-compile): Removed.
(ada-compile-application, ada-compile-current, ada-check-current):
Set the compilation-search-path so that compile.el automatically
finds the sources in src_dir. Automatic scrollong of the
compilation buffer. C-uC-cC-c asks for confirmation before
compiling
(ada-compile-current): New parameter, prj-field
(ada-complete-identifier): Load the .ali file before doing
processing
(ada-find-ali-file-in-dir): prepend build_dir to obj_dir to
conform to gnatmake's behavior.
(ada-find-file-in-dir): New function
(ada-find-references): Set the environment variables for gnatfind
(ada-find-src-file-in-dir): New function.
(ada-first-non-nil): Removed
(ada-gdb-application): Add support for jdb, the java debugger.
(ada-get-ada-file-name): Load the original-file first if not done
yet.
(ada-get-all-references): Handles the new ali syntax (parent types
are found between <>).
(ada-initialize-runtime-library): New function
(ada-mode-hook): Always load a project file when a file is opened,
so that the casing exceptions are correctly read.
(ada-operator-re): Add all missing operators ("abs", "rem", "**").
(ada-parse-prj-file): Use find-file-noselect instead of find-file
to open the project file, since the latter does not work with
speedbar Get default values before loading the prj file, or the
default executable file name is wrong. Use the absolute value of
src_dir to initialize ada-search-directories and
compilation-search-path,... Add the standard runtime library to
the search path for find-file.
(ada-prj-default-debugger): Was missing an opening '{'
(ada-prj-default-bind-opt, ada-prj-default-link-opt): New
variables.
(ada-prj-default-gnatmake-opt): New variable
(ada-prj-find-prj-file): Handles non-file buffers For non-Ada
buffers, the project file is the default one Save the windows
configuration before displaying the menu.
(ada-prj-src-dir, ada-prj-obj-dir, ada-prj-comp-opt,...): Removed
(ada-read-identifier): Fix xrefs on operators (for "mod", "and",
...) regexp-quote identifiers names to support operators +,
-,... in regexps.
(ada-remote): New function.
(ada-run-application): Erase the output buffer before starting the
run Support remote execution of the application. Use
call-process, or the arguments are incorrectly parsed
(ada-set-default-project-file): Reread the content of the active
project file, not the one from the current buffer When a project
file is set as the default project, all directories are
automatically associated with it.
(ada-set-environment): New function
(ada-treat-cmd-string): New special variable ${current}
(ada-treat-cmd-string): Revised. The substitution is now done for
any ${...} substring
(ada-xref-current): If no body was found, compiles the spec
instead. Setup ADA_{SOURCE,OBJECTS}_PATH before running the
compiler to get rid of command line length limitations.
(ada-xref-get-project-field): New function
(ada-xref-project-files): New variable
(ada-xref-runtime-library-specs-path)
(ada-xref-runtime-library-ali-path): New variables
(ada-xref-set-default-prj-values): Default run command now does a
cd to the build directory. New field: main_unit Provide a default
file name even if the current buffer has no prj file.
2000-07-24 11:13:11 +00:00
|
|
|
Otherwise, ask the user for the name of the project file to use."
|
|
|
|
:type 'boolean :group 'ada)
|
1999-10-07 14:25:59 +00:00
|
|
|
|
2002-04-09 18:54:20 +00:00
|
|
|
(defconst is-windows (memq system-type (quote (windows-nt)))
|
2004-08-22 17:14:02 +00:00
|
|
|
"True if we are running on Windows NT or Windows 95.")
|
2002-04-09 18:54:20 +00:00
|
|
|
|
|
|
|
(defcustom ada-tight-gvd-integration nil
|
|
|
|
"*If non-nil, a new Emacs frame will be swallowed in GVD when debugging.
|
2004-06-29 13:01:14 +00:00
|
|
|
If GVD is not the debugger used, nothing happens."
|
|
|
|
:type 'boolean :group 'ada)
|
2002-04-09 18:54:20 +00:00
|
|
|
|
Update copyright notice.
(ada-xref-create-ali): The default is now not to create automatically the
ALI files by compiling the unit, since this isn't always reliable and
requires an up-to-date project file.
(ada-prj-default-comp-cmd): No longer use gcc directly to compile
a file, but use gnatmake instead, since this gives access to the GNAT
project files.
(ada-xref-search-with-egrep): New variable, suggested by P. Waroquiers.
(ada-load-project-hook): New variable, for support of GNAT project files.
(ada-update-project-menu): Fix the detection of the project file name.
(ada-add-keymap): Change key binding for ada-find-file, that conflicted
with another binding in ada-mode.el.
(ada-add-menu): New menu "List Local References", to list the reference
to the entity only in the current file, instead of looking in the whole
project. Much faster.
(ada-find-references): New parameters arg and local-only.
(ada-find-any-references): New parameters local-only and append.
(ada-goto-declaration): Fix handling of predefined entities in xref.
(ada-get-all-references): Updated to the new xref format in GNAT 3.15,
still compatible with GNAT 3.14 of course. Fix various calls to
count-lines, that didn't work correctly when the buffer was narrowed.
2002-06-20 17:31:56 +00:00
|
|
|
(defcustom ada-xref-search-with-egrep t
|
|
|
|
"*If non-nil, use egrep to find the possible declarations for an entity.
|
|
|
|
This alternate method is used when the exact location was not found in the
|
2004-08-22 17:14:02 +00:00
|
|
|
information provided by GNAT. However, it might be expensive if you have a lot
|
Update copyright notice.
(ada-xref-create-ali): The default is now not to create automatically the
ALI files by compiling the unit, since this isn't always reliable and
requires an up-to-date project file.
(ada-prj-default-comp-cmd): No longer use gcc directly to compile
a file, but use gnatmake instead, since this gives access to the GNAT
project files.
(ada-xref-search-with-egrep): New variable, suggested by P. Waroquiers.
(ada-load-project-hook): New variable, for support of GNAT project files.
(ada-update-project-menu): Fix the detection of the project file name.
(ada-add-keymap): Change key binding for ada-find-file, that conflicted
with another binding in ada-mode.el.
(ada-add-menu): New menu "List Local References", to list the reference
to the entity only in the current file, instead of looking in the whole
project. Much faster.
(ada-find-references): New parameters arg and local-only.
(ada-find-any-references): New parameters local-only and append.
(ada-goto-declaration): Fix handling of predefined entities in xref.
(ada-get-all-references): Updated to the new xref format in GNAT 3.15,
still compatible with GNAT 3.14 of course. Fix various calls to
count-lines, that didn't work correctly when the buffer was narrowed.
2002-06-20 17:31:56 +00:00
|
|
|
of sources, since it will search in all the files in your project."
|
|
|
|
:type 'boolean :group 'ada)
|
|
|
|
|
|
|
|
(defvar ada-load-project-hook nil
|
|
|
|
"Hook that is run when loading a project file.
|
|
|
|
Each function in this hook takes one argument FILENAME, that is the name of
|
|
|
|
the project file to load.
|
|
|
|
This hook should be used to support new formats for the project files.
|
|
|
|
|
|
|
|
If the function can load the file with the given filename, it should create a
|
|
|
|
buffer that contains a conversion of the file to the standard format of the
|
2004-08-22 17:14:02 +00:00
|
|
|
project files, and return that buffer. (The usual \"src_dir=\" or \"obj_dir=\"
|
|
|
|
lines.) It should return nil if it doesn't know how to convert that project
|
Update copyright notice.
(ada-xref-create-ali): The default is now not to create automatically the
ALI files by compiling the unit, since this isn't always reliable and
requires an up-to-date project file.
(ada-prj-default-comp-cmd): No longer use gcc directly to compile
a file, but use gnatmake instead, since this gives access to the GNAT
project files.
(ada-xref-search-with-egrep): New variable, suggested by P. Waroquiers.
(ada-load-project-hook): New variable, for support of GNAT project files.
(ada-update-project-menu): Fix the detection of the project file name.
(ada-add-keymap): Change key binding for ada-find-file, that conflicted
with another binding in ada-mode.el.
(ada-add-menu): New menu "List Local References", to list the reference
to the entity only in the current file, instead of looking in the whole
project. Much faster.
(ada-find-references): New parameters arg and local-only.
(ada-find-any-references): New parameters local-only and append.
(ada-goto-declaration): Fix handling of predefined entities in xref.
(ada-get-all-references): Updated to the new xref format in GNAT 3.15,
still compatible with GNAT 3.14 of course. Fix various calls to
count-lines, that didn't work correctly when the buffer was narrowed.
2002-06-20 17:31:56 +00:00
|
|
|
file.")
|
|
|
|
|
|
|
|
|
1999-10-07 14:25:59 +00:00
|
|
|
;; ------- Nothing to be modified by the user below this
|
|
|
|
(defvar ada-last-prj-file ""
|
1999-10-28 11:12:54 +00:00
|
|
|
"Name of the last project file entered by the user.")
|
1999-10-07 14:25:59 +00:00
|
|
|
|
Got rid of all byte-compiler warnings on Emacs.
Add to the menu when the file is loaded, not in ada-mode-hook.
Add -toolbar to the default ddd command Switches moved from
ada-prj-default-comp-cmd and ada-prj-default-make-cmd to
ada-prj-default-comp-opt
(ada-add-ada-menu): Remove the map and name parameters Add the Ada
Reference Manual to the menu
(ada-check-current): rewritten as a call to ada-compile-current
(ada-compile): Removed.
(ada-compile-application, ada-compile-current, ada-check-current):
Set the compilation-search-path so that compile.el automatically
finds the sources in src_dir. Automatic scrollong of the
compilation buffer. C-uC-cC-c asks for confirmation before
compiling
(ada-compile-current): New parameter, prj-field
(ada-complete-identifier): Load the .ali file before doing
processing
(ada-find-ali-file-in-dir): prepend build_dir to obj_dir to
conform to gnatmake's behavior.
(ada-find-file-in-dir): New function
(ada-find-references): Set the environment variables for gnatfind
(ada-find-src-file-in-dir): New function.
(ada-first-non-nil): Removed
(ada-gdb-application): Add support for jdb, the java debugger.
(ada-get-ada-file-name): Load the original-file first if not done
yet.
(ada-get-all-references): Handles the new ali syntax (parent types
are found between <>).
(ada-initialize-runtime-library): New function
(ada-mode-hook): Always load a project file when a file is opened,
so that the casing exceptions are correctly read.
(ada-operator-re): Add all missing operators ("abs", "rem", "**").
(ada-parse-prj-file): Use find-file-noselect instead of find-file
to open the project file, since the latter does not work with
speedbar Get default values before loading the prj file, or the
default executable file name is wrong. Use the absolute value of
src_dir to initialize ada-search-directories and
compilation-search-path,... Add the standard runtime library to
the search path for find-file.
(ada-prj-default-debugger): Was missing an opening '{'
(ada-prj-default-bind-opt, ada-prj-default-link-opt): New
variables.
(ada-prj-default-gnatmake-opt): New variable
(ada-prj-find-prj-file): Handles non-file buffers For non-Ada
buffers, the project file is the default one Save the windows
configuration before displaying the menu.
(ada-prj-src-dir, ada-prj-obj-dir, ada-prj-comp-opt,...): Removed
(ada-read-identifier): Fix xrefs on operators (for "mod", "and",
...) regexp-quote identifiers names to support operators +,
-,... in regexps.
(ada-remote): New function.
(ada-run-application): Erase the output buffer before starting the
run Support remote execution of the application. Use
call-process, or the arguments are incorrectly parsed
(ada-set-default-project-file): Reread the content of the active
project file, not the one from the current buffer When a project
file is set as the default project, all directories are
automatically associated with it.
(ada-set-environment): New function
(ada-treat-cmd-string): New special variable ${current}
(ada-treat-cmd-string): Revised. The substitution is now done for
any ${...} substring
(ada-xref-current): If no body was found, compiles the spec
instead. Setup ADA_{SOURCE,OBJECTS}_PATH before running the
compiler to get rid of command line length limitations.
(ada-xref-get-project-field): New function
(ada-xref-project-files): New variable
(ada-xref-runtime-library-specs-path)
(ada-xref-runtime-library-ali-path): New variables
(ada-xref-set-default-prj-values): Default run command now does a
cd to the build directory. New field: main_unit Provide a default
file name even if the current buffer has no prj file.
2000-07-24 11:13:11 +00:00
|
|
|
(defvar ada-check-switch "-gnats"
|
1999-10-28 11:12:54 +00:00
|
|
|
"Switch added to the command line to check the current file.")
|
1999-10-07 14:25:59 +00:00
|
|
|
|
2002-04-09 18:54:20 +00:00
|
|
|
(defconst ada-project-file-extension ".adp"
|
1999-10-28 11:12:54 +00:00
|
|
|
"The extension used for project files.")
|
1999-10-07 14:25:59 +00:00
|
|
|
|
Got rid of all byte-compiler warnings on Emacs.
Add to the menu when the file is loaded, not in ada-mode-hook.
Add -toolbar to the default ddd command Switches moved from
ada-prj-default-comp-cmd and ada-prj-default-make-cmd to
ada-prj-default-comp-opt
(ada-add-ada-menu): Remove the map and name parameters Add the Ada
Reference Manual to the menu
(ada-check-current): rewritten as a call to ada-compile-current
(ada-compile): Removed.
(ada-compile-application, ada-compile-current, ada-check-current):
Set the compilation-search-path so that compile.el automatically
finds the sources in src_dir. Automatic scrollong of the
compilation buffer. C-uC-cC-c asks for confirmation before
compiling
(ada-compile-current): New parameter, prj-field
(ada-complete-identifier): Load the .ali file before doing
processing
(ada-find-ali-file-in-dir): prepend build_dir to obj_dir to
conform to gnatmake's behavior.
(ada-find-file-in-dir): New function
(ada-find-references): Set the environment variables for gnatfind
(ada-find-src-file-in-dir): New function.
(ada-first-non-nil): Removed
(ada-gdb-application): Add support for jdb, the java debugger.
(ada-get-ada-file-name): Load the original-file first if not done
yet.
(ada-get-all-references): Handles the new ali syntax (parent types
are found between <>).
(ada-initialize-runtime-library): New function
(ada-mode-hook): Always load a project file when a file is opened,
so that the casing exceptions are correctly read.
(ada-operator-re): Add all missing operators ("abs", "rem", "**").
(ada-parse-prj-file): Use find-file-noselect instead of find-file
to open the project file, since the latter does not work with
speedbar Get default values before loading the prj file, or the
default executable file name is wrong. Use the absolute value of
src_dir to initialize ada-search-directories and
compilation-search-path,... Add the standard runtime library to
the search path for find-file.
(ada-prj-default-debugger): Was missing an opening '{'
(ada-prj-default-bind-opt, ada-prj-default-link-opt): New
variables.
(ada-prj-default-gnatmake-opt): New variable
(ada-prj-find-prj-file): Handles non-file buffers For non-Ada
buffers, the project file is the default one Save the windows
configuration before displaying the menu.
(ada-prj-src-dir, ada-prj-obj-dir, ada-prj-comp-opt,...): Removed
(ada-read-identifier): Fix xrefs on operators (for "mod", "and",
...) regexp-quote identifiers names to support operators +,
-,... in regexps.
(ada-remote): New function.
(ada-run-application): Erase the output buffer before starting the
run Support remote execution of the application. Use
call-process, or the arguments are incorrectly parsed
(ada-set-default-project-file): Reread the content of the active
project file, not the one from the current buffer When a project
file is set as the default project, all directories are
automatically associated with it.
(ada-set-environment): New function
(ada-treat-cmd-string): New special variable ${current}
(ada-treat-cmd-string): Revised. The substitution is now done for
any ${...} substring
(ada-xref-current): If no body was found, compiles the spec
instead. Setup ADA_{SOURCE,OBJECTS}_PATH before running the
compiler to get rid of command line length limitations.
(ada-xref-get-project-field): New function
(ada-xref-project-files): New variable
(ada-xref-runtime-library-specs-path)
(ada-xref-runtime-library-ali-path): New variables
(ada-xref-set-default-prj-values): Default run command now does a
cd to the build directory. New field: main_unit Provide a default
file name even if the current buffer has no prj file.
2000-07-24 11:13:11 +00:00
|
|
|
(defvar ada-xref-runtime-library-specs-path '()
|
|
|
|
"Directories where the specs for the standard library is found.
|
|
|
|
This is used for cross-references.")
|
|
|
|
|
|
|
|
(defvar ada-xref-runtime-library-ali-path '()
|
|
|
|
"Directories where the ali for the standard library is found.
|
|
|
|
This is used for cross-references.")
|
|
|
|
|
1999-10-07 14:25:59 +00:00
|
|
|
(defvar ada-xref-pos-ring '()
|
1999-10-28 11:12:54 +00:00
|
|
|
"List of positions selected by the cross-references functions.
|
|
|
|
Used to go back to these positions.")
|
1999-10-07 14:25:59 +00:00
|
|
|
|
2002-04-09 18:54:20 +00:00
|
|
|
(defvar ada-cd-command
|
|
|
|
(if (string-match "cmdproxy.exe" shell-file-name)
|
|
|
|
"cd /d"
|
|
|
|
"cd")
|
2004-08-22 17:14:02 +00:00
|
|
|
"Command to use to change to a specific directory.
|
|
|
|
On Windows systems using `cmdproxy.exe' as the shell,
|
|
|
|
we need to use `/d' or the drive is never changed.")
|
2002-04-09 18:54:20 +00:00
|
|
|
|
|
|
|
(defvar ada-command-separator (if is-windows " && " "\n")
|
2004-08-22 17:14:02 +00:00
|
|
|
"Separator to use between multiple commands to `compile' or `start-process'.
|
|
|
|
`cmdproxy.exe' doesn't recognize multiple-line commands, so we have to use
|
2002-04-09 18:54:20 +00:00
|
|
|
\"&&\" for now.")
|
|
|
|
|
1999-10-07 14:25:59 +00:00
|
|
|
(defconst ada-xref-pos-ring-max 16
|
1999-10-28 11:12:54 +00:00
|
|
|
"Number of positions kept in the list ada-xref-pos-ring.")
|
1999-10-07 14:25:59 +00:00
|
|
|
|
|
|
|
(defvar ada-operator-re
|
Got rid of all byte-compiler warnings on Emacs.
Add to the menu when the file is loaded, not in ada-mode-hook.
Add -toolbar to the default ddd command Switches moved from
ada-prj-default-comp-cmd and ada-prj-default-make-cmd to
ada-prj-default-comp-opt
(ada-add-ada-menu): Remove the map and name parameters Add the Ada
Reference Manual to the menu
(ada-check-current): rewritten as a call to ada-compile-current
(ada-compile): Removed.
(ada-compile-application, ada-compile-current, ada-check-current):
Set the compilation-search-path so that compile.el automatically
finds the sources in src_dir. Automatic scrollong of the
compilation buffer. C-uC-cC-c asks for confirmation before
compiling
(ada-compile-current): New parameter, prj-field
(ada-complete-identifier): Load the .ali file before doing
processing
(ada-find-ali-file-in-dir): prepend build_dir to obj_dir to
conform to gnatmake's behavior.
(ada-find-file-in-dir): New function
(ada-find-references): Set the environment variables for gnatfind
(ada-find-src-file-in-dir): New function.
(ada-first-non-nil): Removed
(ada-gdb-application): Add support for jdb, the java debugger.
(ada-get-ada-file-name): Load the original-file first if not done
yet.
(ada-get-all-references): Handles the new ali syntax (parent types
are found between <>).
(ada-initialize-runtime-library): New function
(ada-mode-hook): Always load a project file when a file is opened,
so that the casing exceptions are correctly read.
(ada-operator-re): Add all missing operators ("abs", "rem", "**").
(ada-parse-prj-file): Use find-file-noselect instead of find-file
to open the project file, since the latter does not work with
speedbar Get default values before loading the prj file, or the
default executable file name is wrong. Use the absolute value of
src_dir to initialize ada-search-directories and
compilation-search-path,... Add the standard runtime library to
the search path for find-file.
(ada-prj-default-debugger): Was missing an opening '{'
(ada-prj-default-bind-opt, ada-prj-default-link-opt): New
variables.
(ada-prj-default-gnatmake-opt): New variable
(ada-prj-find-prj-file): Handles non-file buffers For non-Ada
buffers, the project file is the default one Save the windows
configuration before displaying the menu.
(ada-prj-src-dir, ada-prj-obj-dir, ada-prj-comp-opt,...): Removed
(ada-read-identifier): Fix xrefs on operators (for "mod", "and",
...) regexp-quote identifiers names to support operators +,
-,... in regexps.
(ada-remote): New function.
(ada-run-application): Erase the output buffer before starting the
run Support remote execution of the application. Use
call-process, or the arguments are incorrectly parsed
(ada-set-default-project-file): Reread the content of the active
project file, not the one from the current buffer When a project
file is set as the default project, all directories are
automatically associated with it.
(ada-set-environment): New function
(ada-treat-cmd-string): New special variable ${current}
(ada-treat-cmd-string): Revised. The substitution is now done for
any ${...} substring
(ada-xref-current): If no body was found, compiles the spec
instead. Setup ADA_{SOURCE,OBJECTS}_PATH before running the
compiler to get rid of command line length limitations.
(ada-xref-get-project-field): New function
(ada-xref-project-files): New variable
(ada-xref-runtime-library-specs-path)
(ada-xref-runtime-library-ali-path): New variables
(ada-xref-set-default-prj-values): Default run command now does a
cd to the build directory. New field: main_unit Provide a default
file name even if the current buffer has no prj file.
2000-07-24 11:13:11 +00:00
|
|
|
"\\+\\|-\\|/\\|\\*\\*\\|\\*\\|=\\|&\\|abs\\|mod\\|rem\\|and\\|not\\|or\\|xor\\|<=\\|<\\|>=\\|>"
|
1999-10-28 11:12:54 +00:00
|
|
|
"Regexp to match for operators.")
|
1999-10-07 14:25:59 +00:00
|
|
|
|
Got rid of all byte-compiler warnings on Emacs.
Add to the menu when the file is loaded, not in ada-mode-hook.
Add -toolbar to the default ddd command Switches moved from
ada-prj-default-comp-cmd and ada-prj-default-make-cmd to
ada-prj-default-comp-opt
(ada-add-ada-menu): Remove the map and name parameters Add the Ada
Reference Manual to the menu
(ada-check-current): rewritten as a call to ada-compile-current
(ada-compile): Removed.
(ada-compile-application, ada-compile-current, ada-check-current):
Set the compilation-search-path so that compile.el automatically
finds the sources in src_dir. Automatic scrollong of the
compilation buffer. C-uC-cC-c asks for confirmation before
compiling
(ada-compile-current): New parameter, prj-field
(ada-complete-identifier): Load the .ali file before doing
processing
(ada-find-ali-file-in-dir): prepend build_dir to obj_dir to
conform to gnatmake's behavior.
(ada-find-file-in-dir): New function
(ada-find-references): Set the environment variables for gnatfind
(ada-find-src-file-in-dir): New function.
(ada-first-non-nil): Removed
(ada-gdb-application): Add support for jdb, the java debugger.
(ada-get-ada-file-name): Load the original-file first if not done
yet.
(ada-get-all-references): Handles the new ali syntax (parent types
are found between <>).
(ada-initialize-runtime-library): New function
(ada-mode-hook): Always load a project file when a file is opened,
so that the casing exceptions are correctly read.
(ada-operator-re): Add all missing operators ("abs", "rem", "**").
(ada-parse-prj-file): Use find-file-noselect instead of find-file
to open the project file, since the latter does not work with
speedbar Get default values before loading the prj file, or the
default executable file name is wrong. Use the absolute value of
src_dir to initialize ada-search-directories and
compilation-search-path,... Add the standard runtime library to
the search path for find-file.
(ada-prj-default-debugger): Was missing an opening '{'
(ada-prj-default-bind-opt, ada-prj-default-link-opt): New
variables.
(ada-prj-default-gnatmake-opt): New variable
(ada-prj-find-prj-file): Handles non-file buffers For non-Ada
buffers, the project file is the default one Save the windows
configuration before displaying the menu.
(ada-prj-src-dir, ada-prj-obj-dir, ada-prj-comp-opt,...): Removed
(ada-read-identifier): Fix xrefs on operators (for "mod", "and",
...) regexp-quote identifiers names to support operators +,
-,... in regexps.
(ada-remote): New function.
(ada-run-application): Erase the output buffer before starting the
run Support remote execution of the application. Use
call-process, or the arguments are incorrectly parsed
(ada-set-default-project-file): Reread the content of the active
project file, not the one from the current buffer When a project
file is set as the default project, all directories are
automatically associated with it.
(ada-set-environment): New function
(ada-treat-cmd-string): New special variable ${current}
(ada-treat-cmd-string): Revised. The substitution is now done for
any ${...} substring
(ada-xref-current): If no body was found, compiles the spec
instead. Setup ADA_{SOURCE,OBJECTS}_PATH before running the
compiler to get rid of command line length limitations.
(ada-xref-get-project-field): New function
(ada-xref-project-files): New variable
(ada-xref-runtime-library-specs-path)
(ada-xref-runtime-library-ali-path): New variables
(ada-xref-set-default-prj-values): Default run command now does a
cd to the build directory. New field: main_unit Provide a default
file name even if the current buffer has no prj file.
2000-07-24 11:13:11 +00:00
|
|
|
(defvar ada-xref-project-files '()
|
|
|
|
"Associative list of project files.
|
|
|
|
It has the following format:
|
2001-07-16 13:38:53 +00:00
|
|
|
\((project_name . value) (project_name . value) ...)
|
Got rid of all byte-compiler warnings on Emacs.
Add to the menu when the file is loaded, not in ada-mode-hook.
Add -toolbar to the default ddd command Switches moved from
ada-prj-default-comp-cmd and ada-prj-default-make-cmd to
ada-prj-default-comp-opt
(ada-add-ada-menu): Remove the map and name parameters Add the Ada
Reference Manual to the menu
(ada-check-current): rewritten as a call to ada-compile-current
(ada-compile): Removed.
(ada-compile-application, ada-compile-current, ada-check-current):
Set the compilation-search-path so that compile.el automatically
finds the sources in src_dir. Automatic scrollong of the
compilation buffer. C-uC-cC-c asks for confirmation before
compiling
(ada-compile-current): New parameter, prj-field
(ada-complete-identifier): Load the .ali file before doing
processing
(ada-find-ali-file-in-dir): prepend build_dir to obj_dir to
conform to gnatmake's behavior.
(ada-find-file-in-dir): New function
(ada-find-references): Set the environment variables for gnatfind
(ada-find-src-file-in-dir): New function.
(ada-first-non-nil): Removed
(ada-gdb-application): Add support for jdb, the java debugger.
(ada-get-ada-file-name): Load the original-file first if not done
yet.
(ada-get-all-references): Handles the new ali syntax (parent types
are found between <>).
(ada-initialize-runtime-library): New function
(ada-mode-hook): Always load a project file when a file is opened,
so that the casing exceptions are correctly read.
(ada-operator-re): Add all missing operators ("abs", "rem", "**").
(ada-parse-prj-file): Use find-file-noselect instead of find-file
to open the project file, since the latter does not work with
speedbar Get default values before loading the prj file, or the
default executable file name is wrong. Use the absolute value of
src_dir to initialize ada-search-directories and
compilation-search-path,... Add the standard runtime library to
the search path for find-file.
(ada-prj-default-debugger): Was missing an opening '{'
(ada-prj-default-bind-opt, ada-prj-default-link-opt): New
variables.
(ada-prj-default-gnatmake-opt): New variable
(ada-prj-find-prj-file): Handles non-file buffers For non-Ada
buffers, the project file is the default one Save the windows
configuration before displaying the menu.
(ada-prj-src-dir, ada-prj-obj-dir, ada-prj-comp-opt,...): Removed
(ada-read-identifier): Fix xrefs on operators (for "mod", "and",
...) regexp-quote identifiers names to support operators +,
-,... in regexps.
(ada-remote): New function.
(ada-run-application): Erase the output buffer before starting the
run Support remote execution of the application. Use
call-process, or the arguments are incorrectly parsed
(ada-set-default-project-file): Reread the content of the active
project file, not the one from the current buffer When a project
file is set as the default project, all directories are
automatically associated with it.
(ada-set-environment): New function
(ada-treat-cmd-string): New special variable ${current}
(ada-treat-cmd-string): Revised. The substitution is now done for
any ${...} substring
(ada-xref-current): If no body was found, compiles the spec
instead. Setup ADA_{SOURCE,OBJECTS}_PATH before running the
compiler to get rid of command line length limitations.
(ada-xref-get-project-field): New function
(ada-xref-project-files): New variable
(ada-xref-runtime-library-specs-path)
(ada-xref-runtime-library-ali-path): New variables
(ada-xref-set-default-prj-values): Default run command now does a
cd to the build directory. New field: main_unit Provide a default
file name even if the current buffer has no prj file.
2000-07-24 11:13:11 +00:00
|
|
|
As always, the values of the project file are defined through properties.")
|
|
|
|
|
2003-04-29 23:40:08 +00:00
|
|
|
|
|
|
|
;; ----- Identlist manipulation -------------------------------------------
|
|
|
|
;; An identlist is a vector that is used internally to reference an identifier
|
|
|
|
;; To facilitate its use, we provide the following macros
|
|
|
|
|
|
|
|
(defmacro ada-make-identlist () (make-vector 8 nil))
|
|
|
|
(defmacro ada-name-of (identlist) (list 'aref identlist 0))
|
|
|
|
(defmacro ada-line-of (identlist) (list 'aref identlist 1))
|
|
|
|
(defmacro ada-column-of (identlist) (list 'aref identlist 2))
|
|
|
|
(defmacro ada-file-of (identlist) (list 'aref identlist 3))
|
|
|
|
(defmacro ada-ali-index-of (identlist) (list 'aref identlist 4))
|
|
|
|
(defmacro ada-declare-file-of (identlist) (list 'aref identlist 5))
|
|
|
|
(defmacro ada-references-of (identlist) (list 'aref identlist 6))
|
|
|
|
(defmacro ada-on-declaration (identlist) (list 'aref identlist 7))
|
|
|
|
|
|
|
|
(defmacro ada-set-name (identlist name) (list 'aset identlist 0 name))
|
|
|
|
(defmacro ada-set-line (identlist line) (list 'aset identlist 1 line))
|
|
|
|
(defmacro ada-set-column (identlist col) (list 'aset identlist 2 col))
|
|
|
|
(defmacro ada-set-file (identlist file) (list 'aset identlist 3 file))
|
|
|
|
(defmacro ada-set-ali-index (identlist index) (list 'aset identlist 4 index))
|
|
|
|
(defmacro ada-set-declare-file (identlist file) (list 'aset identlist 5 file))
|
|
|
|
(defmacro ada-set-references (identlist ref) (list 'aset identlist 6 ref))
|
|
|
|
(defmacro ada-set-on-declaration (ident value) (list 'aset ident 7 value))
|
|
|
|
|
|
|
|
(defsubst ada-get-ali-buffer (file)
|
2006-10-31 00:57:56 +00:00
|
|
|
"Read the ali file FILE into a new buffer, and return the buffer's name."
|
2003-04-29 23:40:08 +00:00
|
|
|
(find-file-noselect (ada-get-ali-file-name file)))
|
|
|
|
|
|
|
|
|
|
|
|
;; -----------------------------------------------------------------------
|
|
|
|
|
2002-04-09 18:54:20 +00:00
|
|
|
(defun ada-quote-cmd (cmd)
|
2004-08-22 17:14:02 +00:00
|
|
|
"Duplicate all \\ characters in CMD so that it can be passed to `compile'."
|
2002-04-09 18:54:20 +00:00
|
|
|
(mapconcat 'identity (split-string cmd "\\\\") "\\\\"))
|
Got rid of all byte-compiler warnings on Emacs.
Add to the menu when the file is loaded, not in ada-mode-hook.
Add -toolbar to the default ddd command Switches moved from
ada-prj-default-comp-cmd and ada-prj-default-make-cmd to
ada-prj-default-comp-opt
(ada-add-ada-menu): Remove the map and name parameters Add the Ada
Reference Manual to the menu
(ada-check-current): rewritten as a call to ada-compile-current
(ada-compile): Removed.
(ada-compile-application, ada-compile-current, ada-check-current):
Set the compilation-search-path so that compile.el automatically
finds the sources in src_dir. Automatic scrollong of the
compilation buffer. C-uC-cC-c asks for confirmation before
compiling
(ada-compile-current): New parameter, prj-field
(ada-complete-identifier): Load the .ali file before doing
processing
(ada-find-ali-file-in-dir): prepend build_dir to obj_dir to
conform to gnatmake's behavior.
(ada-find-file-in-dir): New function
(ada-find-references): Set the environment variables for gnatfind
(ada-find-src-file-in-dir): New function.
(ada-first-non-nil): Removed
(ada-gdb-application): Add support for jdb, the java debugger.
(ada-get-ada-file-name): Load the original-file first if not done
yet.
(ada-get-all-references): Handles the new ali syntax (parent types
are found between <>).
(ada-initialize-runtime-library): New function
(ada-mode-hook): Always load a project file when a file is opened,
so that the casing exceptions are correctly read.
(ada-operator-re): Add all missing operators ("abs", "rem", "**").
(ada-parse-prj-file): Use find-file-noselect instead of find-file
to open the project file, since the latter does not work with
speedbar Get default values before loading the prj file, or the
default executable file name is wrong. Use the absolute value of
src_dir to initialize ada-search-directories and
compilation-search-path,... Add the standard runtime library to
the search path for find-file.
(ada-prj-default-debugger): Was missing an opening '{'
(ada-prj-default-bind-opt, ada-prj-default-link-opt): New
variables.
(ada-prj-default-gnatmake-opt): New variable
(ada-prj-find-prj-file): Handles non-file buffers For non-Ada
buffers, the project file is the default one Save the windows
configuration before displaying the menu.
(ada-prj-src-dir, ada-prj-obj-dir, ada-prj-comp-opt,...): Removed
(ada-read-identifier): Fix xrefs on operators (for "mod", "and",
...) regexp-quote identifiers names to support operators +,
-,... in regexps.
(ada-remote): New function.
(ada-run-application): Erase the output buffer before starting the
run Support remote execution of the application. Use
call-process, or the arguments are incorrectly parsed
(ada-set-default-project-file): Reread the content of the active
project file, not the one from the current buffer When a project
file is set as the default project, all directories are
automatically associated with it.
(ada-set-environment): New function
(ada-treat-cmd-string): New special variable ${current}
(ada-treat-cmd-string): Revised. The substitution is now done for
any ${...} substring
(ada-xref-current): If no body was found, compiles the spec
instead. Setup ADA_{SOURCE,OBJECTS}_PATH before running the
compiler to get rid of command line length limitations.
(ada-xref-get-project-field): New function
(ada-xref-project-files): New variable
(ada-xref-runtime-library-specs-path)
(ada-xref-runtime-library-ali-path): New variables
(ada-xref-set-default-prj-values): Default run command now does a
cd to the build directory. New field: main_unit Provide a default
file name even if the current buffer has no prj file.
2000-07-24 11:13:11 +00:00
|
|
|
|
2002-04-09 18:54:20 +00:00
|
|
|
(defun ada-initialize-runtime-library (cross-prefix)
|
2004-08-22 17:14:02 +00:00
|
|
|
"Initialize the variables for the runtime library location.
|
2006-10-31 00:57:56 +00:00
|
|
|
CROSS-PREFIX is the prefix to use for the `gnatls' command."
|
Got rid of all byte-compiler warnings on Emacs.
Add to the menu when the file is loaded, not in ada-mode-hook.
Add -toolbar to the default ddd command Switches moved from
ada-prj-default-comp-cmd and ada-prj-default-make-cmd to
ada-prj-default-comp-opt
(ada-add-ada-menu): Remove the map and name parameters Add the Ada
Reference Manual to the menu
(ada-check-current): rewritten as a call to ada-compile-current
(ada-compile): Removed.
(ada-compile-application, ada-compile-current, ada-check-current):
Set the compilation-search-path so that compile.el automatically
finds the sources in src_dir. Automatic scrollong of the
compilation buffer. C-uC-cC-c asks for confirmation before
compiling
(ada-compile-current): New parameter, prj-field
(ada-complete-identifier): Load the .ali file before doing
processing
(ada-find-ali-file-in-dir): prepend build_dir to obj_dir to
conform to gnatmake's behavior.
(ada-find-file-in-dir): New function
(ada-find-references): Set the environment variables for gnatfind
(ada-find-src-file-in-dir): New function.
(ada-first-non-nil): Removed
(ada-gdb-application): Add support for jdb, the java debugger.
(ada-get-ada-file-name): Load the original-file first if not done
yet.
(ada-get-all-references): Handles the new ali syntax (parent types
are found between <>).
(ada-initialize-runtime-library): New function
(ada-mode-hook): Always load a project file when a file is opened,
so that the casing exceptions are correctly read.
(ada-operator-re): Add all missing operators ("abs", "rem", "**").
(ada-parse-prj-file): Use find-file-noselect instead of find-file
to open the project file, since the latter does not work with
speedbar Get default values before loading the prj file, or the
default executable file name is wrong. Use the absolute value of
src_dir to initialize ada-search-directories and
compilation-search-path,... Add the standard runtime library to
the search path for find-file.
(ada-prj-default-debugger): Was missing an opening '{'
(ada-prj-default-bind-opt, ada-prj-default-link-opt): New
variables.
(ada-prj-default-gnatmake-opt): New variable
(ada-prj-find-prj-file): Handles non-file buffers For non-Ada
buffers, the project file is the default one Save the windows
configuration before displaying the menu.
(ada-prj-src-dir, ada-prj-obj-dir, ada-prj-comp-opt,...): Removed
(ada-read-identifier): Fix xrefs on operators (for "mod", "and",
...) regexp-quote identifiers names to support operators +,
-,... in regexps.
(ada-remote): New function.
(ada-run-application): Erase the output buffer before starting the
run Support remote execution of the application. Use
call-process, or the arguments are incorrectly parsed
(ada-set-default-project-file): Reread the content of the active
project file, not the one from the current buffer When a project
file is set as the default project, all directories are
automatically associated with it.
(ada-set-environment): New function
(ada-treat-cmd-string): New special variable ${current}
(ada-treat-cmd-string): Revised. The substitution is now done for
any ${...} substring
(ada-xref-current): If no body was found, compiles the spec
instead. Setup ADA_{SOURCE,OBJECTS}_PATH before running the
compiler to get rid of command line length limitations.
(ada-xref-get-project-field): New function
(ada-xref-project-files): New variable
(ada-xref-runtime-library-specs-path)
(ada-xref-runtime-library-ali-path): New variables
(ada-xref-set-default-prj-values): Default run command now does a
cd to the build directory. New field: main_unit Provide a default
file name even if the current buffer has no prj file.
2000-07-24 11:13:11 +00:00
|
|
|
(save-excursion
|
2002-04-09 18:54:20 +00:00
|
|
|
(setq ada-xref-runtime-library-specs-path '()
|
|
|
|
ada-xref-runtime-library-ali-path '())
|
Got rid of all byte-compiler warnings on Emacs.
Add to the menu when the file is loaded, not in ada-mode-hook.
Add -toolbar to the default ddd command Switches moved from
ada-prj-default-comp-cmd and ada-prj-default-make-cmd to
ada-prj-default-comp-opt
(ada-add-ada-menu): Remove the map and name parameters Add the Ada
Reference Manual to the menu
(ada-check-current): rewritten as a call to ada-compile-current
(ada-compile): Removed.
(ada-compile-application, ada-compile-current, ada-check-current):
Set the compilation-search-path so that compile.el automatically
finds the sources in src_dir. Automatic scrollong of the
compilation buffer. C-uC-cC-c asks for confirmation before
compiling
(ada-compile-current): New parameter, prj-field
(ada-complete-identifier): Load the .ali file before doing
processing
(ada-find-ali-file-in-dir): prepend build_dir to obj_dir to
conform to gnatmake's behavior.
(ada-find-file-in-dir): New function
(ada-find-references): Set the environment variables for gnatfind
(ada-find-src-file-in-dir): New function.
(ada-first-non-nil): Removed
(ada-gdb-application): Add support for jdb, the java debugger.
(ada-get-ada-file-name): Load the original-file first if not done
yet.
(ada-get-all-references): Handles the new ali syntax (parent types
are found between <>).
(ada-initialize-runtime-library): New function
(ada-mode-hook): Always load a project file when a file is opened,
so that the casing exceptions are correctly read.
(ada-operator-re): Add all missing operators ("abs", "rem", "**").
(ada-parse-prj-file): Use find-file-noselect instead of find-file
to open the project file, since the latter does not work with
speedbar Get default values before loading the prj file, or the
default executable file name is wrong. Use the absolute value of
src_dir to initialize ada-search-directories and
compilation-search-path,... Add the standard runtime library to
the search path for find-file.
(ada-prj-default-debugger): Was missing an opening '{'
(ada-prj-default-bind-opt, ada-prj-default-link-opt): New
variables.
(ada-prj-default-gnatmake-opt): New variable
(ada-prj-find-prj-file): Handles non-file buffers For non-Ada
buffers, the project file is the default one Save the windows
configuration before displaying the menu.
(ada-prj-src-dir, ada-prj-obj-dir, ada-prj-comp-opt,...): Removed
(ada-read-identifier): Fix xrefs on operators (for "mod", "and",
...) regexp-quote identifiers names to support operators +,
-,... in regexps.
(ada-remote): New function.
(ada-run-application): Erase the output buffer before starting the
run Support remote execution of the application. Use
call-process, or the arguments are incorrectly parsed
(ada-set-default-project-file): Reread the content of the active
project file, not the one from the current buffer When a project
file is set as the default project, all directories are
automatically associated with it.
(ada-set-environment): New function
(ada-treat-cmd-string): New special variable ${current}
(ada-treat-cmd-string): Revised. The substitution is now done for
any ${...} substring
(ada-xref-current): If no body was found, compiles the spec
instead. Setup ADA_{SOURCE,OBJECTS}_PATH before running the
compiler to get rid of command line length limitations.
(ada-xref-get-project-field): New function
(ada-xref-project-files): New variable
(ada-xref-runtime-library-specs-path)
(ada-xref-runtime-library-ali-path): New variables
(ada-xref-set-default-prj-values): Default run command now does a
cd to the build directory. New field: main_unit Provide a default
file name even if the current buffer has no prj file.
2000-07-24 11:13:11 +00:00
|
|
|
(set-buffer (get-buffer-create "*gnatls*"))
|
|
|
|
(widen)
|
|
|
|
(erase-buffer)
|
|
|
|
;; Catch any error in the following form (i.e gnatls was not found)
|
|
|
|
(condition-case nil
|
|
|
|
;; Even if we get an error, delete the *gnatls* buffer
|
|
|
|
(unwind-protect
|
|
|
|
(progn
|
2003-04-29 23:40:08 +00:00
|
|
|
(apply 'call-process (concat cross-prefix "gnatls")
|
|
|
|
(append '(nil t nil) ada-gnatls-args))
|
Got rid of all byte-compiler warnings on Emacs.
Add to the menu when the file is loaded, not in ada-mode-hook.
Add -toolbar to the default ddd command Switches moved from
ada-prj-default-comp-cmd and ada-prj-default-make-cmd to
ada-prj-default-comp-opt
(ada-add-ada-menu): Remove the map and name parameters Add the Ada
Reference Manual to the menu
(ada-check-current): rewritten as a call to ada-compile-current
(ada-compile): Removed.
(ada-compile-application, ada-compile-current, ada-check-current):
Set the compilation-search-path so that compile.el automatically
finds the sources in src_dir. Automatic scrollong of the
compilation buffer. C-uC-cC-c asks for confirmation before
compiling
(ada-compile-current): New parameter, prj-field
(ada-complete-identifier): Load the .ali file before doing
processing
(ada-find-ali-file-in-dir): prepend build_dir to obj_dir to
conform to gnatmake's behavior.
(ada-find-file-in-dir): New function
(ada-find-references): Set the environment variables for gnatfind
(ada-find-src-file-in-dir): New function.
(ada-first-non-nil): Removed
(ada-gdb-application): Add support for jdb, the java debugger.
(ada-get-ada-file-name): Load the original-file first if not done
yet.
(ada-get-all-references): Handles the new ali syntax (parent types
are found between <>).
(ada-initialize-runtime-library): New function
(ada-mode-hook): Always load a project file when a file is opened,
so that the casing exceptions are correctly read.
(ada-operator-re): Add all missing operators ("abs", "rem", "**").
(ada-parse-prj-file): Use find-file-noselect instead of find-file
to open the project file, since the latter does not work with
speedbar Get default values before loading the prj file, or the
default executable file name is wrong. Use the absolute value of
src_dir to initialize ada-search-directories and
compilation-search-path,... Add the standard runtime library to
the search path for find-file.
(ada-prj-default-debugger): Was missing an opening '{'
(ada-prj-default-bind-opt, ada-prj-default-link-opt): New
variables.
(ada-prj-default-gnatmake-opt): New variable
(ada-prj-find-prj-file): Handles non-file buffers For non-Ada
buffers, the project file is the default one Save the windows
configuration before displaying the menu.
(ada-prj-src-dir, ada-prj-obj-dir, ada-prj-comp-opt,...): Removed
(ada-read-identifier): Fix xrefs on operators (for "mod", "and",
...) regexp-quote identifiers names to support operators +,
-,... in regexps.
(ada-remote): New function.
(ada-run-application): Erase the output buffer before starting the
run Support remote execution of the application. Use
call-process, or the arguments are incorrectly parsed
(ada-set-default-project-file): Reread the content of the active
project file, not the one from the current buffer When a project
file is set as the default project, all directories are
automatically associated with it.
(ada-set-environment): New function
(ada-treat-cmd-string): New special variable ${current}
(ada-treat-cmd-string): Revised. The substitution is now done for
any ${...} substring
(ada-xref-current): If no body was found, compiles the spec
instead. Setup ADA_{SOURCE,OBJECTS}_PATH before running the
compiler to get rid of command line length limitations.
(ada-xref-get-project-field): New function
(ada-xref-project-files): New variable
(ada-xref-runtime-library-specs-path)
(ada-xref-runtime-library-ali-path): New variables
(ada-xref-set-default-prj-values): Default run command now does a
cd to the build directory. New field: main_unit Provide a default
file name even if the current buffer has no prj file.
2000-07-24 11:13:11 +00:00
|
|
|
(goto-char (point-min))
|
|
|
|
|
|
|
|
;; Source path
|
2003-02-04 13:24:35 +00:00
|
|
|
|
Got rid of all byte-compiler warnings on Emacs.
Add to the menu when the file is loaded, not in ada-mode-hook.
Add -toolbar to the default ddd command Switches moved from
ada-prj-default-comp-cmd and ada-prj-default-make-cmd to
ada-prj-default-comp-opt
(ada-add-ada-menu): Remove the map and name parameters Add the Ada
Reference Manual to the menu
(ada-check-current): rewritten as a call to ada-compile-current
(ada-compile): Removed.
(ada-compile-application, ada-compile-current, ada-check-current):
Set the compilation-search-path so that compile.el automatically
finds the sources in src_dir. Automatic scrollong of the
compilation buffer. C-uC-cC-c asks for confirmation before
compiling
(ada-compile-current): New parameter, prj-field
(ada-complete-identifier): Load the .ali file before doing
processing
(ada-find-ali-file-in-dir): prepend build_dir to obj_dir to
conform to gnatmake's behavior.
(ada-find-file-in-dir): New function
(ada-find-references): Set the environment variables for gnatfind
(ada-find-src-file-in-dir): New function.
(ada-first-non-nil): Removed
(ada-gdb-application): Add support for jdb, the java debugger.
(ada-get-ada-file-name): Load the original-file first if not done
yet.
(ada-get-all-references): Handles the new ali syntax (parent types
are found between <>).
(ada-initialize-runtime-library): New function
(ada-mode-hook): Always load a project file when a file is opened,
so that the casing exceptions are correctly read.
(ada-operator-re): Add all missing operators ("abs", "rem", "**").
(ada-parse-prj-file): Use find-file-noselect instead of find-file
to open the project file, since the latter does not work with
speedbar Get default values before loading the prj file, or the
default executable file name is wrong. Use the absolute value of
src_dir to initialize ada-search-directories and
compilation-search-path,... Add the standard runtime library to
the search path for find-file.
(ada-prj-default-debugger): Was missing an opening '{'
(ada-prj-default-bind-opt, ada-prj-default-link-opt): New
variables.
(ada-prj-default-gnatmake-opt): New variable
(ada-prj-find-prj-file): Handles non-file buffers For non-Ada
buffers, the project file is the default one Save the windows
configuration before displaying the menu.
(ada-prj-src-dir, ada-prj-obj-dir, ada-prj-comp-opt,...): Removed
(ada-read-identifier): Fix xrefs on operators (for "mod", "and",
...) regexp-quote identifiers names to support operators +,
-,... in regexps.
(ada-remote): New function.
(ada-run-application): Erase the output buffer before starting the
run Support remote execution of the application. Use
call-process, or the arguments are incorrectly parsed
(ada-set-default-project-file): Reread the content of the active
project file, not the one from the current buffer When a project
file is set as the default project, all directories are
automatically associated with it.
(ada-set-environment): New function
(ada-treat-cmd-string): New special variable ${current}
(ada-treat-cmd-string): Revised. The substitution is now done for
any ${...} substring
(ada-xref-current): If no body was found, compiles the spec
instead. Setup ADA_{SOURCE,OBJECTS}_PATH before running the
compiler to get rid of command line length limitations.
(ada-xref-get-project-field): New function
(ada-xref-project-files): New variable
(ada-xref-runtime-library-specs-path)
(ada-xref-runtime-library-ali-path): New variables
(ada-xref-set-default-prj-values): Default run command now does a
cd to the build directory. New field: main_unit Provide a default
file name even if the current buffer has no prj file.
2000-07-24 11:13:11 +00:00
|
|
|
(search-forward "Source Search Path:")
|
|
|
|
(forward-line 1)
|
|
|
|
(while (not (looking-at "^$"))
|
|
|
|
(back-to-indentation)
|
2003-04-29 23:40:08 +00:00
|
|
|
(if (looking-at "<Current_Directory>")
|
|
|
|
(add-to-list 'ada-xref-runtime-library-specs-path ".")
|
Got rid of all byte-compiler warnings on Emacs.
Add to the menu when the file is loaded, not in ada-mode-hook.
Add -toolbar to the default ddd command Switches moved from
ada-prj-default-comp-cmd and ada-prj-default-make-cmd to
ada-prj-default-comp-opt
(ada-add-ada-menu): Remove the map and name parameters Add the Ada
Reference Manual to the menu
(ada-check-current): rewritten as a call to ada-compile-current
(ada-compile): Removed.
(ada-compile-application, ada-compile-current, ada-check-current):
Set the compilation-search-path so that compile.el automatically
finds the sources in src_dir. Automatic scrollong of the
compilation buffer. C-uC-cC-c asks for confirmation before
compiling
(ada-compile-current): New parameter, prj-field
(ada-complete-identifier): Load the .ali file before doing
processing
(ada-find-ali-file-in-dir): prepend build_dir to obj_dir to
conform to gnatmake's behavior.
(ada-find-file-in-dir): New function
(ada-find-references): Set the environment variables for gnatfind
(ada-find-src-file-in-dir): New function.
(ada-first-non-nil): Removed
(ada-gdb-application): Add support for jdb, the java debugger.
(ada-get-ada-file-name): Load the original-file first if not done
yet.
(ada-get-all-references): Handles the new ali syntax (parent types
are found between <>).
(ada-initialize-runtime-library): New function
(ada-mode-hook): Always load a project file when a file is opened,
so that the casing exceptions are correctly read.
(ada-operator-re): Add all missing operators ("abs", "rem", "**").
(ada-parse-prj-file): Use find-file-noselect instead of find-file
to open the project file, since the latter does not work with
speedbar Get default values before loading the prj file, or the
default executable file name is wrong. Use the absolute value of
src_dir to initialize ada-search-directories and
compilation-search-path,... Add the standard runtime library to
the search path for find-file.
(ada-prj-default-debugger): Was missing an opening '{'
(ada-prj-default-bind-opt, ada-prj-default-link-opt): New
variables.
(ada-prj-default-gnatmake-opt): New variable
(ada-prj-find-prj-file): Handles non-file buffers For non-Ada
buffers, the project file is the default one Save the windows
configuration before displaying the menu.
(ada-prj-src-dir, ada-prj-obj-dir, ada-prj-comp-opt,...): Removed
(ada-read-identifier): Fix xrefs on operators (for "mod", "and",
...) regexp-quote identifiers names to support operators +,
-,... in regexps.
(ada-remote): New function.
(ada-run-application): Erase the output buffer before starting the
run Support remote execution of the application. Use
call-process, or the arguments are incorrectly parsed
(ada-set-default-project-file): Reread the content of the active
project file, not the one from the current buffer When a project
file is set as the default project, all directories are
automatically associated with it.
(ada-set-environment): New function
(ada-treat-cmd-string): New special variable ${current}
(ada-treat-cmd-string): Revised. The substitution is now done for
any ${...} substring
(ada-xref-current): If no body was found, compiles the spec
instead. Setup ADA_{SOURCE,OBJECTS}_PATH before running the
compiler to get rid of command line length limitations.
(ada-xref-get-project-field): New function
(ada-xref-project-files): New variable
(ada-xref-runtime-library-specs-path)
(ada-xref-runtime-library-ali-path): New variables
(ada-xref-set-default-prj-values): Default run command now does a
cd to the build directory. New field: main_unit Provide a default
file name even if the current buffer has no prj file.
2000-07-24 11:13:11 +00:00
|
|
|
(add-to-list 'ada-xref-runtime-library-specs-path
|
|
|
|
(buffer-substring-no-properties
|
|
|
|
(point)
|
|
|
|
(save-excursion (end-of-line) (point)))))
|
|
|
|
(forward-line 1))
|
|
|
|
|
|
|
|
;; Object path
|
2003-02-04 13:24:35 +00:00
|
|
|
|
Got rid of all byte-compiler warnings on Emacs.
Add to the menu when the file is loaded, not in ada-mode-hook.
Add -toolbar to the default ddd command Switches moved from
ada-prj-default-comp-cmd and ada-prj-default-make-cmd to
ada-prj-default-comp-opt
(ada-add-ada-menu): Remove the map and name parameters Add the Ada
Reference Manual to the menu
(ada-check-current): rewritten as a call to ada-compile-current
(ada-compile): Removed.
(ada-compile-application, ada-compile-current, ada-check-current):
Set the compilation-search-path so that compile.el automatically
finds the sources in src_dir. Automatic scrollong of the
compilation buffer. C-uC-cC-c asks for confirmation before
compiling
(ada-compile-current): New parameter, prj-field
(ada-complete-identifier): Load the .ali file before doing
processing
(ada-find-ali-file-in-dir): prepend build_dir to obj_dir to
conform to gnatmake's behavior.
(ada-find-file-in-dir): New function
(ada-find-references): Set the environment variables for gnatfind
(ada-find-src-file-in-dir): New function.
(ada-first-non-nil): Removed
(ada-gdb-application): Add support for jdb, the java debugger.
(ada-get-ada-file-name): Load the original-file first if not done
yet.
(ada-get-all-references): Handles the new ali syntax (parent types
are found between <>).
(ada-initialize-runtime-library): New function
(ada-mode-hook): Always load a project file when a file is opened,
so that the casing exceptions are correctly read.
(ada-operator-re): Add all missing operators ("abs", "rem", "**").
(ada-parse-prj-file): Use find-file-noselect instead of find-file
to open the project file, since the latter does not work with
speedbar Get default values before loading the prj file, or the
default executable file name is wrong. Use the absolute value of
src_dir to initialize ada-search-directories and
compilation-search-path,... Add the standard runtime library to
the search path for find-file.
(ada-prj-default-debugger): Was missing an opening '{'
(ada-prj-default-bind-opt, ada-prj-default-link-opt): New
variables.
(ada-prj-default-gnatmake-opt): New variable
(ada-prj-find-prj-file): Handles non-file buffers For non-Ada
buffers, the project file is the default one Save the windows
configuration before displaying the menu.
(ada-prj-src-dir, ada-prj-obj-dir, ada-prj-comp-opt,...): Removed
(ada-read-identifier): Fix xrefs on operators (for "mod", "and",
...) regexp-quote identifiers names to support operators +,
-,... in regexps.
(ada-remote): New function.
(ada-run-application): Erase the output buffer before starting the
run Support remote execution of the application. Use
call-process, or the arguments are incorrectly parsed
(ada-set-default-project-file): Reread the content of the active
project file, not the one from the current buffer When a project
file is set as the default project, all directories are
automatically associated with it.
(ada-set-environment): New function
(ada-treat-cmd-string): New special variable ${current}
(ada-treat-cmd-string): Revised. The substitution is now done for
any ${...} substring
(ada-xref-current): If no body was found, compiles the spec
instead. Setup ADA_{SOURCE,OBJECTS}_PATH before running the
compiler to get rid of command line length limitations.
(ada-xref-get-project-field): New function
(ada-xref-project-files): New variable
(ada-xref-runtime-library-specs-path)
(ada-xref-runtime-library-ali-path): New variables
(ada-xref-set-default-prj-values): Default run command now does a
cd to the build directory. New field: main_unit Provide a default
file name even if the current buffer has no prj file.
2000-07-24 11:13:11 +00:00
|
|
|
(search-forward "Object Search Path:")
|
|
|
|
(forward-line 1)
|
|
|
|
(while (not (looking-at "^$"))
|
|
|
|
(back-to-indentation)
|
2003-04-29 23:40:08 +00:00
|
|
|
(if (looking-at "<Current_Directory>")
|
|
|
|
(add-to-list 'ada-xref-runtime-library-ali-path ".")
|
Got rid of all byte-compiler warnings on Emacs.
Add to the menu when the file is loaded, not in ada-mode-hook.
Add -toolbar to the default ddd command Switches moved from
ada-prj-default-comp-cmd and ada-prj-default-make-cmd to
ada-prj-default-comp-opt
(ada-add-ada-menu): Remove the map and name parameters Add the Ada
Reference Manual to the menu
(ada-check-current): rewritten as a call to ada-compile-current
(ada-compile): Removed.
(ada-compile-application, ada-compile-current, ada-check-current):
Set the compilation-search-path so that compile.el automatically
finds the sources in src_dir. Automatic scrollong of the
compilation buffer. C-uC-cC-c asks for confirmation before
compiling
(ada-compile-current): New parameter, prj-field
(ada-complete-identifier): Load the .ali file before doing
processing
(ada-find-ali-file-in-dir): prepend build_dir to obj_dir to
conform to gnatmake's behavior.
(ada-find-file-in-dir): New function
(ada-find-references): Set the environment variables for gnatfind
(ada-find-src-file-in-dir): New function.
(ada-first-non-nil): Removed
(ada-gdb-application): Add support for jdb, the java debugger.
(ada-get-ada-file-name): Load the original-file first if not done
yet.
(ada-get-all-references): Handles the new ali syntax (parent types
are found between <>).
(ada-initialize-runtime-library): New function
(ada-mode-hook): Always load a project file when a file is opened,
so that the casing exceptions are correctly read.
(ada-operator-re): Add all missing operators ("abs", "rem", "**").
(ada-parse-prj-file): Use find-file-noselect instead of find-file
to open the project file, since the latter does not work with
speedbar Get default values before loading the prj file, or the
default executable file name is wrong. Use the absolute value of
src_dir to initialize ada-search-directories and
compilation-search-path,... Add the standard runtime library to
the search path for find-file.
(ada-prj-default-debugger): Was missing an opening '{'
(ada-prj-default-bind-opt, ada-prj-default-link-opt): New
variables.
(ada-prj-default-gnatmake-opt): New variable
(ada-prj-find-prj-file): Handles non-file buffers For non-Ada
buffers, the project file is the default one Save the windows
configuration before displaying the menu.
(ada-prj-src-dir, ada-prj-obj-dir, ada-prj-comp-opt,...): Removed
(ada-read-identifier): Fix xrefs on operators (for "mod", "and",
...) regexp-quote identifiers names to support operators +,
-,... in regexps.
(ada-remote): New function.
(ada-run-application): Erase the output buffer before starting the
run Support remote execution of the application. Use
call-process, or the arguments are incorrectly parsed
(ada-set-default-project-file): Reread the content of the active
project file, not the one from the current buffer When a project
file is set as the default project, all directories are
automatically associated with it.
(ada-set-environment): New function
(ada-treat-cmd-string): New special variable ${current}
(ada-treat-cmd-string): Revised. The substitution is now done for
any ${...} substring
(ada-xref-current): If no body was found, compiles the spec
instead. Setup ADA_{SOURCE,OBJECTS}_PATH before running the
compiler to get rid of command line length limitations.
(ada-xref-get-project-field): New function
(ada-xref-project-files): New variable
(ada-xref-runtime-library-specs-path)
(ada-xref-runtime-library-ali-path): New variables
(ada-xref-set-default-prj-values): Default run command now does a
cd to the build directory. New field: main_unit Provide a default
file name even if the current buffer has no prj file.
2000-07-24 11:13:11 +00:00
|
|
|
(add-to-list 'ada-xref-runtime-library-ali-path
|
|
|
|
(buffer-substring-no-properties
|
|
|
|
(point)
|
|
|
|
(save-excursion (end-of-line) (point)))))
|
|
|
|
(forward-line 1))
|
|
|
|
)
|
|
|
|
(kill-buffer nil))
|
|
|
|
(error nil))
|
|
|
|
(set 'ada-xref-runtime-library-specs-path
|
|
|
|
(reverse ada-xref-runtime-library-specs-path))
|
|
|
|
(set 'ada-xref-runtime-library-ali-path
|
|
|
|
(reverse ada-xref-runtime-library-ali-path))
|
|
|
|
))
|
|
|
|
|
|
|
|
|
|
|
|
(defun ada-treat-cmd-string (cmd-string)
|
|
|
|
"Replace meta-sequences like ${...} in CMD-STRING with the appropriate value.
|
2006-10-31 00:57:56 +00:00
|
|
|
Assumes project exists.
|
|
|
|
As a special case, ${current} is replaced with the name of the current
|
|
|
|
file, minus extension but with directory, and ${full_current} is
|
2002-04-09 18:54:20 +00:00
|
|
|
replaced by the name including the extension."
|
Got rid of all byte-compiler warnings on Emacs.
Add to the menu when the file is loaded, not in ada-mode-hook.
Add -toolbar to the default ddd command Switches moved from
ada-prj-default-comp-cmd and ada-prj-default-make-cmd to
ada-prj-default-comp-opt
(ada-add-ada-menu): Remove the map and name parameters Add the Ada
Reference Manual to the menu
(ada-check-current): rewritten as a call to ada-compile-current
(ada-compile): Removed.
(ada-compile-application, ada-compile-current, ada-check-current):
Set the compilation-search-path so that compile.el automatically
finds the sources in src_dir. Automatic scrollong of the
compilation buffer. C-uC-cC-c asks for confirmation before
compiling
(ada-compile-current): New parameter, prj-field
(ada-complete-identifier): Load the .ali file before doing
processing
(ada-find-ali-file-in-dir): prepend build_dir to obj_dir to
conform to gnatmake's behavior.
(ada-find-file-in-dir): New function
(ada-find-references): Set the environment variables for gnatfind
(ada-find-src-file-in-dir): New function.
(ada-first-non-nil): Removed
(ada-gdb-application): Add support for jdb, the java debugger.
(ada-get-ada-file-name): Load the original-file first if not done
yet.
(ada-get-all-references): Handles the new ali syntax (parent types
are found between <>).
(ada-initialize-runtime-library): New function
(ada-mode-hook): Always load a project file when a file is opened,
so that the casing exceptions are correctly read.
(ada-operator-re): Add all missing operators ("abs", "rem", "**").
(ada-parse-prj-file): Use find-file-noselect instead of find-file
to open the project file, since the latter does not work with
speedbar Get default values before loading the prj file, or the
default executable file name is wrong. Use the absolute value of
src_dir to initialize ada-search-directories and
compilation-search-path,... Add the standard runtime library to
the search path for find-file.
(ada-prj-default-debugger): Was missing an opening '{'
(ada-prj-default-bind-opt, ada-prj-default-link-opt): New
variables.
(ada-prj-default-gnatmake-opt): New variable
(ada-prj-find-prj-file): Handles non-file buffers For non-Ada
buffers, the project file is the default one Save the windows
configuration before displaying the menu.
(ada-prj-src-dir, ada-prj-obj-dir, ada-prj-comp-opt,...): Removed
(ada-read-identifier): Fix xrefs on operators (for "mod", "and",
...) regexp-quote identifiers names to support operators +,
-,... in regexps.
(ada-remote): New function.
(ada-run-application): Erase the output buffer before starting the
run Support remote execution of the application. Use
call-process, or the arguments are incorrectly parsed
(ada-set-default-project-file): Reread the content of the active
project file, not the one from the current buffer When a project
file is set as the default project, all directories are
automatically associated with it.
(ada-set-environment): New function
(ada-treat-cmd-string): New special variable ${current}
(ada-treat-cmd-string): Revised. The substitution is now done for
any ${...} substring
(ada-xref-current): If no body was found, compiles the spec
instead. Setup ADA_{SOURCE,OBJECTS}_PATH before running the
compiler to get rid of command line length limitations.
(ada-xref-get-project-field): New function
(ada-xref-project-files): New variable
(ada-xref-runtime-library-specs-path)
(ada-xref-runtime-library-ali-path): New variables
(ada-xref-set-default-prj-values): Default run command now does a
cd to the build directory. New field: main_unit Provide a default
file name even if the current buffer has no prj file.
2000-07-24 11:13:11 +00:00
|
|
|
|
|
|
|
(while (string-match "\\(-[^-\$IO]*[IO]\\)?\${\\([^}]+\\)}" cmd-string)
|
2002-04-09 18:54:20 +00:00
|
|
|
(let (value
|
|
|
|
(name (match-string 2 cmd-string)))
|
|
|
|
(cond
|
|
|
|
((string= name "current")
|
|
|
|
(setq value (file-name-sans-extension (buffer-file-name))))
|
|
|
|
((string= name "full_current")
|
|
|
|
(setq value (buffer-file-name)))
|
|
|
|
(t
|
Got rid of all byte-compiler warnings on Emacs.
Add to the menu when the file is loaded, not in ada-mode-hook.
Add -toolbar to the default ddd command Switches moved from
ada-prj-default-comp-cmd and ada-prj-default-make-cmd to
ada-prj-default-comp-opt
(ada-add-ada-menu): Remove the map and name parameters Add the Ada
Reference Manual to the menu
(ada-check-current): rewritten as a call to ada-compile-current
(ada-compile): Removed.
(ada-compile-application, ada-compile-current, ada-check-current):
Set the compilation-search-path so that compile.el automatically
finds the sources in src_dir. Automatic scrollong of the
compilation buffer. C-uC-cC-c asks for confirmation before
compiling
(ada-compile-current): New parameter, prj-field
(ada-complete-identifier): Load the .ali file before doing
processing
(ada-find-ali-file-in-dir): prepend build_dir to obj_dir to
conform to gnatmake's behavior.
(ada-find-file-in-dir): New function
(ada-find-references): Set the environment variables for gnatfind
(ada-find-src-file-in-dir): New function.
(ada-first-non-nil): Removed
(ada-gdb-application): Add support for jdb, the java debugger.
(ada-get-ada-file-name): Load the original-file first if not done
yet.
(ada-get-all-references): Handles the new ali syntax (parent types
are found between <>).
(ada-initialize-runtime-library): New function
(ada-mode-hook): Always load a project file when a file is opened,
so that the casing exceptions are correctly read.
(ada-operator-re): Add all missing operators ("abs", "rem", "**").
(ada-parse-prj-file): Use find-file-noselect instead of find-file
to open the project file, since the latter does not work with
speedbar Get default values before loading the prj file, or the
default executable file name is wrong. Use the absolute value of
src_dir to initialize ada-search-directories and
compilation-search-path,... Add the standard runtime library to
the search path for find-file.
(ada-prj-default-debugger): Was missing an opening '{'
(ada-prj-default-bind-opt, ada-prj-default-link-opt): New
variables.
(ada-prj-default-gnatmake-opt): New variable
(ada-prj-find-prj-file): Handles non-file buffers For non-Ada
buffers, the project file is the default one Save the windows
configuration before displaying the menu.
(ada-prj-src-dir, ada-prj-obj-dir, ada-prj-comp-opt,...): Removed
(ada-read-identifier): Fix xrefs on operators (for "mod", "and",
...) regexp-quote identifiers names to support operators +,
-,... in regexps.
(ada-remote): New function.
(ada-run-application): Erase the output buffer before starting the
run Support remote execution of the application. Use
call-process, or the arguments are incorrectly parsed
(ada-set-default-project-file): Reread the content of the active
project file, not the one from the current buffer When a project
file is set as the default project, all directories are
automatically associated with it.
(ada-set-environment): New function
(ada-treat-cmd-string): New special variable ${current}
(ada-treat-cmd-string): Revised. The substitution is now done for
any ${...} substring
(ada-xref-current): If no body was found, compiles the spec
instead. Setup ADA_{SOURCE,OBJECTS}_PATH before running the
compiler to get rid of command line length limitations.
(ada-xref-get-project-field): New function
(ada-xref-project-files): New variable
(ada-xref-runtime-library-specs-path)
(ada-xref-runtime-library-ali-path): New variables
(ada-xref-set-default-prj-values): Default run command now does a
cd to the build directory. New field: main_unit Provide a default
file name even if the current buffer has no prj file.
2000-07-24 11:13:11 +00:00
|
|
|
(save-match-data
|
2002-04-09 18:54:20 +00:00
|
|
|
(setq value (ada-xref-get-project-field (intern name))))))
|
|
|
|
|
|
|
|
;; Check if there is an environment variable with the same name
|
|
|
|
(if (null value)
|
|
|
|
(if (not (setq value (getenv name)))
|
2005-09-18 12:31:28 +00:00
|
|
|
(message "%s" (concat "No environment variable " name " found"))))
|
2003-02-04 13:24:35 +00:00
|
|
|
|
Got rid of all byte-compiler warnings on Emacs.
Add to the menu when the file is loaded, not in ada-mode-hook.
Add -toolbar to the default ddd command Switches moved from
ada-prj-default-comp-cmd and ada-prj-default-make-cmd to
ada-prj-default-comp-opt
(ada-add-ada-menu): Remove the map and name parameters Add the Ada
Reference Manual to the menu
(ada-check-current): rewritten as a call to ada-compile-current
(ada-compile): Removed.
(ada-compile-application, ada-compile-current, ada-check-current):
Set the compilation-search-path so that compile.el automatically
finds the sources in src_dir. Automatic scrollong of the
compilation buffer. C-uC-cC-c asks for confirmation before
compiling
(ada-compile-current): New parameter, prj-field
(ada-complete-identifier): Load the .ali file before doing
processing
(ada-find-ali-file-in-dir): prepend build_dir to obj_dir to
conform to gnatmake's behavior.
(ada-find-file-in-dir): New function
(ada-find-references): Set the environment variables for gnatfind
(ada-find-src-file-in-dir): New function.
(ada-first-non-nil): Removed
(ada-gdb-application): Add support for jdb, the java debugger.
(ada-get-ada-file-name): Load the original-file first if not done
yet.
(ada-get-all-references): Handles the new ali syntax (parent types
are found between <>).
(ada-initialize-runtime-library): New function
(ada-mode-hook): Always load a project file when a file is opened,
so that the casing exceptions are correctly read.
(ada-operator-re): Add all missing operators ("abs", "rem", "**").
(ada-parse-prj-file): Use find-file-noselect instead of find-file
to open the project file, since the latter does not work with
speedbar Get default values before loading the prj file, or the
default executable file name is wrong. Use the absolute value of
src_dir to initialize ada-search-directories and
compilation-search-path,... Add the standard runtime library to
the search path for find-file.
(ada-prj-default-debugger): Was missing an opening '{'
(ada-prj-default-bind-opt, ada-prj-default-link-opt): New
variables.
(ada-prj-default-gnatmake-opt): New variable
(ada-prj-find-prj-file): Handles non-file buffers For non-Ada
buffers, the project file is the default one Save the windows
configuration before displaying the menu.
(ada-prj-src-dir, ada-prj-obj-dir, ada-prj-comp-opt,...): Removed
(ada-read-identifier): Fix xrefs on operators (for "mod", "and",
...) regexp-quote identifiers names to support operators +,
-,... in regexps.
(ada-remote): New function.
(ada-run-application): Erase the output buffer before starting the
run Support remote execution of the application. Use
call-process, or the arguments are incorrectly parsed
(ada-set-default-project-file): Reread the content of the active
project file, not the one from the current buffer When a project
file is set as the default project, all directories are
automatically associated with it.
(ada-set-environment): New function
(ada-treat-cmd-string): New special variable ${current}
(ada-treat-cmd-string): Revised. The substitution is now done for
any ${...} substring
(ada-xref-current): If no body was found, compiles the spec
instead. Setup ADA_{SOURCE,OBJECTS}_PATH before running the
compiler to get rid of command line length limitations.
(ada-xref-get-project-field): New function
(ada-xref-project-files): New variable
(ada-xref-runtime-library-specs-path)
(ada-xref-runtime-library-ali-path): New variables
(ada-xref-set-default-prj-values): Default run command now does a
cd to the build directory. New field: main_unit Provide a default
file name even if the current buffer has no prj file.
2000-07-24 11:13:11 +00:00
|
|
|
(cond
|
|
|
|
((null value)
|
2002-04-09 18:54:20 +00:00
|
|
|
(setq cmd-string (replace-match "" t t cmd-string)))
|
Got rid of all byte-compiler warnings on Emacs.
Add to the menu when the file is loaded, not in ada-mode-hook.
Add -toolbar to the default ddd command Switches moved from
ada-prj-default-comp-cmd and ada-prj-default-make-cmd to
ada-prj-default-comp-opt
(ada-add-ada-menu): Remove the map and name parameters Add the Ada
Reference Manual to the menu
(ada-check-current): rewritten as a call to ada-compile-current
(ada-compile): Removed.
(ada-compile-application, ada-compile-current, ada-check-current):
Set the compilation-search-path so that compile.el automatically
finds the sources in src_dir. Automatic scrollong of the
compilation buffer. C-uC-cC-c asks for confirmation before
compiling
(ada-compile-current): New parameter, prj-field
(ada-complete-identifier): Load the .ali file before doing
processing
(ada-find-ali-file-in-dir): prepend build_dir to obj_dir to
conform to gnatmake's behavior.
(ada-find-file-in-dir): New function
(ada-find-references): Set the environment variables for gnatfind
(ada-find-src-file-in-dir): New function.
(ada-first-non-nil): Removed
(ada-gdb-application): Add support for jdb, the java debugger.
(ada-get-ada-file-name): Load the original-file first if not done
yet.
(ada-get-all-references): Handles the new ali syntax (parent types
are found between <>).
(ada-initialize-runtime-library): New function
(ada-mode-hook): Always load a project file when a file is opened,
so that the casing exceptions are correctly read.
(ada-operator-re): Add all missing operators ("abs", "rem", "**").
(ada-parse-prj-file): Use find-file-noselect instead of find-file
to open the project file, since the latter does not work with
speedbar Get default values before loading the prj file, or the
default executable file name is wrong. Use the absolute value of
src_dir to initialize ada-search-directories and
compilation-search-path,... Add the standard runtime library to
the search path for find-file.
(ada-prj-default-debugger): Was missing an opening '{'
(ada-prj-default-bind-opt, ada-prj-default-link-opt): New
variables.
(ada-prj-default-gnatmake-opt): New variable
(ada-prj-find-prj-file): Handles non-file buffers For non-Ada
buffers, the project file is the default one Save the windows
configuration before displaying the menu.
(ada-prj-src-dir, ada-prj-obj-dir, ada-prj-comp-opt,...): Removed
(ada-read-identifier): Fix xrefs on operators (for "mod", "and",
...) regexp-quote identifiers names to support operators +,
-,... in regexps.
(ada-remote): New function.
(ada-run-application): Erase the output buffer before starting the
run Support remote execution of the application. Use
call-process, or the arguments are incorrectly parsed
(ada-set-default-project-file): Reread the content of the active
project file, not the one from the current buffer When a project
file is set as the default project, all directories are
automatically associated with it.
(ada-set-environment): New function
(ada-treat-cmd-string): New special variable ${current}
(ada-treat-cmd-string): Revised. The substitution is now done for
any ${...} substring
(ada-xref-current): If no body was found, compiles the spec
instead. Setup ADA_{SOURCE,OBJECTS}_PATH before running the
compiler to get rid of command line length limitations.
(ada-xref-get-project-field): New function
(ada-xref-project-files): New variable
(ada-xref-runtime-library-specs-path)
(ada-xref-runtime-library-ali-path): New variables
(ada-xref-set-default-prj-values): Default run command now does a
cd to the build directory. New field: main_unit Provide a default
file name even if the current buffer has no prj file.
2000-07-24 11:13:11 +00:00
|
|
|
((stringp value)
|
2002-04-09 18:54:20 +00:00
|
|
|
(setq cmd-string (replace-match value t t cmd-string)))
|
Got rid of all byte-compiler warnings on Emacs.
Add to the menu when the file is loaded, not in ada-mode-hook.
Add -toolbar to the default ddd command Switches moved from
ada-prj-default-comp-cmd and ada-prj-default-make-cmd to
ada-prj-default-comp-opt
(ada-add-ada-menu): Remove the map and name parameters Add the Ada
Reference Manual to the menu
(ada-check-current): rewritten as a call to ada-compile-current
(ada-compile): Removed.
(ada-compile-application, ada-compile-current, ada-check-current):
Set the compilation-search-path so that compile.el automatically
finds the sources in src_dir. Automatic scrollong of the
compilation buffer. C-uC-cC-c asks for confirmation before
compiling
(ada-compile-current): New parameter, prj-field
(ada-complete-identifier): Load the .ali file before doing
processing
(ada-find-ali-file-in-dir): prepend build_dir to obj_dir to
conform to gnatmake's behavior.
(ada-find-file-in-dir): New function
(ada-find-references): Set the environment variables for gnatfind
(ada-find-src-file-in-dir): New function.
(ada-first-non-nil): Removed
(ada-gdb-application): Add support for jdb, the java debugger.
(ada-get-ada-file-name): Load the original-file first if not done
yet.
(ada-get-all-references): Handles the new ali syntax (parent types
are found between <>).
(ada-initialize-runtime-library): New function
(ada-mode-hook): Always load a project file when a file is opened,
so that the casing exceptions are correctly read.
(ada-operator-re): Add all missing operators ("abs", "rem", "**").
(ada-parse-prj-file): Use find-file-noselect instead of find-file
to open the project file, since the latter does not work with
speedbar Get default values before loading the prj file, or the
default executable file name is wrong. Use the absolute value of
src_dir to initialize ada-search-directories and
compilation-search-path,... Add the standard runtime library to
the search path for find-file.
(ada-prj-default-debugger): Was missing an opening '{'
(ada-prj-default-bind-opt, ada-prj-default-link-opt): New
variables.
(ada-prj-default-gnatmake-opt): New variable
(ada-prj-find-prj-file): Handles non-file buffers For non-Ada
buffers, the project file is the default one Save the windows
configuration before displaying the menu.
(ada-prj-src-dir, ada-prj-obj-dir, ada-prj-comp-opt,...): Removed
(ada-read-identifier): Fix xrefs on operators (for "mod", "and",
...) regexp-quote identifiers names to support operators +,
-,... in regexps.
(ada-remote): New function.
(ada-run-application): Erase the output buffer before starting the
run Support remote execution of the application. Use
call-process, or the arguments are incorrectly parsed
(ada-set-default-project-file): Reread the content of the active
project file, not the one from the current buffer When a project
file is set as the default project, all directories are
automatically associated with it.
(ada-set-environment): New function
(ada-treat-cmd-string): New special variable ${current}
(ada-treat-cmd-string): Revised. The substitution is now done for
any ${...} substring
(ada-xref-current): If no body was found, compiles the spec
instead. Setup ADA_{SOURCE,OBJECTS}_PATH before running the
compiler to get rid of command line length limitations.
(ada-xref-get-project-field): New function
(ada-xref-project-files): New variable
(ada-xref-runtime-library-specs-path)
(ada-xref-runtime-library-ali-path): New variables
(ada-xref-set-default-prj-values): Default run command now does a
cd to the build directory. New field: main_unit Provide a default
file name even if the current buffer has no prj file.
2000-07-24 11:13:11 +00:00
|
|
|
((listp value)
|
|
|
|
(let ((prefix (match-string 1 cmd-string)))
|
2002-04-09 18:54:20 +00:00
|
|
|
(setq cmd-string (replace-match
|
Got rid of all byte-compiler warnings on Emacs.
Add to the menu when the file is loaded, not in ada-mode-hook.
Add -toolbar to the default ddd command Switches moved from
ada-prj-default-comp-cmd and ada-prj-default-make-cmd to
ada-prj-default-comp-opt
(ada-add-ada-menu): Remove the map and name parameters Add the Ada
Reference Manual to the menu
(ada-check-current): rewritten as a call to ada-compile-current
(ada-compile): Removed.
(ada-compile-application, ada-compile-current, ada-check-current):
Set the compilation-search-path so that compile.el automatically
finds the sources in src_dir. Automatic scrollong of the
compilation buffer. C-uC-cC-c asks for confirmation before
compiling
(ada-compile-current): New parameter, prj-field
(ada-complete-identifier): Load the .ali file before doing
processing
(ada-find-ali-file-in-dir): prepend build_dir to obj_dir to
conform to gnatmake's behavior.
(ada-find-file-in-dir): New function
(ada-find-references): Set the environment variables for gnatfind
(ada-find-src-file-in-dir): New function.
(ada-first-non-nil): Removed
(ada-gdb-application): Add support for jdb, the java debugger.
(ada-get-ada-file-name): Load the original-file first if not done
yet.
(ada-get-all-references): Handles the new ali syntax (parent types
are found between <>).
(ada-initialize-runtime-library): New function
(ada-mode-hook): Always load a project file when a file is opened,
so that the casing exceptions are correctly read.
(ada-operator-re): Add all missing operators ("abs", "rem", "**").
(ada-parse-prj-file): Use find-file-noselect instead of find-file
to open the project file, since the latter does not work with
speedbar Get default values before loading the prj file, or the
default executable file name is wrong. Use the absolute value of
src_dir to initialize ada-search-directories and
compilation-search-path,... Add the standard runtime library to
the search path for find-file.
(ada-prj-default-debugger): Was missing an opening '{'
(ada-prj-default-bind-opt, ada-prj-default-link-opt): New
variables.
(ada-prj-default-gnatmake-opt): New variable
(ada-prj-find-prj-file): Handles non-file buffers For non-Ada
buffers, the project file is the default one Save the windows
configuration before displaying the menu.
(ada-prj-src-dir, ada-prj-obj-dir, ada-prj-comp-opt,...): Removed
(ada-read-identifier): Fix xrefs on operators (for "mod", "and",
...) regexp-quote identifiers names to support operators +,
-,... in regexps.
(ada-remote): New function.
(ada-run-application): Erase the output buffer before starting the
run Support remote execution of the application. Use
call-process, or the arguments are incorrectly parsed
(ada-set-default-project-file): Reread the content of the active
project file, not the one from the current buffer When a project
file is set as the default project, all directories are
automatically associated with it.
(ada-set-environment): New function
(ada-treat-cmd-string): New special variable ${current}
(ada-treat-cmd-string): Revised. The substitution is now done for
any ${...} substring
(ada-xref-current): If no body was found, compiles the spec
instead. Setup ADA_{SOURCE,OBJECTS}_PATH before running the
compiler to get rid of command line length limitations.
(ada-xref-get-project-field): New function
(ada-xref-project-files): New variable
(ada-xref-runtime-library-specs-path)
(ada-xref-runtime-library-ali-path): New variables
(ada-xref-set-default-prj-values): Default run command now does a
cd to the build directory. New field: main_unit Provide a default
file name even if the current buffer has no prj file.
2000-07-24 11:13:11 +00:00
|
|
|
(mapconcat (lambda(x) (concat prefix x)) value " ")
|
|
|
|
t t cmd-string)))))
|
|
|
|
))
|
|
|
|
cmd-string)
|
|
|
|
|
|
|
|
(defun ada-xref-set-default-prj-values (symbol ada-buffer)
|
|
|
|
"Reset the properties in SYMBOL to the default values for ADA-BUFFER."
|
|
|
|
|
|
|
|
(let ((file (buffer-file-name ada-buffer))
|
|
|
|
plist)
|
|
|
|
(save-excursion
|
|
|
|
(set-buffer ada-buffer)
|
2003-02-04 13:24:35 +00:00
|
|
|
|
Got rid of all byte-compiler warnings on Emacs.
Add to the menu when the file is loaded, not in ada-mode-hook.
Add -toolbar to the default ddd command Switches moved from
ada-prj-default-comp-cmd and ada-prj-default-make-cmd to
ada-prj-default-comp-opt
(ada-add-ada-menu): Remove the map and name parameters Add the Ada
Reference Manual to the menu
(ada-check-current): rewritten as a call to ada-compile-current
(ada-compile): Removed.
(ada-compile-application, ada-compile-current, ada-check-current):
Set the compilation-search-path so that compile.el automatically
finds the sources in src_dir. Automatic scrollong of the
compilation buffer. C-uC-cC-c asks for confirmation before
compiling
(ada-compile-current): New parameter, prj-field
(ada-complete-identifier): Load the .ali file before doing
processing
(ada-find-ali-file-in-dir): prepend build_dir to obj_dir to
conform to gnatmake's behavior.
(ada-find-file-in-dir): New function
(ada-find-references): Set the environment variables for gnatfind
(ada-find-src-file-in-dir): New function.
(ada-first-non-nil): Removed
(ada-gdb-application): Add support for jdb, the java debugger.
(ada-get-ada-file-name): Load the original-file first if not done
yet.
(ada-get-all-references): Handles the new ali syntax (parent types
are found between <>).
(ada-initialize-runtime-library): New function
(ada-mode-hook): Always load a project file when a file is opened,
so that the casing exceptions are correctly read.
(ada-operator-re): Add all missing operators ("abs", "rem", "**").
(ada-parse-prj-file): Use find-file-noselect instead of find-file
to open the project file, since the latter does not work with
speedbar Get default values before loading the prj file, or the
default executable file name is wrong. Use the absolute value of
src_dir to initialize ada-search-directories and
compilation-search-path,... Add the standard runtime library to
the search path for find-file.
(ada-prj-default-debugger): Was missing an opening '{'
(ada-prj-default-bind-opt, ada-prj-default-link-opt): New
variables.
(ada-prj-default-gnatmake-opt): New variable
(ada-prj-find-prj-file): Handles non-file buffers For non-Ada
buffers, the project file is the default one Save the windows
configuration before displaying the menu.
(ada-prj-src-dir, ada-prj-obj-dir, ada-prj-comp-opt,...): Removed
(ada-read-identifier): Fix xrefs on operators (for "mod", "and",
...) regexp-quote identifiers names to support operators +,
-,... in regexps.
(ada-remote): New function.
(ada-run-application): Erase the output buffer before starting the
run Support remote execution of the application. Use
call-process, or the arguments are incorrectly parsed
(ada-set-default-project-file): Reread the content of the active
project file, not the one from the current buffer When a project
file is set as the default project, all directories are
automatically associated with it.
(ada-set-environment): New function
(ada-treat-cmd-string): New special variable ${current}
(ada-treat-cmd-string): Revised. The substitution is now done for
any ${...} substring
(ada-xref-current): If no body was found, compiles the spec
instead. Setup ADA_{SOURCE,OBJECTS}_PATH before running the
compiler to get rid of command line length limitations.
(ada-xref-get-project-field): New function
(ada-xref-project-files): New variable
(ada-xref-runtime-library-specs-path)
(ada-xref-runtime-library-ali-path): New variables
(ada-xref-set-default-prj-values): Default run command now does a
cd to the build directory. New field: main_unit Provide a default
file name even if the current buffer has no prj file.
2000-07-24 11:13:11 +00:00
|
|
|
(set 'plist
|
2006-10-31 00:57:56 +00:00
|
|
|
;; Try hard to find a project file, even if the current
|
|
|
|
;; buffer is not an Ada file or not associated with a file
|
2002-04-09 18:54:20 +00:00
|
|
|
(list 'filename (expand-file-name
|
|
|
|
(cond
|
|
|
|
(ada-prj-default-project-file
|
|
|
|
ada-prj-default-project-file)
|
2003-04-29 23:40:08 +00:00
|
|
|
(file (ada-prj-find-prj-file file t))
|
2002-04-09 18:54:20 +00:00
|
|
|
(t
|
|
|
|
(message (concat "Not editing an Ada file,"
|
|
|
|
"and no default project "
|
|
|
|
"file specified!"))
|
|
|
|
"")))
|
Got rid of all byte-compiler warnings on Emacs.
Add to the menu when the file is loaded, not in ada-mode-hook.
Add -toolbar to the default ddd command Switches moved from
ada-prj-default-comp-cmd and ada-prj-default-make-cmd to
ada-prj-default-comp-opt
(ada-add-ada-menu): Remove the map and name parameters Add the Ada
Reference Manual to the menu
(ada-check-current): rewritten as a call to ada-compile-current
(ada-compile): Removed.
(ada-compile-application, ada-compile-current, ada-check-current):
Set the compilation-search-path so that compile.el automatically
finds the sources in src_dir. Automatic scrollong of the
compilation buffer. C-uC-cC-c asks for confirmation before
compiling
(ada-compile-current): New parameter, prj-field
(ada-complete-identifier): Load the .ali file before doing
processing
(ada-find-ali-file-in-dir): prepend build_dir to obj_dir to
conform to gnatmake's behavior.
(ada-find-file-in-dir): New function
(ada-find-references): Set the environment variables for gnatfind
(ada-find-src-file-in-dir): New function.
(ada-first-non-nil): Removed
(ada-gdb-application): Add support for jdb, the java debugger.
(ada-get-ada-file-name): Load the original-file first if not done
yet.
(ada-get-all-references): Handles the new ali syntax (parent types
are found between <>).
(ada-initialize-runtime-library): New function
(ada-mode-hook): Always load a project file when a file is opened,
so that the casing exceptions are correctly read.
(ada-operator-re): Add all missing operators ("abs", "rem", "**").
(ada-parse-prj-file): Use find-file-noselect instead of find-file
to open the project file, since the latter does not work with
speedbar Get default values before loading the prj file, or the
default executable file name is wrong. Use the absolute value of
src_dir to initialize ada-search-directories and
compilation-search-path,... Add the standard runtime library to
the search path for find-file.
(ada-prj-default-debugger): Was missing an opening '{'
(ada-prj-default-bind-opt, ada-prj-default-link-opt): New
variables.
(ada-prj-default-gnatmake-opt): New variable
(ada-prj-find-prj-file): Handles non-file buffers For non-Ada
buffers, the project file is the default one Save the windows
configuration before displaying the menu.
(ada-prj-src-dir, ada-prj-obj-dir, ada-prj-comp-opt,...): Removed
(ada-read-identifier): Fix xrefs on operators (for "mod", "and",
...) regexp-quote identifiers names to support operators +,
-,... in regexps.
(ada-remote): New function.
(ada-run-application): Erase the output buffer before starting the
run Support remote execution of the application. Use
call-process, or the arguments are incorrectly parsed
(ada-set-default-project-file): Reread the content of the active
project file, not the one from the current buffer When a project
file is set as the default project, all directories are
automatically associated with it.
(ada-set-environment): New function
(ada-treat-cmd-string): New special variable ${current}
(ada-treat-cmd-string): Revised. The substitution is now done for
any ${...} substring
(ada-xref-current): If no body was found, compiles the spec
instead. Setup ADA_{SOURCE,OBJECTS}_PATH before running the
compiler to get rid of command line length limitations.
(ada-xref-get-project-field): New function
(ada-xref-project-files): New variable
(ada-xref-runtime-library-specs-path)
(ada-xref-runtime-library-ali-path): New variables
(ada-xref-set-default-prj-values): Default run command now does a
cd to the build directory. New field: main_unit Provide a default
file name even if the current buffer has no prj file.
2000-07-24 11:13:11 +00:00
|
|
|
'build_dir (file-name-as-directory (expand-file-name "."))
|
|
|
|
'src_dir (list ".")
|
|
|
|
'obj_dir (list ".")
|
|
|
|
'casing (if (listp ada-case-exception-file)
|
|
|
|
ada-case-exception-file
|
|
|
|
(list ada-case-exception-file))
|
|
|
|
'comp_opt ada-prj-default-comp-opt
|
|
|
|
'bind_opt ada-prj-default-bind-opt
|
|
|
|
'link_opt ada-prj-default-link-opt
|
|
|
|
'gnatmake_opt ada-prj-default-gnatmake-opt
|
2002-04-09 18:54:20 +00:00
|
|
|
'gnatfind_opt ada-prj-gnatfind-switches
|
Got rid of all byte-compiler warnings on Emacs.
Add to the menu when the file is loaded, not in ada-mode-hook.
Add -toolbar to the default ddd command Switches moved from
ada-prj-default-comp-cmd and ada-prj-default-make-cmd to
ada-prj-default-comp-opt
(ada-add-ada-menu): Remove the map and name parameters Add the Ada
Reference Manual to the menu
(ada-check-current): rewritten as a call to ada-compile-current
(ada-compile): Removed.
(ada-compile-application, ada-compile-current, ada-check-current):
Set the compilation-search-path so that compile.el automatically
finds the sources in src_dir. Automatic scrollong of the
compilation buffer. C-uC-cC-c asks for confirmation before
compiling
(ada-compile-current): New parameter, prj-field
(ada-complete-identifier): Load the .ali file before doing
processing
(ada-find-ali-file-in-dir): prepend build_dir to obj_dir to
conform to gnatmake's behavior.
(ada-find-file-in-dir): New function
(ada-find-references): Set the environment variables for gnatfind
(ada-find-src-file-in-dir): New function.
(ada-first-non-nil): Removed
(ada-gdb-application): Add support for jdb, the java debugger.
(ada-get-ada-file-name): Load the original-file first if not done
yet.
(ada-get-all-references): Handles the new ali syntax (parent types
are found between <>).
(ada-initialize-runtime-library): New function
(ada-mode-hook): Always load a project file when a file is opened,
so that the casing exceptions are correctly read.
(ada-operator-re): Add all missing operators ("abs", "rem", "**").
(ada-parse-prj-file): Use find-file-noselect instead of find-file
to open the project file, since the latter does not work with
speedbar Get default values before loading the prj file, or the
default executable file name is wrong. Use the absolute value of
src_dir to initialize ada-search-directories and
compilation-search-path,... Add the standard runtime library to
the search path for find-file.
(ada-prj-default-debugger): Was missing an opening '{'
(ada-prj-default-bind-opt, ada-prj-default-link-opt): New
variables.
(ada-prj-default-gnatmake-opt): New variable
(ada-prj-find-prj-file): Handles non-file buffers For non-Ada
buffers, the project file is the default one Save the windows
configuration before displaying the menu.
(ada-prj-src-dir, ada-prj-obj-dir, ada-prj-comp-opt,...): Removed
(ada-read-identifier): Fix xrefs on operators (for "mod", "and",
...) regexp-quote identifiers names to support operators +,
-,... in regexps.
(ada-remote): New function.
(ada-run-application): Erase the output buffer before starting the
run Support remote execution of the application. Use
call-process, or the arguments are incorrectly parsed
(ada-set-default-project-file): Reread the content of the active
project file, not the one from the current buffer When a project
file is set as the default project, all directories are
automatically associated with it.
(ada-set-environment): New function
(ada-treat-cmd-string): New special variable ${current}
(ada-treat-cmd-string): Revised. The substitution is now done for
any ${...} substring
(ada-xref-current): If no body was found, compiles the spec
instead. Setup ADA_{SOURCE,OBJECTS}_PATH before running the
compiler to get rid of command line length limitations.
(ada-xref-get-project-field): New function
(ada-xref-project-files): New variable
(ada-xref-runtime-library-specs-path)
(ada-xref-runtime-library-ali-path): New variables
(ada-xref-set-default-prj-values): Default run command now does a
cd to the build directory. New field: main_unit Provide a default
file name even if the current buffer has no prj file.
2000-07-24 11:13:11 +00:00
|
|
|
'main (if file
|
2002-04-09 18:54:20 +00:00
|
|
|
(file-name-nondirectory
|
|
|
|
(file-name-sans-extension file))
|
Got rid of all byte-compiler warnings on Emacs.
Add to the menu when the file is loaded, not in ada-mode-hook.
Add -toolbar to the default ddd command Switches moved from
ada-prj-default-comp-cmd and ada-prj-default-make-cmd to
ada-prj-default-comp-opt
(ada-add-ada-menu): Remove the map and name parameters Add the Ada
Reference Manual to the menu
(ada-check-current): rewritten as a call to ada-compile-current
(ada-compile): Removed.
(ada-compile-application, ada-compile-current, ada-check-current):
Set the compilation-search-path so that compile.el automatically
finds the sources in src_dir. Automatic scrollong of the
compilation buffer. C-uC-cC-c asks for confirmation before
compiling
(ada-compile-current): New parameter, prj-field
(ada-complete-identifier): Load the .ali file before doing
processing
(ada-find-ali-file-in-dir): prepend build_dir to obj_dir to
conform to gnatmake's behavior.
(ada-find-file-in-dir): New function
(ada-find-references): Set the environment variables for gnatfind
(ada-find-src-file-in-dir): New function.
(ada-first-non-nil): Removed
(ada-gdb-application): Add support for jdb, the java debugger.
(ada-get-ada-file-name): Load the original-file first if not done
yet.
(ada-get-all-references): Handles the new ali syntax (parent types
are found between <>).
(ada-initialize-runtime-library): New function
(ada-mode-hook): Always load a project file when a file is opened,
so that the casing exceptions are correctly read.
(ada-operator-re): Add all missing operators ("abs", "rem", "**").
(ada-parse-prj-file): Use find-file-noselect instead of find-file
to open the project file, since the latter does not work with
speedbar Get default values before loading the prj file, or the
default executable file name is wrong. Use the absolute value of
src_dir to initialize ada-search-directories and
compilation-search-path,... Add the standard runtime library to
the search path for find-file.
(ada-prj-default-debugger): Was missing an opening '{'
(ada-prj-default-bind-opt, ada-prj-default-link-opt): New
variables.
(ada-prj-default-gnatmake-opt): New variable
(ada-prj-find-prj-file): Handles non-file buffers For non-Ada
buffers, the project file is the default one Save the windows
configuration before displaying the menu.
(ada-prj-src-dir, ada-prj-obj-dir, ada-prj-comp-opt,...): Removed
(ada-read-identifier): Fix xrefs on operators (for "mod", "and",
...) regexp-quote identifiers names to support operators +,
-,... in regexps.
(ada-remote): New function.
(ada-run-application): Erase the output buffer before starting the
run Support remote execution of the application. Use
call-process, or the arguments are incorrectly parsed
(ada-set-default-project-file): Reread the content of the active
project file, not the one from the current buffer When a project
file is set as the default project, all directories are
automatically associated with it.
(ada-set-environment): New function
(ada-treat-cmd-string): New special variable ${current}
(ada-treat-cmd-string): Revised. The substitution is now done for
any ${...} substring
(ada-xref-current): If no body was found, compiles the spec
instead. Setup ADA_{SOURCE,OBJECTS}_PATH before running the
compiler to get rid of command line length limitations.
(ada-xref-get-project-field): New function
(ada-xref-project-files): New variable
(ada-xref-runtime-library-specs-path)
(ada-xref-runtime-library-ali-path): New variables
(ada-xref-set-default-prj-values): Default run command now does a
cd to the build directory. New field: main_unit Provide a default
file name even if the current buffer has no prj file.
2000-07-24 11:13:11 +00:00
|
|
|
"")
|
|
|
|
'main_unit (if file
|
|
|
|
(file-name-nondirectory
|
|
|
|
(file-name-sans-extension file))
|
|
|
|
"")
|
|
|
|
'cross_prefix ""
|
|
|
|
'remote_machine ""
|
2002-04-09 18:54:20 +00:00
|
|
|
'comp_cmd (list (concat ada-cd-command " ${build_dir}")
|
|
|
|
ada-prj-default-comp-cmd)
|
|
|
|
'check_cmd (list (concat ada-prj-default-comp-cmd " "
|
|
|
|
ada-check-switch))
|
|
|
|
'make_cmd (list (concat ada-cd-command " ${build_dir}")
|
|
|
|
ada-prj-default-make-cmd)
|
|
|
|
'run_cmd (list (concat ada-cd-command " ${build_dir}")
|
|
|
|
(concat "${main}"
|
|
|
|
(if is-windows ".exe")))
|
|
|
|
'debug_pre_cmd (list (concat ada-cd-command
|
|
|
|
" ${build_dir}"))
|
Got rid of all byte-compiler warnings on Emacs.
Add to the menu when the file is loaded, not in ada-mode-hook.
Add -toolbar to the default ddd command Switches moved from
ada-prj-default-comp-cmd and ada-prj-default-make-cmd to
ada-prj-default-comp-opt
(ada-add-ada-menu): Remove the map and name parameters Add the Ada
Reference Manual to the menu
(ada-check-current): rewritten as a call to ada-compile-current
(ada-compile): Removed.
(ada-compile-application, ada-compile-current, ada-check-current):
Set the compilation-search-path so that compile.el automatically
finds the sources in src_dir. Automatic scrollong of the
compilation buffer. C-uC-cC-c asks for confirmation before
compiling
(ada-compile-current): New parameter, prj-field
(ada-complete-identifier): Load the .ali file before doing
processing
(ada-find-ali-file-in-dir): prepend build_dir to obj_dir to
conform to gnatmake's behavior.
(ada-find-file-in-dir): New function
(ada-find-references): Set the environment variables for gnatfind
(ada-find-src-file-in-dir): New function.
(ada-first-non-nil): Removed
(ada-gdb-application): Add support for jdb, the java debugger.
(ada-get-ada-file-name): Load the original-file first if not done
yet.
(ada-get-all-references): Handles the new ali syntax (parent types
are found between <>).
(ada-initialize-runtime-library): New function
(ada-mode-hook): Always load a project file when a file is opened,
so that the casing exceptions are correctly read.
(ada-operator-re): Add all missing operators ("abs", "rem", "**").
(ada-parse-prj-file): Use find-file-noselect instead of find-file
to open the project file, since the latter does not work with
speedbar Get default values before loading the prj file, or the
default executable file name is wrong. Use the absolute value of
src_dir to initialize ada-search-directories and
compilation-search-path,... Add the standard runtime library to
the search path for find-file.
(ada-prj-default-debugger): Was missing an opening '{'
(ada-prj-default-bind-opt, ada-prj-default-link-opt): New
variables.
(ada-prj-default-gnatmake-opt): New variable
(ada-prj-find-prj-file): Handles non-file buffers For non-Ada
buffers, the project file is the default one Save the windows
configuration before displaying the menu.
(ada-prj-src-dir, ada-prj-obj-dir, ada-prj-comp-opt,...): Removed
(ada-read-identifier): Fix xrefs on operators (for "mod", "and",
...) regexp-quote identifiers names to support operators +,
-,... in regexps.
(ada-remote): New function.
(ada-run-application): Erase the output buffer before starting the
run Support remote execution of the application. Use
call-process, or the arguments are incorrectly parsed
(ada-set-default-project-file): Reread the content of the active
project file, not the one from the current buffer When a project
file is set as the default project, all directories are
automatically associated with it.
(ada-set-environment): New function
(ada-treat-cmd-string): New special variable ${current}
(ada-treat-cmd-string): Revised. The substitution is now done for
any ${...} substring
(ada-xref-current): If no body was found, compiles the spec
instead. Setup ADA_{SOURCE,OBJECTS}_PATH before running the
compiler to get rid of command line length limitations.
(ada-xref-get-project-field): New function
(ada-xref-project-files): New variable
(ada-xref-runtime-library-specs-path)
(ada-xref-runtime-library-ali-path): New variables
(ada-xref-set-default-prj-values): Default run command now does a
cd to the build directory. New field: main_unit Provide a default
file name even if the current buffer has no prj file.
2000-07-24 11:13:11 +00:00
|
|
|
'debug_cmd (concat ada-prj-default-debugger
|
|
|
|
(if is-windows " ${main}.exe"
|
2002-04-09 18:54:20 +00:00
|
|
|
" ${main}"))
|
|
|
|
'debug_post_cmd (list nil)))
|
Got rid of all byte-compiler warnings on Emacs.
Add to the menu when the file is loaded, not in ada-mode-hook.
Add -toolbar to the default ddd command Switches moved from
ada-prj-default-comp-cmd and ada-prj-default-make-cmd to
ada-prj-default-comp-opt
(ada-add-ada-menu): Remove the map and name parameters Add the Ada
Reference Manual to the menu
(ada-check-current): rewritten as a call to ada-compile-current
(ada-compile): Removed.
(ada-compile-application, ada-compile-current, ada-check-current):
Set the compilation-search-path so that compile.el automatically
finds the sources in src_dir. Automatic scrollong of the
compilation buffer. C-uC-cC-c asks for confirmation before
compiling
(ada-compile-current): New parameter, prj-field
(ada-complete-identifier): Load the .ali file before doing
processing
(ada-find-ali-file-in-dir): prepend build_dir to obj_dir to
conform to gnatmake's behavior.
(ada-find-file-in-dir): New function
(ada-find-references): Set the environment variables for gnatfind
(ada-find-src-file-in-dir): New function.
(ada-first-non-nil): Removed
(ada-gdb-application): Add support for jdb, the java debugger.
(ada-get-ada-file-name): Load the original-file first if not done
yet.
(ada-get-all-references): Handles the new ali syntax (parent types
are found between <>).
(ada-initialize-runtime-library): New function
(ada-mode-hook): Always load a project file when a file is opened,
so that the casing exceptions are correctly read.
(ada-operator-re): Add all missing operators ("abs", "rem", "**").
(ada-parse-prj-file): Use find-file-noselect instead of find-file
to open the project file, since the latter does not work with
speedbar Get default values before loading the prj file, or the
default executable file name is wrong. Use the absolute value of
src_dir to initialize ada-search-directories and
compilation-search-path,... Add the standard runtime library to
the search path for find-file.
(ada-prj-default-debugger): Was missing an opening '{'
(ada-prj-default-bind-opt, ada-prj-default-link-opt): New
variables.
(ada-prj-default-gnatmake-opt): New variable
(ada-prj-find-prj-file): Handles non-file buffers For non-Ada
buffers, the project file is the default one Save the windows
configuration before displaying the menu.
(ada-prj-src-dir, ada-prj-obj-dir, ada-prj-comp-opt,...): Removed
(ada-read-identifier): Fix xrefs on operators (for "mod", "and",
...) regexp-quote identifiers names to support operators +,
-,... in regexps.
(ada-remote): New function.
(ada-run-application): Erase the output buffer before starting the
run Support remote execution of the application. Use
call-process, or the arguments are incorrectly parsed
(ada-set-default-project-file): Reread the content of the active
project file, not the one from the current buffer When a project
file is set as the default project, all directories are
automatically associated with it.
(ada-set-environment): New function
(ada-treat-cmd-string): New special variable ${current}
(ada-treat-cmd-string): Revised. The substitution is now done for
any ${...} substring
(ada-xref-current): If no body was found, compiles the spec
instead. Setup ADA_{SOURCE,OBJECTS}_PATH before running the
compiler to get rid of command line length limitations.
(ada-xref-get-project-field): New function
(ada-xref-project-files): New variable
(ada-xref-runtime-library-specs-path)
(ada-xref-runtime-library-ali-path): New variables
(ada-xref-set-default-prj-values): Default run command now does a
cd to the build directory. New field: main_unit Provide a default
file name even if the current buffer has no prj file.
2000-07-24 11:13:11 +00:00
|
|
|
)
|
|
|
|
(set symbol plist)))
|
2003-02-04 13:24:35 +00:00
|
|
|
|
Got rid of all byte-compiler warnings on Emacs.
Add to the menu when the file is loaded, not in ada-mode-hook.
Add -toolbar to the default ddd command Switches moved from
ada-prj-default-comp-cmd and ada-prj-default-make-cmd to
ada-prj-default-comp-opt
(ada-add-ada-menu): Remove the map and name parameters Add the Ada
Reference Manual to the menu
(ada-check-current): rewritten as a call to ada-compile-current
(ada-compile): Removed.
(ada-compile-application, ada-compile-current, ada-check-current):
Set the compilation-search-path so that compile.el automatically
finds the sources in src_dir. Automatic scrollong of the
compilation buffer. C-uC-cC-c asks for confirmation before
compiling
(ada-compile-current): New parameter, prj-field
(ada-complete-identifier): Load the .ali file before doing
processing
(ada-find-ali-file-in-dir): prepend build_dir to obj_dir to
conform to gnatmake's behavior.
(ada-find-file-in-dir): New function
(ada-find-references): Set the environment variables for gnatfind
(ada-find-src-file-in-dir): New function.
(ada-first-non-nil): Removed
(ada-gdb-application): Add support for jdb, the java debugger.
(ada-get-ada-file-name): Load the original-file first if not done
yet.
(ada-get-all-references): Handles the new ali syntax (parent types
are found between <>).
(ada-initialize-runtime-library): New function
(ada-mode-hook): Always load a project file when a file is opened,
so that the casing exceptions are correctly read.
(ada-operator-re): Add all missing operators ("abs", "rem", "**").
(ada-parse-prj-file): Use find-file-noselect instead of find-file
to open the project file, since the latter does not work with
speedbar Get default values before loading the prj file, or the
default executable file name is wrong. Use the absolute value of
src_dir to initialize ada-search-directories and
compilation-search-path,... Add the standard runtime library to
the search path for find-file.
(ada-prj-default-debugger): Was missing an opening '{'
(ada-prj-default-bind-opt, ada-prj-default-link-opt): New
variables.
(ada-prj-default-gnatmake-opt): New variable
(ada-prj-find-prj-file): Handles non-file buffers For non-Ada
buffers, the project file is the default one Save the windows
configuration before displaying the menu.
(ada-prj-src-dir, ada-prj-obj-dir, ada-prj-comp-opt,...): Removed
(ada-read-identifier): Fix xrefs on operators (for "mod", "and",
...) regexp-quote identifiers names to support operators +,
-,... in regexps.
(ada-remote): New function.
(ada-run-application): Erase the output buffer before starting the
run Support remote execution of the application. Use
call-process, or the arguments are incorrectly parsed
(ada-set-default-project-file): Reread the content of the active
project file, not the one from the current buffer When a project
file is set as the default project, all directories are
automatically associated with it.
(ada-set-environment): New function
(ada-treat-cmd-string): New special variable ${current}
(ada-treat-cmd-string): Revised. The substitution is now done for
any ${...} substring
(ada-xref-current): If no body was found, compiles the spec
instead. Setup ADA_{SOURCE,OBJECTS}_PATH before running the
compiler to get rid of command line length limitations.
(ada-xref-get-project-field): New function
(ada-xref-project-files): New variable
(ada-xref-runtime-library-specs-path)
(ada-xref-runtime-library-ali-path): New variables
(ada-xref-set-default-prj-values): Default run command now does a
cd to the build directory. New field: main_unit Provide a default
file name even if the current buffer has no prj file.
2000-07-24 11:13:11 +00:00
|
|
|
(defun ada-xref-get-project-field (field)
|
2002-04-09 18:54:20 +00:00
|
|
|
"Extract the value of FIELD from the current project file.
|
2006-10-31 00:57:56 +00:00
|
|
|
Project variables are substituted.
|
2002-04-09 18:54:20 +00:00
|
|
|
|
|
|
|
Note that for src_dir and obj_dir, you should rather use
|
|
|
|
`ada-xref-get-src-dir-field' or `ada-xref-get-obj-dir-field' which will in
|
|
|
|
addition return the default paths."
|
Got rid of all byte-compiler warnings on Emacs.
Add to the menu when the file is loaded, not in ada-mode-hook.
Add -toolbar to the default ddd command Switches moved from
ada-prj-default-comp-cmd and ada-prj-default-make-cmd to
ada-prj-default-comp-opt
(ada-add-ada-menu): Remove the map and name parameters Add the Ada
Reference Manual to the menu
(ada-check-current): rewritten as a call to ada-compile-current
(ada-compile): Removed.
(ada-compile-application, ada-compile-current, ada-check-current):
Set the compilation-search-path so that compile.el automatically
finds the sources in src_dir. Automatic scrollong of the
compilation buffer. C-uC-cC-c asks for confirmation before
compiling
(ada-compile-current): New parameter, prj-field
(ada-complete-identifier): Load the .ali file before doing
processing
(ada-find-ali-file-in-dir): prepend build_dir to obj_dir to
conform to gnatmake's behavior.
(ada-find-file-in-dir): New function
(ada-find-references): Set the environment variables for gnatfind
(ada-find-src-file-in-dir): New function.
(ada-first-non-nil): Removed
(ada-gdb-application): Add support for jdb, the java debugger.
(ada-get-ada-file-name): Load the original-file first if not done
yet.
(ada-get-all-references): Handles the new ali syntax (parent types
are found between <>).
(ada-initialize-runtime-library): New function
(ada-mode-hook): Always load a project file when a file is opened,
so that the casing exceptions are correctly read.
(ada-operator-re): Add all missing operators ("abs", "rem", "**").
(ada-parse-prj-file): Use find-file-noselect instead of find-file
to open the project file, since the latter does not work with
speedbar Get default values before loading the prj file, or the
default executable file name is wrong. Use the absolute value of
src_dir to initialize ada-search-directories and
compilation-search-path,... Add the standard runtime library to
the search path for find-file.
(ada-prj-default-debugger): Was missing an opening '{'
(ada-prj-default-bind-opt, ada-prj-default-link-opt): New
variables.
(ada-prj-default-gnatmake-opt): New variable
(ada-prj-find-prj-file): Handles non-file buffers For non-Ada
buffers, the project file is the default one Save the windows
configuration before displaying the menu.
(ada-prj-src-dir, ada-prj-obj-dir, ada-prj-comp-opt,...): Removed
(ada-read-identifier): Fix xrefs on operators (for "mod", "and",
...) regexp-quote identifiers names to support operators +,
-,... in regexps.
(ada-remote): New function.
(ada-run-application): Erase the output buffer before starting the
run Support remote execution of the application. Use
call-process, or the arguments are incorrectly parsed
(ada-set-default-project-file): Reread the content of the active
project file, not the one from the current buffer When a project
file is set as the default project, all directories are
automatically associated with it.
(ada-set-environment): New function
(ada-treat-cmd-string): New special variable ${current}
(ada-treat-cmd-string): Revised. The substitution is now done for
any ${...} substring
(ada-xref-current): If no body was found, compiles the spec
instead. Setup ADA_{SOURCE,OBJECTS}_PATH before running the
compiler to get rid of command line length limitations.
(ada-xref-get-project-field): New function
(ada-xref-project-files): New variable
(ada-xref-runtime-library-specs-path)
(ada-xref-runtime-library-ali-path): New variables
(ada-xref-set-default-prj-values): Default run command now does a
cd to the build directory. New field: main_unit Provide a default
file name even if the current buffer has no prj file.
2000-07-24 11:13:11 +00:00
|
|
|
|
2002-04-09 18:54:20 +00:00
|
|
|
(let ((file-name ada-prj-default-project-file)
|
Got rid of all byte-compiler warnings on Emacs.
Add to the menu when the file is loaded, not in ada-mode-hook.
Add -toolbar to the default ddd command Switches moved from
ada-prj-default-comp-cmd and ada-prj-default-make-cmd to
ada-prj-default-comp-opt
(ada-add-ada-menu): Remove the map and name parameters Add the Ada
Reference Manual to the menu
(ada-check-current): rewritten as a call to ada-compile-current
(ada-compile): Removed.
(ada-compile-application, ada-compile-current, ada-check-current):
Set the compilation-search-path so that compile.el automatically
finds the sources in src_dir. Automatic scrollong of the
compilation buffer. C-uC-cC-c asks for confirmation before
compiling
(ada-compile-current): New parameter, prj-field
(ada-complete-identifier): Load the .ali file before doing
processing
(ada-find-ali-file-in-dir): prepend build_dir to obj_dir to
conform to gnatmake's behavior.
(ada-find-file-in-dir): New function
(ada-find-references): Set the environment variables for gnatfind
(ada-find-src-file-in-dir): New function.
(ada-first-non-nil): Removed
(ada-gdb-application): Add support for jdb, the java debugger.
(ada-get-ada-file-name): Load the original-file first if not done
yet.
(ada-get-all-references): Handles the new ali syntax (parent types
are found between <>).
(ada-initialize-runtime-library): New function
(ada-mode-hook): Always load a project file when a file is opened,
so that the casing exceptions are correctly read.
(ada-operator-re): Add all missing operators ("abs", "rem", "**").
(ada-parse-prj-file): Use find-file-noselect instead of find-file
to open the project file, since the latter does not work with
speedbar Get default values before loading the prj file, or the
default executable file name is wrong. Use the absolute value of
src_dir to initialize ada-search-directories and
compilation-search-path,... Add the standard runtime library to
the search path for find-file.
(ada-prj-default-debugger): Was missing an opening '{'
(ada-prj-default-bind-opt, ada-prj-default-link-opt): New
variables.
(ada-prj-default-gnatmake-opt): New variable
(ada-prj-find-prj-file): Handles non-file buffers For non-Ada
buffers, the project file is the default one Save the windows
configuration before displaying the menu.
(ada-prj-src-dir, ada-prj-obj-dir, ada-prj-comp-opt,...): Removed
(ada-read-identifier): Fix xrefs on operators (for "mod", "and",
...) regexp-quote identifiers names to support operators +,
-,... in regexps.
(ada-remote): New function.
(ada-run-application): Erase the output buffer before starting the
run Support remote execution of the application. Use
call-process, or the arguments are incorrectly parsed
(ada-set-default-project-file): Reread the content of the active
project file, not the one from the current buffer When a project
file is set as the default project, all directories are
automatically associated with it.
(ada-set-environment): New function
(ada-treat-cmd-string): New special variable ${current}
(ada-treat-cmd-string): Revised. The substitution is now done for
any ${...} substring
(ada-xref-current): If no body was found, compiles the spec
instead. Setup ADA_{SOURCE,OBJECTS}_PATH before running the
compiler to get rid of command line length limitations.
(ada-xref-get-project-field): New function
(ada-xref-project-files): New variable
(ada-xref-runtime-library-specs-path)
(ada-xref-runtime-library-ali-path): New variables
(ada-xref-set-default-prj-values): Default run command now does a
cd to the build directory. New field: main_unit Provide a default
file name even if the current buffer has no prj file.
2000-07-24 11:13:11 +00:00
|
|
|
file value)
|
|
|
|
|
2002-04-09 18:54:20 +00:00
|
|
|
;; Get the project file (either the current one, or a default one)
|
|
|
|
(setq file (or (assoc file-name ada-xref-project-files)
|
|
|
|
(assoc nil ada-xref-project-files)))
|
2003-02-04 13:24:35 +00:00
|
|
|
|
Got rid of all byte-compiler warnings on Emacs.
Add to the menu when the file is loaded, not in ada-mode-hook.
Add -toolbar to the default ddd command Switches moved from
ada-prj-default-comp-cmd and ada-prj-default-make-cmd to
ada-prj-default-comp-opt
(ada-add-ada-menu): Remove the map and name parameters Add the Ada
Reference Manual to the menu
(ada-check-current): rewritten as a call to ada-compile-current
(ada-compile): Removed.
(ada-compile-application, ada-compile-current, ada-check-current):
Set the compilation-search-path so that compile.el automatically
finds the sources in src_dir. Automatic scrollong of the
compilation buffer. C-uC-cC-c asks for confirmation before
compiling
(ada-compile-current): New parameter, prj-field
(ada-complete-identifier): Load the .ali file before doing
processing
(ada-find-ali-file-in-dir): prepend build_dir to obj_dir to
conform to gnatmake's behavior.
(ada-find-file-in-dir): New function
(ada-find-references): Set the environment variables for gnatfind
(ada-find-src-file-in-dir): New function.
(ada-first-non-nil): Removed
(ada-gdb-application): Add support for jdb, the java debugger.
(ada-get-ada-file-name): Load the original-file first if not done
yet.
(ada-get-all-references): Handles the new ali syntax (parent types
are found between <>).
(ada-initialize-runtime-library): New function
(ada-mode-hook): Always load a project file when a file is opened,
so that the casing exceptions are correctly read.
(ada-operator-re): Add all missing operators ("abs", "rem", "**").
(ada-parse-prj-file): Use find-file-noselect instead of find-file
to open the project file, since the latter does not work with
speedbar Get default values before loading the prj file, or the
default executable file name is wrong. Use the absolute value of
src_dir to initialize ada-search-directories and
compilation-search-path,... Add the standard runtime library to
the search path for find-file.
(ada-prj-default-debugger): Was missing an opening '{'
(ada-prj-default-bind-opt, ada-prj-default-link-opt): New
variables.
(ada-prj-default-gnatmake-opt): New variable
(ada-prj-find-prj-file): Handles non-file buffers For non-Ada
buffers, the project file is the default one Save the windows
configuration before displaying the menu.
(ada-prj-src-dir, ada-prj-obj-dir, ada-prj-comp-opt,...): Removed
(ada-read-identifier): Fix xrefs on operators (for "mod", "and",
...) regexp-quote identifiers names to support operators +,
-,... in regexps.
(ada-remote): New function.
(ada-run-application): Erase the output buffer before starting the
run Support remote execution of the application. Use
call-process, or the arguments are incorrectly parsed
(ada-set-default-project-file): Reread the content of the active
project file, not the one from the current buffer When a project
file is set as the default project, all directories are
automatically associated with it.
(ada-set-environment): New function
(ada-treat-cmd-string): New special variable ${current}
(ada-treat-cmd-string): Revised. The substitution is now done for
any ${...} substring
(ada-xref-current): If no body was found, compiles the spec
instead. Setup ADA_{SOURCE,OBJECTS}_PATH before running the
compiler to get rid of command line length limitations.
(ada-xref-get-project-field): New function
(ada-xref-project-files): New variable
(ada-xref-runtime-library-specs-path)
(ada-xref-runtime-library-ali-path): New variables
(ada-xref-set-default-prj-values): Default run command now does a
cd to the build directory. New field: main_unit Provide a default
file name even if the current buffer has no prj file.
2000-07-24 11:13:11 +00:00
|
|
|
;; If the file was not found, use the default values
|
|
|
|
(if file
|
|
|
|
;; Get the value from the file
|
|
|
|
(set 'value (plist-get (cdr file) field))
|
|
|
|
|
|
|
|
;; Create a default nil file that contains the default values
|
|
|
|
(ada-xref-set-default-prj-values 'value (current-buffer))
|
|
|
|
(add-to-list 'ada-xref-project-files (cons nil value))
|
2002-04-09 18:54:20 +00:00
|
|
|
(ada-xref-update-project-menu)
|
Got rid of all byte-compiler warnings on Emacs.
Add to the menu when the file is loaded, not in ada-mode-hook.
Add -toolbar to the default ddd command Switches moved from
ada-prj-default-comp-cmd and ada-prj-default-make-cmd to
ada-prj-default-comp-opt
(ada-add-ada-menu): Remove the map and name parameters Add the Ada
Reference Manual to the menu
(ada-check-current): rewritten as a call to ada-compile-current
(ada-compile): Removed.
(ada-compile-application, ada-compile-current, ada-check-current):
Set the compilation-search-path so that compile.el automatically
finds the sources in src_dir. Automatic scrollong of the
compilation buffer. C-uC-cC-c asks for confirmation before
compiling
(ada-compile-current): New parameter, prj-field
(ada-complete-identifier): Load the .ali file before doing
processing
(ada-find-ali-file-in-dir): prepend build_dir to obj_dir to
conform to gnatmake's behavior.
(ada-find-file-in-dir): New function
(ada-find-references): Set the environment variables for gnatfind
(ada-find-src-file-in-dir): New function.
(ada-first-non-nil): Removed
(ada-gdb-application): Add support for jdb, the java debugger.
(ada-get-ada-file-name): Load the original-file first if not done
yet.
(ada-get-all-references): Handles the new ali syntax (parent types
are found between <>).
(ada-initialize-runtime-library): New function
(ada-mode-hook): Always load a project file when a file is opened,
so that the casing exceptions are correctly read.
(ada-operator-re): Add all missing operators ("abs", "rem", "**").
(ada-parse-prj-file): Use find-file-noselect instead of find-file
to open the project file, since the latter does not work with
speedbar Get default values before loading the prj file, or the
default executable file name is wrong. Use the absolute value of
src_dir to initialize ada-search-directories and
compilation-search-path,... Add the standard runtime library to
the search path for find-file.
(ada-prj-default-debugger): Was missing an opening '{'
(ada-prj-default-bind-opt, ada-prj-default-link-opt): New
variables.
(ada-prj-default-gnatmake-opt): New variable
(ada-prj-find-prj-file): Handles non-file buffers For non-Ada
buffers, the project file is the default one Save the windows
configuration before displaying the menu.
(ada-prj-src-dir, ada-prj-obj-dir, ada-prj-comp-opt,...): Removed
(ada-read-identifier): Fix xrefs on operators (for "mod", "and",
...) regexp-quote identifiers names to support operators +,
-,... in regexps.
(ada-remote): New function.
(ada-run-application): Erase the output buffer before starting the
run Support remote execution of the application. Use
call-process, or the arguments are incorrectly parsed
(ada-set-default-project-file): Reread the content of the active
project file, not the one from the current buffer When a project
file is set as the default project, all directories are
automatically associated with it.
(ada-set-environment): New function
(ada-treat-cmd-string): New special variable ${current}
(ada-treat-cmd-string): Revised. The substitution is now done for
any ${...} substring
(ada-xref-current): If no body was found, compiles the spec
instead. Setup ADA_{SOURCE,OBJECTS}_PATH before running the
compiler to get rid of command line length limitations.
(ada-xref-get-project-field): New function
(ada-xref-project-files): New variable
(ada-xref-runtime-library-specs-path)
(ada-xref-runtime-library-ali-path): New variables
(ada-xref-set-default-prj-values): Default run command now does a
cd to the build directory. New field: main_unit Provide a default
file name even if the current buffer has no prj file.
2000-07-24 11:13:11 +00:00
|
|
|
(set 'value (plist-get value field))
|
|
|
|
)
|
2002-04-09 18:54:20 +00:00
|
|
|
|
|
|
|
;; Substitute the ${...} constructs in all the strings, including
|
|
|
|
;; inside lists
|
|
|
|
(cond
|
|
|
|
((stringp value)
|
|
|
|
(ada-treat-cmd-string value))
|
|
|
|
((null value)
|
|
|
|
nil)
|
|
|
|
((listp value)
|
|
|
|
(mapcar (lambda(x) (if x (ada-treat-cmd-string x) x)) value))
|
|
|
|
(t
|
|
|
|
value)
|
|
|
|
)
|
|
|
|
))
|
|
|
|
|
|
|
|
(defun ada-xref-get-src-dir-field ()
|
|
|
|
"Return the full value for src_dir, including the default directories.
|
|
|
|
All the directories are returned as absolute directories."
|
|
|
|
|
|
|
|
(let ((build-dir (ada-xref-get-project-field 'build_dir)))
|
|
|
|
(append
|
|
|
|
;; Add ${build_dir} in front of the path
|
|
|
|
(list build-dir)
|
2003-02-04 13:24:35 +00:00
|
|
|
|
2002-04-09 18:54:20 +00:00
|
|
|
(ada-get-absolute-dir-list (ada-xref-get-project-field 'src_dir)
|
|
|
|
build-dir)
|
2003-02-04 13:24:35 +00:00
|
|
|
|
2002-04-09 18:54:20 +00:00
|
|
|
;; Add the standard runtime at the end
|
|
|
|
ada-xref-runtime-library-specs-path)))
|
|
|
|
|
|
|
|
(defun ada-xref-get-obj-dir-field ()
|
|
|
|
"Return the full value for obj_dir, including the default directories.
|
|
|
|
All the directories are returned as absolute directories."
|
|
|
|
|
|
|
|
(let ((build-dir (ada-xref-get-project-field 'build_dir)))
|
|
|
|
(append
|
|
|
|
;; Add ${build_dir} in front of the path
|
|
|
|
(list build-dir)
|
2003-02-04 13:24:35 +00:00
|
|
|
|
2002-04-09 18:54:20 +00:00
|
|
|
(ada-get-absolute-dir-list (ada-xref-get-project-field 'obj_dir)
|
|
|
|
build-dir)
|
2003-02-04 13:24:35 +00:00
|
|
|
|
2002-04-09 18:54:20 +00:00
|
|
|
;; Add the standard runtime at the end
|
|
|
|
ada-xref-runtime-library-ali-path)))
|
|
|
|
|
|
|
|
(defun ada-xref-update-project-menu ()
|
|
|
|
"Update the menu Ada->Project, with the list of available project files."
|
2003-05-13 21:15:44 +00:00
|
|
|
;; Create the standard items.
|
|
|
|
(let ((submenu
|
|
|
|
`("Project"
|
|
|
|
["Load..." ada-set-default-project-file t]
|
|
|
|
["New..." ada-prj-new t]
|
|
|
|
["Edit..." ada-prj-edit t]
|
|
|
|
"---"
|
|
|
|
;; Add the new items
|
|
|
|
,@(mapcar
|
|
|
|
(lambda (x)
|
|
|
|
(let ((name (or (car x) "<default>"))
|
|
|
|
(command `(lambda ()
|
|
|
|
"Change the active project file."
|
|
|
|
(interactive)
|
|
|
|
(ada-parse-prj-file ,(car x))
|
|
|
|
(set 'ada-prj-default-project-file ,(car x))
|
|
|
|
(ada-xref-update-project-menu))))
|
|
|
|
(vector
|
|
|
|
(if (string= (file-name-extension name)
|
|
|
|
ada-project-file-extension)
|
|
|
|
(file-name-sans-extension
|
|
|
|
(file-name-nondirectory name))
|
|
|
|
(file-name-nondirectory name))
|
|
|
|
command
|
|
|
|
:button (cons
|
|
|
|
:toggle
|
|
|
|
(equal ada-prj-default-project-file
|
|
|
|
(car x))
|
|
|
|
))))
|
2004-06-29 13:01:14 +00:00
|
|
|
|
2003-05-13 21:15:44 +00:00
|
|
|
;; Parses all the known project files, and insert at
|
|
|
|
;; least the default one (in case
|
|
|
|
;; ada-xref-project-files is nil)
|
|
|
|
(or ada-xref-project-files '(nil))))))
|
2004-06-29 13:01:14 +00:00
|
|
|
|
2003-05-13 21:15:44 +00:00
|
|
|
(easy-menu-add-item ada-mode-menu '() submenu)))
|
2002-04-09 18:54:20 +00:00
|
|
|
|
|
|
|
|
|
|
|
;;-------------------------------------------------------------
|
|
|
|
;;-- Searching a file anywhere on the source path.
|
|
|
|
;;--
|
|
|
|
;;-- The following functions provide support for finding a file anywhere
|
|
|
|
;;-- on the source path, without providing an explicit directory.
|
|
|
|
;;-- They also provide file name completion in the minibuffer.
|
|
|
|
;;--
|
|
|
|
;;-- Public subprograms: ada-find-file
|
|
|
|
;;--
|
|
|
|
;;-------------------------------------------------------------
|
|
|
|
|
|
|
|
(defun ada-do-file-completion (string predicate flag)
|
|
|
|
"Completion function when reading a file from the minibuffer.
|
|
|
|
Completion is attempted in all the directories in the source path, as
|
|
|
|
defined in the project file."
|
2006-10-31 00:57:56 +00:00
|
|
|
;; FIXME: doc arguments
|
2002-04-09 18:54:20 +00:00
|
|
|
(let (list
|
|
|
|
(dirs (ada-xref-get-src-dir-field)))
|
|
|
|
|
|
|
|
(while dirs
|
|
|
|
(if (file-directory-p (car dirs))
|
|
|
|
(set 'list (append list (file-name-all-completions string (car dirs)))))
|
|
|
|
(set 'dirs (cdr dirs)))
|
|
|
|
(cond ((equal flag 'lambda)
|
|
|
|
(assoc string list))
|
|
|
|
(flag
|
|
|
|
list)
|
|
|
|
(t
|
|
|
|
(try-completion string
|
|
|
|
(mapcar (lambda (x) (cons x 1)) list)
|
|
|
|
predicate)))))
|
|
|
|
|
|
|
|
;;;###autoload
|
|
|
|
(defun ada-find-file (filename)
|
2006-10-31 00:57:56 +00:00
|
|
|
"Open FILENAME, from anywhere in the source path.
|
2002-04-09 18:54:20 +00:00
|
|
|
Completion is available."
|
|
|
|
(interactive
|
|
|
|
(list (completing-read "File: " 'ada-do-file-completion)))
|
|
|
|
(let ((file (ada-find-src-file-in-dir filename)))
|
|
|
|
(if file
|
|
|
|
(find-file file)
|
|
|
|
(error (concat filename " not found in src_dir")))))
|
|
|
|
|
1999-10-07 14:25:59 +00:00
|
|
|
|
|
|
|
;; ----- Utilities -------------------------------------------------
|
|
|
|
|
|
|
|
(defun ada-require-project-file ()
|
2002-04-09 18:54:20 +00:00
|
|
|
"If no project file is currently active, load a default one."
|
|
|
|
(if (or (not ada-prj-default-project-file)
|
|
|
|
(not ada-xref-project-files)
|
|
|
|
(string= ada-prj-default-project-file ""))
|
Got rid of all byte-compiler warnings on Emacs.
Add to the menu when the file is loaded, not in ada-mode-hook.
Add -toolbar to the default ddd command Switches moved from
ada-prj-default-comp-cmd and ada-prj-default-make-cmd to
ada-prj-default-comp-opt
(ada-add-ada-menu): Remove the map and name parameters Add the Ada
Reference Manual to the menu
(ada-check-current): rewritten as a call to ada-compile-current
(ada-compile): Removed.
(ada-compile-application, ada-compile-current, ada-check-current):
Set the compilation-search-path so that compile.el automatically
finds the sources in src_dir. Automatic scrollong of the
compilation buffer. C-uC-cC-c asks for confirmation before
compiling
(ada-compile-current): New parameter, prj-field
(ada-complete-identifier): Load the .ali file before doing
processing
(ada-find-ali-file-in-dir): prepend build_dir to obj_dir to
conform to gnatmake's behavior.
(ada-find-file-in-dir): New function
(ada-find-references): Set the environment variables for gnatfind
(ada-find-src-file-in-dir): New function.
(ada-first-non-nil): Removed
(ada-gdb-application): Add support for jdb, the java debugger.
(ada-get-ada-file-name): Load the original-file first if not done
yet.
(ada-get-all-references): Handles the new ali syntax (parent types
are found between <>).
(ada-initialize-runtime-library): New function
(ada-mode-hook): Always load a project file when a file is opened,
so that the casing exceptions are correctly read.
(ada-operator-re): Add all missing operators ("abs", "rem", "**").
(ada-parse-prj-file): Use find-file-noselect instead of find-file
to open the project file, since the latter does not work with
speedbar Get default values before loading the prj file, or the
default executable file name is wrong. Use the absolute value of
src_dir to initialize ada-search-directories and
compilation-search-path,... Add the standard runtime library to
the search path for find-file.
(ada-prj-default-debugger): Was missing an opening '{'
(ada-prj-default-bind-opt, ada-prj-default-link-opt): New
variables.
(ada-prj-default-gnatmake-opt): New variable
(ada-prj-find-prj-file): Handles non-file buffers For non-Ada
buffers, the project file is the default one Save the windows
configuration before displaying the menu.
(ada-prj-src-dir, ada-prj-obj-dir, ada-prj-comp-opt,...): Removed
(ada-read-identifier): Fix xrefs on operators (for "mod", "and",
...) regexp-quote identifiers names to support operators +,
-,... in regexps.
(ada-remote): New function.
(ada-run-application): Erase the output buffer before starting the
run Support remote execution of the application. Use
call-process, or the arguments are incorrectly parsed
(ada-set-default-project-file): Reread the content of the active
project file, not the one from the current buffer When a project
file is set as the default project, all directories are
automatically associated with it.
(ada-set-environment): New function
(ada-treat-cmd-string): New special variable ${current}
(ada-treat-cmd-string): Revised. The substitution is now done for
any ${...} substring
(ada-xref-current): If no body was found, compiles the spec
instead. Setup ADA_{SOURCE,OBJECTS}_PATH before running the
compiler to get rid of command line length limitations.
(ada-xref-get-project-field): New function
(ada-xref-project-files): New variable
(ada-xref-runtime-library-specs-path)
(ada-xref-runtime-library-ali-path): New variables
(ada-xref-set-default-prj-values): Default run command now does a
cd to the build directory. New field: main_unit Provide a default
file name even if the current buffer has no prj file.
2000-07-24 11:13:11 +00:00
|
|
|
(ada-reread-prj-file)))
|
2003-02-04 13:24:35 +00:00
|
|
|
|
1999-10-07 14:25:59 +00:00
|
|
|
(defun ada-xref-push-pos (filename position)
|
1999-10-28 11:12:54 +00:00
|
|
|
"Push (FILENAME, POSITION) on the position ring for cross-references."
|
1999-10-07 14:25:59 +00:00
|
|
|
(setq ada-xref-pos-ring (cons (list position filename) ada-xref-pos-ring))
|
|
|
|
(if (> (length ada-xref-pos-ring) ada-xref-pos-ring-max)
|
|
|
|
(setcdr (nthcdr (1- ada-xref-pos-ring-max) ada-xref-pos-ring) nil)))
|
|
|
|
|
|
|
|
(defun ada-xref-goto-previous-reference ()
|
1999-10-28 11:12:54 +00:00
|
|
|
"Go to the previous cross-reference we were on."
|
1999-10-07 14:25:59 +00:00
|
|
|
(interactive)
|
|
|
|
(if ada-xref-pos-ring
|
1999-10-28 11:12:54 +00:00
|
|
|
(let ((pos (car ada-xref-pos-ring)))
|
|
|
|
(setq ada-xref-pos-ring (cdr ada-xref-pos-ring))
|
|
|
|
(find-file (car (cdr pos)))
|
|
|
|
(goto-char (car pos)))))
|
1999-10-07 14:25:59 +00:00
|
|
|
|
|
|
|
(defun ada-convert-file-name (name)
|
2006-10-31 00:57:56 +00:00
|
|
|
"Convert from NAME to a name that can be used by the compilation commands.
|
1999-10-28 11:12:54 +00:00
|
|
|
This is overriden on VMS to convert from VMS filenames to Unix filenames."
|
1999-10-07 14:25:59 +00:00
|
|
|
name)
|
2006-10-31 00:57:56 +00:00
|
|
|
;; FIXME: use convert-standard-filename instead
|
1999-10-07 14:25:59 +00:00
|
|
|
|
2003-04-29 23:40:08 +00:00
|
|
|
(defun ada-set-default-project-file (name &optional keep-existing)
|
|
|
|
"Set the file whose name is NAME as the default project file.
|
|
|
|
If KEEP-EXISTING is true and a project file has already been loaded, nothing
|
2004-08-22 17:14:02 +00:00
|
|
|
is done. This is meant to be used from `ada-mode-hook', for instance, to force
|
2003-04-29 23:40:08 +00:00
|
|
|
a project file unless the user has already loaded one."
|
1999-10-28 11:12:54 +00:00
|
|
|
(interactive "fProject file:")
|
2003-04-29 23:40:08 +00:00
|
|
|
(if (or (not keep-existing)
|
|
|
|
(not ada-prj-default-project-file)
|
|
|
|
(equal ada-prj-default-project-file ""))
|
|
|
|
(progn
|
|
|
|
(setq ada-prj-default-project-file name)
|
|
|
|
(ada-reread-prj-file name))))
|
Got rid of all byte-compiler warnings on Emacs.
Add to the menu when the file is loaded, not in ada-mode-hook.
Add -toolbar to the default ddd command Switches moved from
ada-prj-default-comp-cmd and ada-prj-default-make-cmd to
ada-prj-default-comp-opt
(ada-add-ada-menu): Remove the map and name parameters Add the Ada
Reference Manual to the menu
(ada-check-current): rewritten as a call to ada-compile-current
(ada-compile): Removed.
(ada-compile-application, ada-compile-current, ada-check-current):
Set the compilation-search-path so that compile.el automatically
finds the sources in src_dir. Automatic scrollong of the
compilation buffer. C-uC-cC-c asks for confirmation before
compiling
(ada-compile-current): New parameter, prj-field
(ada-complete-identifier): Load the .ali file before doing
processing
(ada-find-ali-file-in-dir): prepend build_dir to obj_dir to
conform to gnatmake's behavior.
(ada-find-file-in-dir): New function
(ada-find-references): Set the environment variables for gnatfind
(ada-find-src-file-in-dir): New function.
(ada-first-non-nil): Removed
(ada-gdb-application): Add support for jdb, the java debugger.
(ada-get-ada-file-name): Load the original-file first if not done
yet.
(ada-get-all-references): Handles the new ali syntax (parent types
are found between <>).
(ada-initialize-runtime-library): New function
(ada-mode-hook): Always load a project file when a file is opened,
so that the casing exceptions are correctly read.
(ada-operator-re): Add all missing operators ("abs", "rem", "**").
(ada-parse-prj-file): Use find-file-noselect instead of find-file
to open the project file, since the latter does not work with
speedbar Get default values before loading the prj file, or the
default executable file name is wrong. Use the absolute value of
src_dir to initialize ada-search-directories and
compilation-search-path,... Add the standard runtime library to
the search path for find-file.
(ada-prj-default-debugger): Was missing an opening '{'
(ada-prj-default-bind-opt, ada-prj-default-link-opt): New
variables.
(ada-prj-default-gnatmake-opt): New variable
(ada-prj-find-prj-file): Handles non-file buffers For non-Ada
buffers, the project file is the default one Save the windows
configuration before displaying the menu.
(ada-prj-src-dir, ada-prj-obj-dir, ada-prj-comp-opt,...): Removed
(ada-read-identifier): Fix xrefs on operators (for "mod", "and",
...) regexp-quote identifiers names to support operators +,
-,... in regexps.
(ada-remote): New function.
(ada-run-application): Erase the output buffer before starting the
run Support remote execution of the application. Use
call-process, or the arguments are incorrectly parsed
(ada-set-default-project-file): Reread the content of the active
project file, not the one from the current buffer When a project
file is set as the default project, all directories are
automatically associated with it.
(ada-set-environment): New function
(ada-treat-cmd-string): New special variable ${current}
(ada-treat-cmd-string): Revised. The substitution is now done for
any ${...} substring
(ada-xref-current): If no body was found, compiles the spec
instead. Setup ADA_{SOURCE,OBJECTS}_PATH before running the
compiler to get rid of command line length limitations.
(ada-xref-get-project-field): New function
(ada-xref-project-files): New variable
(ada-xref-runtime-library-specs-path)
(ada-xref-runtime-library-ali-path): New variables
(ada-xref-set-default-prj-values): Default run command now does a
cd to the build directory. New field: main_unit Provide a default
file name even if the current buffer has no prj file.
2000-07-24 11:13:11 +00:00
|
|
|
|
|
|
|
;; ------ Handling the project file -----------------------------
|
1999-10-07 14:25:59 +00:00
|
|
|
|
2003-04-29 23:40:08 +00:00
|
|
|
(defun ada-prj-find-prj-file (&optional file no-user-question)
|
|
|
|
"Find the prj file associated with FILE (or the current buffer if nil).
|
Got rid of all byte-compiler warnings on Emacs.
Add to the menu when the file is loaded, not in ada-mode-hook.
Add -toolbar to the default ddd command Switches moved from
ada-prj-default-comp-cmd and ada-prj-default-make-cmd to
ada-prj-default-comp-opt
(ada-add-ada-menu): Remove the map and name parameters Add the Ada
Reference Manual to the menu
(ada-check-current): rewritten as a call to ada-compile-current
(ada-compile): Removed.
(ada-compile-application, ada-compile-current, ada-check-current):
Set the compilation-search-path so that compile.el automatically
finds the sources in src_dir. Automatic scrollong of the
compilation buffer. C-uC-cC-c asks for confirmation before
compiling
(ada-compile-current): New parameter, prj-field
(ada-complete-identifier): Load the .ali file before doing
processing
(ada-find-ali-file-in-dir): prepend build_dir to obj_dir to
conform to gnatmake's behavior.
(ada-find-file-in-dir): New function
(ada-find-references): Set the environment variables for gnatfind
(ada-find-src-file-in-dir): New function.
(ada-first-non-nil): Removed
(ada-gdb-application): Add support for jdb, the java debugger.
(ada-get-ada-file-name): Load the original-file first if not done
yet.
(ada-get-all-references): Handles the new ali syntax (parent types
are found between <>).
(ada-initialize-runtime-library): New function
(ada-mode-hook): Always load a project file when a file is opened,
so that the casing exceptions are correctly read.
(ada-operator-re): Add all missing operators ("abs", "rem", "**").
(ada-parse-prj-file): Use find-file-noselect instead of find-file
to open the project file, since the latter does not work with
speedbar Get default values before loading the prj file, or the
default executable file name is wrong. Use the absolute value of
src_dir to initialize ada-search-directories and
compilation-search-path,... Add the standard runtime library to
the search path for find-file.
(ada-prj-default-debugger): Was missing an opening '{'
(ada-prj-default-bind-opt, ada-prj-default-link-opt): New
variables.
(ada-prj-default-gnatmake-opt): New variable
(ada-prj-find-prj-file): Handles non-file buffers For non-Ada
buffers, the project file is the default one Save the windows
configuration before displaying the menu.
(ada-prj-src-dir, ada-prj-obj-dir, ada-prj-comp-opt,...): Removed
(ada-read-identifier): Fix xrefs on operators (for "mod", "and",
...) regexp-quote identifiers names to support operators +,
-,... in regexps.
(ada-remote): New function.
(ada-run-application): Erase the output buffer before starting the
run Support remote execution of the application. Use
call-process, or the arguments are incorrectly parsed
(ada-set-default-project-file): Reread the content of the active
project file, not the one from the current buffer When a project
file is set as the default project, all directories are
automatically associated with it.
(ada-set-environment): New function
(ada-treat-cmd-string): New special variable ${current}
(ada-treat-cmd-string): Revised. The substitution is now done for
any ${...} substring
(ada-xref-current): If no body was found, compiles the spec
instead. Setup ADA_{SOURCE,OBJECTS}_PATH before running the
compiler to get rid of command line length limitations.
(ada-xref-get-project-field): New function
(ada-xref-project-files): New variable
(ada-xref-runtime-library-specs-path)
(ada-xref-runtime-library-ali-path): New variables
(ada-xref-set-default-prj-values): Default run command now does a
cd to the build directory. New field: main_unit Provide a default
file name even if the current buffer has no prj file.
2000-07-24 11:13:11 +00:00
|
|
|
If NO-USER-QUESTION is non-nil, use a default file if not project file was
|
|
|
|
found, and do not ask the user.
|
|
|
|
If the buffer is not an Ada buffer, associate it with the default project
|
2004-08-22 17:14:02 +00:00
|
|
|
file. If none is set, return nil."
|
1999-10-07 14:25:59 +00:00
|
|
|
|
Got rid of all byte-compiler warnings on Emacs.
Add to the menu when the file is loaded, not in ada-mode-hook.
Add -toolbar to the default ddd command Switches moved from
ada-prj-default-comp-cmd and ada-prj-default-make-cmd to
ada-prj-default-comp-opt
(ada-add-ada-menu): Remove the map and name parameters Add the Ada
Reference Manual to the menu
(ada-check-current): rewritten as a call to ada-compile-current
(ada-compile): Removed.
(ada-compile-application, ada-compile-current, ada-check-current):
Set the compilation-search-path so that compile.el automatically
finds the sources in src_dir. Automatic scrollong of the
compilation buffer. C-uC-cC-c asks for confirmation before
compiling
(ada-compile-current): New parameter, prj-field
(ada-complete-identifier): Load the .ali file before doing
processing
(ada-find-ali-file-in-dir): prepend build_dir to obj_dir to
conform to gnatmake's behavior.
(ada-find-file-in-dir): New function
(ada-find-references): Set the environment variables for gnatfind
(ada-find-src-file-in-dir): New function.
(ada-first-non-nil): Removed
(ada-gdb-application): Add support for jdb, the java debugger.
(ada-get-ada-file-name): Load the original-file first if not done
yet.
(ada-get-all-references): Handles the new ali syntax (parent types
are found between <>).
(ada-initialize-runtime-library): New function
(ada-mode-hook): Always load a project file when a file is opened,
so that the casing exceptions are correctly read.
(ada-operator-re): Add all missing operators ("abs", "rem", "**").
(ada-parse-prj-file): Use find-file-noselect instead of find-file
to open the project file, since the latter does not work with
speedbar Get default values before loading the prj file, or the
default executable file name is wrong. Use the absolute value of
src_dir to initialize ada-search-directories and
compilation-search-path,... Add the standard runtime library to
the search path for find-file.
(ada-prj-default-debugger): Was missing an opening '{'
(ada-prj-default-bind-opt, ada-prj-default-link-opt): New
variables.
(ada-prj-default-gnatmake-opt): New variable
(ada-prj-find-prj-file): Handles non-file buffers For non-Ada
buffers, the project file is the default one Save the windows
configuration before displaying the menu.
(ada-prj-src-dir, ada-prj-obj-dir, ada-prj-comp-opt,...): Removed
(ada-read-identifier): Fix xrefs on operators (for "mod", "and",
...) regexp-quote identifiers names to support operators +,
-,... in regexps.
(ada-remote): New function.
(ada-run-application): Erase the output buffer before starting the
run Support remote execution of the application. Use
call-process, or the arguments are incorrectly parsed
(ada-set-default-project-file): Reread the content of the active
project file, not the one from the current buffer When a project
file is set as the default project, all directories are
automatically associated with it.
(ada-set-environment): New function
(ada-treat-cmd-string): New special variable ${current}
(ada-treat-cmd-string): Revised. The substitution is now done for
any ${...} substring
(ada-xref-current): If no body was found, compiles the spec
instead. Setup ADA_{SOURCE,OBJECTS}_PATH before running the
compiler to get rid of command line length limitations.
(ada-xref-get-project-field): New function
(ada-xref-project-files): New variable
(ada-xref-runtime-library-specs-path)
(ada-xref-runtime-library-ali-path): New variables
(ada-xref-set-default-prj-values): Default run command now does a
cd to the build directory. New field: main_unit Provide a default
file name even if the current buffer has no prj file.
2000-07-24 11:13:11 +00:00
|
|
|
(let (selected)
|
1999-10-07 14:25:59 +00:00
|
|
|
|
2002-04-09 18:54:20 +00:00
|
|
|
;; Use the active project file if there is one.
|
|
|
|
;; This is also valid if we don't currently have an Ada buffer, or if
|
|
|
|
;; the current buffer is not a real file (for instance an emerge buffer)
|
2003-02-04 13:24:35 +00:00
|
|
|
|
Got rid of all byte-compiler warnings on Emacs.
Add to the menu when the file is loaded, not in ada-mode-hook.
Add -toolbar to the default ddd command Switches moved from
ada-prj-default-comp-cmd and ada-prj-default-make-cmd to
ada-prj-default-comp-opt
(ada-add-ada-menu): Remove the map and name parameters Add the Ada
Reference Manual to the menu
(ada-check-current): rewritten as a call to ada-compile-current
(ada-compile): Removed.
(ada-compile-application, ada-compile-current, ada-check-current):
Set the compilation-search-path so that compile.el automatically
finds the sources in src_dir. Automatic scrollong of the
compilation buffer. C-uC-cC-c asks for confirmation before
compiling
(ada-compile-current): New parameter, prj-field
(ada-complete-identifier): Load the .ali file before doing
processing
(ada-find-ali-file-in-dir): prepend build_dir to obj_dir to
conform to gnatmake's behavior.
(ada-find-file-in-dir): New function
(ada-find-references): Set the environment variables for gnatfind
(ada-find-src-file-in-dir): New function.
(ada-first-non-nil): Removed
(ada-gdb-application): Add support for jdb, the java debugger.
(ada-get-ada-file-name): Load the original-file first if not done
yet.
(ada-get-all-references): Handles the new ali syntax (parent types
are found between <>).
(ada-initialize-runtime-library): New function
(ada-mode-hook): Always load a project file when a file is opened,
so that the casing exceptions are correctly read.
(ada-operator-re): Add all missing operators ("abs", "rem", "**").
(ada-parse-prj-file): Use find-file-noselect instead of find-file
to open the project file, since the latter does not work with
speedbar Get default values before loading the prj file, or the
default executable file name is wrong. Use the absolute value of
src_dir to initialize ada-search-directories and
compilation-search-path,... Add the standard runtime library to
the search path for find-file.
(ada-prj-default-debugger): Was missing an opening '{'
(ada-prj-default-bind-opt, ada-prj-default-link-opt): New
variables.
(ada-prj-default-gnatmake-opt): New variable
(ada-prj-find-prj-file): Handles non-file buffers For non-Ada
buffers, the project file is the default one Save the windows
configuration before displaying the menu.
(ada-prj-src-dir, ada-prj-obj-dir, ada-prj-comp-opt,...): Removed
(ada-read-identifier): Fix xrefs on operators (for "mod", "and",
...) regexp-quote identifiers names to support operators +,
-,... in regexps.
(ada-remote): New function.
(ada-run-application): Erase the output buffer before starting the
run Support remote execution of the application. Use
call-process, or the arguments are incorrectly parsed
(ada-set-default-project-file): Reread the content of the active
project file, not the one from the current buffer When a project
file is set as the default project, all directories are
automatically associated with it.
(ada-set-environment): New function
(ada-treat-cmd-string): New special variable ${current}
(ada-treat-cmd-string): Revised. The substitution is now done for
any ${...} substring
(ada-xref-current): If no body was found, compiles the spec
instead. Setup ADA_{SOURCE,OBJECTS}_PATH before running the
compiler to get rid of command line length limitations.
(ada-xref-get-project-field): New function
(ada-xref-project-files): New variable
(ada-xref-runtime-library-specs-path)
(ada-xref-runtime-library-ali-path): New variables
(ada-xref-set-default-prj-values): Default run command now does a
cd to the build directory. New field: main_unit Provide a default
file name even if the current buffer has no prj file.
2000-07-24 11:13:11 +00:00
|
|
|
(if (or (not (string= mode-name "Ada"))
|
2003-04-29 23:40:08 +00:00
|
|
|
(not (buffer-file-name)))
|
|
|
|
|
|
|
|
(if (and ada-prj-default-project-file
|
|
|
|
(not (string= ada-prj-default-project-file "")))
|
|
|
|
(setq selected ada-prj-default-project-file)
|
|
|
|
(setq selected nil))
|
2003-02-04 13:24:35 +00:00
|
|
|
|
2002-04-09 18:54:20 +00:00
|
|
|
;; other cases: use a more complex algorithm
|
2003-02-04 13:24:35 +00:00
|
|
|
|
2003-04-29 23:40:08 +00:00
|
|
|
(let* ((current-file (or file (buffer-file-name)))
|
2002-04-09 18:54:20 +00:00
|
|
|
(first-choice (concat
|
|
|
|
(file-name-sans-extension current-file)
|
|
|
|
ada-project-file-extension))
|
|
|
|
(dir (file-name-directory current-file))
|
2003-02-04 13:24:35 +00:00
|
|
|
|
2002-04-09 18:54:20 +00:00
|
|
|
;; on Emacs 20.2, directory-files does not work if
|
|
|
|
;; parse-sexp-lookup-properties is set
|
|
|
|
(parse-sexp-lookup-properties nil)
|
|
|
|
(prj-files (directory-files
|
|
|
|
dir t
|
|
|
|
(concat ".*" (regexp-quote
|
|
|
|
ada-project-file-extension) "$")))
|
|
|
|
(choice nil))
|
2003-02-04 13:24:35 +00:00
|
|
|
|
2002-04-09 18:54:20 +00:00
|
|
|
(cond
|
2003-02-04 13:24:35 +00:00
|
|
|
|
2002-04-09 18:54:20 +00:00
|
|
|
;; Else if there is a project file with the same name as the Ada
|
|
|
|
;; file, but not the same extension.
|
|
|
|
((file-exists-p first-choice)
|
|
|
|
(set 'selected first-choice))
|
2003-02-04 13:24:35 +00:00
|
|
|
|
2002-04-09 18:54:20 +00:00
|
|
|
;; Else if only one project file was found in the current directory
|
|
|
|
((= (length prj-files) 1)
|
|
|
|
(set 'selected (car prj-files)))
|
2003-02-04 13:24:35 +00:00
|
|
|
|
2002-04-09 18:54:20 +00:00
|
|
|
;; Else if there are multiple files, ask the user
|
|
|
|
((and (> (length prj-files) 1) (not no-user-question))
|
|
|
|
(save-window-excursion
|
|
|
|
(with-output-to-temp-buffer "*choice list*"
|
|
|
|
(princ "There are more than one possible project file.\n")
|
|
|
|
(princ "Which one should we use ?\n\n")
|
|
|
|
(princ " no. file name \n")
|
|
|
|
(princ " --- ------------------------\n")
|
|
|
|
(let ((counter 1))
|
|
|
|
(while (<= counter (length prj-files))
|
|
|
|
(princ (format " %2d) %s\n"
|
|
|
|
counter
|
|
|
|
(nth (1- counter) prj-files)))
|
|
|
|
(setq counter (1+ counter))
|
2003-04-29 23:40:08 +00:00
|
|
|
|
2002-04-09 18:54:20 +00:00
|
|
|
))) ; end of with-output-to ...
|
|
|
|
(setq choice nil)
|
|
|
|
(while (or
|
|
|
|
(not choice)
|
|
|
|
(not (integerp choice))
|
|
|
|
(< choice 1)
|
|
|
|
(> choice (length prj-files)))
|
2005-05-16 11:34:49 +00:00
|
|
|
(setq choice (string-to-number
|
2002-04-09 18:54:20 +00:00
|
|
|
(read-from-minibuffer "Enter No. of your choice: "))))
|
|
|
|
(set 'selected (nth (1- choice) prj-files))))
|
2003-02-04 13:24:35 +00:00
|
|
|
|
2002-04-09 18:54:20 +00:00
|
|
|
;; Else if no project file was found in the directory, ask a name
|
|
|
|
;; to the user, using as a default value the last one entered by
|
|
|
|
;; the user
|
|
|
|
((= (length prj-files) 0)
|
|
|
|
(unless (or no-user-question (not ada-always-ask-project))
|
|
|
|
(setq ada-last-prj-file
|
|
|
|
(read-file-name
|
|
|
|
(concat "project file [" ada-last-prj-file "]:")
|
|
|
|
nil ada-last-prj-file))
|
|
|
|
(unless (string= ada-last-prj-file "")
|
|
|
|
(set 'selected ada-last-prj-file))))
|
|
|
|
)))
|
2003-04-29 23:40:08 +00:00
|
|
|
|
|
|
|
(or selected "default.adp")
|
1999-10-07 14:25:59 +00:00
|
|
|
))
|
|
|
|
|
|
|
|
|
Got rid of all byte-compiler warnings on Emacs.
Add to the menu when the file is loaded, not in ada-mode-hook.
Add -toolbar to the default ddd command Switches moved from
ada-prj-default-comp-cmd and ada-prj-default-make-cmd to
ada-prj-default-comp-opt
(ada-add-ada-menu): Remove the map and name parameters Add the Ada
Reference Manual to the menu
(ada-check-current): rewritten as a call to ada-compile-current
(ada-compile): Removed.
(ada-compile-application, ada-compile-current, ada-check-current):
Set the compilation-search-path so that compile.el automatically
finds the sources in src_dir. Automatic scrollong of the
compilation buffer. C-uC-cC-c asks for confirmation before
compiling
(ada-compile-current): New parameter, prj-field
(ada-complete-identifier): Load the .ali file before doing
processing
(ada-find-ali-file-in-dir): prepend build_dir to obj_dir to
conform to gnatmake's behavior.
(ada-find-file-in-dir): New function
(ada-find-references): Set the environment variables for gnatfind
(ada-find-src-file-in-dir): New function.
(ada-first-non-nil): Removed
(ada-gdb-application): Add support for jdb, the java debugger.
(ada-get-ada-file-name): Load the original-file first if not done
yet.
(ada-get-all-references): Handles the new ali syntax (parent types
are found between <>).
(ada-initialize-runtime-library): New function
(ada-mode-hook): Always load a project file when a file is opened,
so that the casing exceptions are correctly read.
(ada-operator-re): Add all missing operators ("abs", "rem", "**").
(ada-parse-prj-file): Use find-file-noselect instead of find-file
to open the project file, since the latter does not work with
speedbar Get default values before loading the prj file, or the
default executable file name is wrong. Use the absolute value of
src_dir to initialize ada-search-directories and
compilation-search-path,... Add the standard runtime library to
the search path for find-file.
(ada-prj-default-debugger): Was missing an opening '{'
(ada-prj-default-bind-opt, ada-prj-default-link-opt): New
variables.
(ada-prj-default-gnatmake-opt): New variable
(ada-prj-find-prj-file): Handles non-file buffers For non-Ada
buffers, the project file is the default one Save the windows
configuration before displaying the menu.
(ada-prj-src-dir, ada-prj-obj-dir, ada-prj-comp-opt,...): Removed
(ada-read-identifier): Fix xrefs on operators (for "mod", "and",
...) regexp-quote identifiers names to support operators +,
-,... in regexps.
(ada-remote): New function.
(ada-run-application): Erase the output buffer before starting the
run Support remote execution of the application. Use
call-process, or the arguments are incorrectly parsed
(ada-set-default-project-file): Reread the content of the active
project file, not the one from the current buffer When a project
file is set as the default project, all directories are
automatically associated with it.
(ada-set-environment): New function
(ada-treat-cmd-string): New special variable ${current}
(ada-treat-cmd-string): Revised. The substitution is now done for
any ${...} substring
(ada-xref-current): If no body was found, compiles the spec
instead. Setup ADA_{SOURCE,OBJECTS}_PATH before running the
compiler to get rid of command line length limitations.
(ada-xref-get-project-field): New function
(ada-xref-project-files): New variable
(ada-xref-runtime-library-specs-path)
(ada-xref-runtime-library-ali-path): New variables
(ada-xref-set-default-prj-values): Default run command now does a
cd to the build directory. New field: main_unit Provide a default
file name even if the current buffer has no prj file.
2000-07-24 11:13:11 +00:00
|
|
|
(defun ada-parse-prj-file (prj-file)
|
2006-10-31 00:57:56 +00:00
|
|
|
"Read PRJ-FILE, set it as the active project."
|
|
|
|
;; FIXME: doc nil, search, etc.
|
Got rid of all byte-compiler warnings on Emacs.
Add to the menu when the file is loaded, not in ada-mode-hook.
Add -toolbar to the default ddd command Switches moved from
ada-prj-default-comp-cmd and ada-prj-default-make-cmd to
ada-prj-default-comp-opt
(ada-add-ada-menu): Remove the map and name parameters Add the Ada
Reference Manual to the menu
(ada-check-current): rewritten as a call to ada-compile-current
(ada-compile): Removed.
(ada-compile-application, ada-compile-current, ada-check-current):
Set the compilation-search-path so that compile.el automatically
finds the sources in src_dir. Automatic scrollong of the
compilation buffer. C-uC-cC-c asks for confirmation before
compiling
(ada-compile-current): New parameter, prj-field
(ada-complete-identifier): Load the .ali file before doing
processing
(ada-find-ali-file-in-dir): prepend build_dir to obj_dir to
conform to gnatmake's behavior.
(ada-find-file-in-dir): New function
(ada-find-references): Set the environment variables for gnatfind
(ada-find-src-file-in-dir): New function.
(ada-first-non-nil): Removed
(ada-gdb-application): Add support for jdb, the java debugger.
(ada-get-ada-file-name): Load the original-file first if not done
yet.
(ada-get-all-references): Handles the new ali syntax (parent types
are found between <>).
(ada-initialize-runtime-library): New function
(ada-mode-hook): Always load a project file when a file is opened,
so that the casing exceptions are correctly read.
(ada-operator-re): Add all missing operators ("abs", "rem", "**").
(ada-parse-prj-file): Use find-file-noselect instead of find-file
to open the project file, since the latter does not work with
speedbar Get default values before loading the prj file, or the
default executable file name is wrong. Use the absolute value of
src_dir to initialize ada-search-directories and
compilation-search-path,... Add the standard runtime library to
the search path for find-file.
(ada-prj-default-debugger): Was missing an opening '{'
(ada-prj-default-bind-opt, ada-prj-default-link-opt): New
variables.
(ada-prj-default-gnatmake-opt): New variable
(ada-prj-find-prj-file): Handles non-file buffers For non-Ada
buffers, the project file is the default one Save the windows
configuration before displaying the menu.
(ada-prj-src-dir, ada-prj-obj-dir, ada-prj-comp-opt,...): Removed
(ada-read-identifier): Fix xrefs on operators (for "mod", "and",
...) regexp-quote identifiers names to support operators +,
-,... in regexps.
(ada-remote): New function.
(ada-run-application): Erase the output buffer before starting the
run Support remote execution of the application. Use
call-process, or the arguments are incorrectly parsed
(ada-set-default-project-file): Reread the content of the active
project file, not the one from the current buffer When a project
file is set as the default project, all directories are
automatically associated with it.
(ada-set-environment): New function
(ada-treat-cmd-string): New special variable ${current}
(ada-treat-cmd-string): Revised. The substitution is now done for
any ${...} substring
(ada-xref-current): If no body was found, compiles the spec
instead. Setup ADA_{SOURCE,OBJECTS}_PATH before running the
compiler to get rid of command line length limitations.
(ada-xref-get-project-field): New function
(ada-xref-project-files): New variable
(ada-xref-runtime-library-specs-path)
(ada-xref-runtime-library-ali-path): New variables
(ada-xref-set-default-prj-values): Default run command now does a
cd to the build directory. New field: main_unit Provide a default
file name even if the current buffer has no prj file.
2000-07-24 11:13:11 +00:00
|
|
|
(if prj-file
|
2002-04-09 18:54:20 +00:00
|
|
|
(let (project src_dir obj_dir make_cmd comp_cmd check_cmd casing
|
|
|
|
run_cmd debug_pre_cmd debug_post_cmd
|
2006-10-31 00:57:56 +00:00
|
|
|
(ada-buffer (current-buffer)))
|
2002-04-09 18:54:20 +00:00
|
|
|
(setq prj-file (expand-file-name prj-file))
|
Got rid of all byte-compiler warnings on Emacs.
Add to the menu when the file is loaded, not in ada-mode-hook.
Add -toolbar to the default ddd command Switches moved from
ada-prj-default-comp-cmd and ada-prj-default-make-cmd to
ada-prj-default-comp-opt
(ada-add-ada-menu): Remove the map and name parameters Add the Ada
Reference Manual to the menu
(ada-check-current): rewritten as a call to ada-compile-current
(ada-compile): Removed.
(ada-compile-application, ada-compile-current, ada-check-current):
Set the compilation-search-path so that compile.el automatically
finds the sources in src_dir. Automatic scrollong of the
compilation buffer. C-uC-cC-c asks for confirmation before
compiling
(ada-compile-current): New parameter, prj-field
(ada-complete-identifier): Load the .ali file before doing
processing
(ada-find-ali-file-in-dir): prepend build_dir to obj_dir to
conform to gnatmake's behavior.
(ada-find-file-in-dir): New function
(ada-find-references): Set the environment variables for gnatfind
(ada-find-src-file-in-dir): New function.
(ada-first-non-nil): Removed
(ada-gdb-application): Add support for jdb, the java debugger.
(ada-get-ada-file-name): Load the original-file first if not done
yet.
(ada-get-all-references): Handles the new ali syntax (parent types
are found between <>).
(ada-initialize-runtime-library): New function
(ada-mode-hook): Always load a project file when a file is opened,
so that the casing exceptions are correctly read.
(ada-operator-re): Add all missing operators ("abs", "rem", "**").
(ada-parse-prj-file): Use find-file-noselect instead of find-file
to open the project file, since the latter does not work with
speedbar Get default values before loading the prj file, or the
default executable file name is wrong. Use the absolute value of
src_dir to initialize ada-search-directories and
compilation-search-path,... Add the standard runtime library to
the search path for find-file.
(ada-prj-default-debugger): Was missing an opening '{'
(ada-prj-default-bind-opt, ada-prj-default-link-opt): New
variables.
(ada-prj-default-gnatmake-opt): New variable
(ada-prj-find-prj-file): Handles non-file buffers For non-Ada
buffers, the project file is the default one Save the windows
configuration before displaying the menu.
(ada-prj-src-dir, ada-prj-obj-dir, ada-prj-comp-opt,...): Removed
(ada-read-identifier): Fix xrefs on operators (for "mod", "and",
...) regexp-quote identifiers names to support operators +,
-,... in regexps.
(ada-remote): New function.
(ada-run-application): Erase the output buffer before starting the
run Support remote execution of the application. Use
call-process, or the arguments are incorrectly parsed
(ada-set-default-project-file): Reread the content of the active
project file, not the one from the current buffer When a project
file is set as the default project, all directories are
automatically associated with it.
(ada-set-environment): New function
(ada-treat-cmd-string): New special variable ${current}
(ada-treat-cmd-string): Revised. The substitution is now done for
any ${...} substring
(ada-xref-current): If no body was found, compiles the spec
instead. Setup ADA_{SOURCE,OBJECTS}_PATH before running the
compiler to get rid of command line length limitations.
(ada-xref-get-project-field): New function
(ada-xref-project-files): New variable
(ada-xref-runtime-library-specs-path)
(ada-xref-runtime-library-ali-path): New variables
(ada-xref-set-default-prj-values): Default run command now does a
cd to the build directory. New field: main_unit Provide a default
file name even if the current buffer has no prj file.
2000-07-24 11:13:11 +00:00
|
|
|
|
2003-04-29 23:40:08 +00:00
|
|
|
;; Set the project file as the active one.
|
|
|
|
(setq ada-prj-default-project-file prj-file)
|
|
|
|
|
Got rid of all byte-compiler warnings on Emacs.
Add to the menu when the file is loaded, not in ada-mode-hook.
Add -toolbar to the default ddd command Switches moved from
ada-prj-default-comp-cmd and ada-prj-default-make-cmd to
ada-prj-default-comp-opt
(ada-add-ada-menu): Remove the map and name parameters Add the Ada
Reference Manual to the menu
(ada-check-current): rewritten as a call to ada-compile-current
(ada-compile): Removed.
(ada-compile-application, ada-compile-current, ada-check-current):
Set the compilation-search-path so that compile.el automatically
finds the sources in src_dir. Automatic scrollong of the
compilation buffer. C-uC-cC-c asks for confirmation before
compiling
(ada-compile-current): New parameter, prj-field
(ada-complete-identifier): Load the .ali file before doing
processing
(ada-find-ali-file-in-dir): prepend build_dir to obj_dir to
conform to gnatmake's behavior.
(ada-find-file-in-dir): New function
(ada-find-references): Set the environment variables for gnatfind
(ada-find-src-file-in-dir): New function.
(ada-first-non-nil): Removed
(ada-gdb-application): Add support for jdb, the java debugger.
(ada-get-ada-file-name): Load the original-file first if not done
yet.
(ada-get-all-references): Handles the new ali syntax (parent types
are found between <>).
(ada-initialize-runtime-library): New function
(ada-mode-hook): Always load a project file when a file is opened,
so that the casing exceptions are correctly read.
(ada-operator-re): Add all missing operators ("abs", "rem", "**").
(ada-parse-prj-file): Use find-file-noselect instead of find-file
to open the project file, since the latter does not work with
speedbar Get default values before loading the prj file, or the
default executable file name is wrong. Use the absolute value of
src_dir to initialize ada-search-directories and
compilation-search-path,... Add the standard runtime library to
the search path for find-file.
(ada-prj-default-debugger): Was missing an opening '{'
(ada-prj-default-bind-opt, ada-prj-default-link-opt): New
variables.
(ada-prj-default-gnatmake-opt): New variable
(ada-prj-find-prj-file): Handles non-file buffers For non-Ada
buffers, the project file is the default one Save the windows
configuration before displaying the menu.
(ada-prj-src-dir, ada-prj-obj-dir, ada-prj-comp-opt,...): Removed
(ada-read-identifier): Fix xrefs on operators (for "mod", "and",
...) regexp-quote identifiers names to support operators +,
-,... in regexps.
(ada-remote): New function.
(ada-run-application): Erase the output buffer before starting the
run Support remote execution of the application. Use
call-process, or the arguments are incorrectly parsed
(ada-set-default-project-file): Reread the content of the active
project file, not the one from the current buffer When a project
file is set as the default project, all directories are
automatically associated with it.
(ada-set-environment): New function
(ada-treat-cmd-string): New special variable ${current}
(ada-treat-cmd-string): Revised. The substitution is now done for
any ${...} substring
(ada-xref-current): If no body was found, compiles the spec
instead. Setup ADA_{SOURCE,OBJECTS}_PATH before running the
compiler to get rid of command line length limitations.
(ada-xref-get-project-field): New function
(ada-xref-project-files): New variable
(ada-xref-runtime-library-specs-path)
(ada-xref-runtime-library-ali-path): New variables
(ada-xref-set-default-prj-values): Default run command now does a
cd to the build directory. New field: main_unit Provide a default
file name even if the current buffer has no prj file.
2000-07-24 11:13:11 +00:00
|
|
|
;; Initialize the project with the default values
|
|
|
|
(ada-xref-set-default-prj-values 'project (current-buffer))
|
|
|
|
|
|
|
|
;; Do not use find-file below, since we don't want to show this
|
2004-08-22 17:14:02 +00:00
|
|
|
;; buffer. If the file is open through speedbar, we can't use
|
Got rid of all byte-compiler warnings on Emacs.
Add to the menu when the file is loaded, not in ada-mode-hook.
Add -toolbar to the default ddd command Switches moved from
ada-prj-default-comp-cmd and ada-prj-default-make-cmd to
ada-prj-default-comp-opt
(ada-add-ada-menu): Remove the map and name parameters Add the Ada
Reference Manual to the menu
(ada-check-current): rewritten as a call to ada-compile-current
(ada-compile): Removed.
(ada-compile-application, ada-compile-current, ada-check-current):
Set the compilation-search-path so that compile.el automatically
finds the sources in src_dir. Automatic scrollong of the
compilation buffer. C-uC-cC-c asks for confirmation before
compiling
(ada-compile-current): New parameter, prj-field
(ada-complete-identifier): Load the .ali file before doing
processing
(ada-find-ali-file-in-dir): prepend build_dir to obj_dir to
conform to gnatmake's behavior.
(ada-find-file-in-dir): New function
(ada-find-references): Set the environment variables for gnatfind
(ada-find-src-file-in-dir): New function.
(ada-first-non-nil): Removed
(ada-gdb-application): Add support for jdb, the java debugger.
(ada-get-ada-file-name): Load the original-file first if not done
yet.
(ada-get-all-references): Handles the new ali syntax (parent types
are found between <>).
(ada-initialize-runtime-library): New function
(ada-mode-hook): Always load a project file when a file is opened,
so that the casing exceptions are correctly read.
(ada-operator-re): Add all missing operators ("abs", "rem", "**").
(ada-parse-prj-file): Use find-file-noselect instead of find-file
to open the project file, since the latter does not work with
speedbar Get default values before loading the prj file, or the
default executable file name is wrong. Use the absolute value of
src_dir to initialize ada-search-directories and
compilation-search-path,... Add the standard runtime library to
the search path for find-file.
(ada-prj-default-debugger): Was missing an opening '{'
(ada-prj-default-bind-opt, ada-prj-default-link-opt): New
variables.
(ada-prj-default-gnatmake-opt): New variable
(ada-prj-find-prj-file): Handles non-file buffers For non-Ada
buffers, the project file is the default one Save the windows
configuration before displaying the menu.
(ada-prj-src-dir, ada-prj-obj-dir, ada-prj-comp-opt,...): Removed
(ada-read-identifier): Fix xrefs on operators (for "mod", "and",
...) regexp-quote identifiers names to support operators +,
-,... in regexps.
(ada-remote): New function.
(ada-run-application): Erase the output buffer before starting the
run Support remote execution of the application. Use
call-process, or the arguments are incorrectly parsed
(ada-set-default-project-file): Reread the content of the active
project file, not the one from the current buffer When a project
file is set as the default project, all directories are
automatically associated with it.
(ada-set-environment): New function
(ada-treat-cmd-string): New special variable ${current}
(ada-treat-cmd-string): Revised. The substitution is now done for
any ${...} substring
(ada-xref-current): If no body was found, compiles the spec
instead. Setup ADA_{SOURCE,OBJECTS}_PATH before running the
compiler to get rid of command line length limitations.
(ada-xref-get-project-field): New function
(ada-xref-project-files): New variable
(ada-xref-runtime-library-specs-path)
(ada-xref-runtime-library-ali-path): New variables
(ada-xref-set-default-prj-values): Default run command now does a
cd to the build directory. New field: main_unit Provide a default
file name even if the current buffer has no prj file.
2000-07-24 11:13:11 +00:00
|
|
|
;; find-file anyway, since the speedbar frame is special and does not
|
|
|
|
;; allow the selection of a file in it.
|
|
|
|
|
2003-04-29 23:40:08 +00:00
|
|
|
(if (file-exists-p prj-file)
|
|
|
|
(progn
|
|
|
|
(let* ((buffer (run-hook-with-args-until-success
|
|
|
|
'ada-load-project-hook prj-file)))
|
|
|
|
(unless buffer
|
2003-05-04 19:54:00 +00:00
|
|
|
(setq buffer (find-file-noselect prj-file nil)))
|
|
|
|
(set-buffer buffer))
|
|
|
|
|
|
|
|
(widen)
|
|
|
|
(goto-char (point-min))
|
|
|
|
|
|
|
|
;; Now overrides these values with the project file
|
|
|
|
(while (not (eobp))
|
|
|
|
(if (looking-at "^\\([^=]+\\)=\\(.*\\)")
|
|
|
|
(cond
|
2006-10-31 00:57:56 +00:00
|
|
|
;; fields that are lists or paths require special processing
|
|
|
|
;; FIXME: strip trailing spaces
|
2003-05-04 19:54:00 +00:00
|
|
|
((string= (match-string 1) "src_dir")
|
|
|
|
(add-to-list 'src_dir
|
|
|
|
(file-name-as-directory (match-string 2))))
|
|
|
|
((string= (match-string 1) "obj_dir")
|
|
|
|
(add-to-list 'obj_dir
|
|
|
|
(file-name-as-directory (match-string 2))))
|
|
|
|
((string= (match-string 1) "casing")
|
|
|
|
(set 'casing (cons (match-string 2) casing)))
|
|
|
|
((string= (match-string 1) "build_dir")
|
|
|
|
(set 'project
|
|
|
|
(plist-put project 'build_dir
|
|
|
|
(file-name-as-directory (match-string 2)))))
|
|
|
|
((string= (match-string 1) "make_cmd")
|
|
|
|
(add-to-list 'make_cmd (match-string 2)))
|
|
|
|
((string= (match-string 1) "comp_cmd")
|
|
|
|
(add-to-list 'comp_cmd (match-string 2)))
|
|
|
|
((string= (match-string 1) "check_cmd")
|
|
|
|
(add-to-list 'check_cmd (match-string 2)))
|
|
|
|
((string= (match-string 1) "run_cmd")
|
|
|
|
(add-to-list 'run_cmd (match-string 2)))
|
|
|
|
((string= (match-string 1) "debug_pre_cmd")
|
|
|
|
(add-to-list 'debug_pre_cmd (match-string 2)))
|
|
|
|
((string= (match-string 1) "debug_post_cmd")
|
|
|
|
(add-to-list 'debug_post_cmd (match-string 2)))
|
|
|
|
(t
|
2006-10-31 00:57:56 +00:00
|
|
|
;; any other field in the file is just copied
|
2003-05-04 19:54:00 +00:00
|
|
|
(set 'project (plist-put project (intern (match-string 1))
|
|
|
|
(match-string 2))))))
|
|
|
|
(forward-line 1))
|
|
|
|
|
|
|
|
(if src_dir (set 'project (plist-put project 'src_dir
|
|
|
|
(reverse src_dir))))
|
|
|
|
(if obj_dir (set 'project (plist-put project 'obj_dir
|
|
|
|
(reverse obj_dir))))
|
|
|
|
(if casing (set 'project (plist-put project 'casing
|
|
|
|
(reverse casing))))
|
|
|
|
(if make_cmd (set 'project (plist-put project 'make_cmd
|
|
|
|
(reverse make_cmd))))
|
|
|
|
(if comp_cmd (set 'project (plist-put project 'comp_cmd
|
|
|
|
(reverse comp_cmd))))
|
|
|
|
(if check_cmd (set 'project (plist-put project 'check_cmd
|
|
|
|
(reverse check_cmd))))
|
|
|
|
(if run_cmd (set 'project (plist-put project 'run_cmd
|
|
|
|
(reverse run_cmd))))
|
|
|
|
(set 'project (plist-put project 'debug_post_cmd
|
|
|
|
(reverse debug_post_cmd)))
|
2003-04-29 23:40:08 +00:00
|
|
|
(set 'project (plist-put project 'debug_pre_cmd
|
|
|
|
(reverse debug_pre_cmd)))
|
|
|
|
|
|
|
|
;; Kill the project buffer
|
|
|
|
(kill-buffer nil)
|
|
|
|
(set-buffer ada-buffer)
|
|
|
|
)
|
|
|
|
|
|
|
|
;; Else the file wasn't readable (probably the default project).
|
|
|
|
;; We initialize it with the current environment variables.
|
2006-10-31 00:57:56 +00:00
|
|
|
;; We need to add the startup directory in front so that
|
|
|
|
;; files locally redefined are properly found. We cannot
|
|
|
|
;; add ".", which varies too much depending on what the
|
|
|
|
;; current buffer is.
|
2003-04-29 23:40:08 +00:00
|
|
|
(set 'project
|
|
|
|
(plist-put project 'src_dir
|
|
|
|
(append
|
2006-10-31 00:57:56 +00:00
|
|
|
(list command-line-default-directory)
|
2003-04-29 23:40:08 +00:00
|
|
|
(split-string (or (getenv "ADA_INCLUDE_PATH") "") ":")
|
|
|
|
(list "." default-directory))))
|
|
|
|
(set 'project
|
|
|
|
(plist-put project 'obj_dir
|
|
|
|
(append
|
2006-10-31 00:57:56 +00:00
|
|
|
(list command-line-default-directory)
|
2003-04-29 23:40:08 +00:00
|
|
|
(split-string (or (getenv "ADA_OBJECTS_PATH") "") ":")
|
|
|
|
(list "." default-directory))))
|
|
|
|
)
|
|
|
|
|
2002-04-09 18:54:20 +00:00
|
|
|
|
|
|
|
;; Delete the default project file from the list, if it is there.
|
|
|
|
;; Note that in that case, this default project is the only one in
|
|
|
|
;; the list
|
|
|
|
(if (assoc nil ada-xref-project-files)
|
|
|
|
(setq ada-xref-project-files nil))
|
2003-02-04 13:24:35 +00:00
|
|
|
|
Got rid of all byte-compiler warnings on Emacs.
Add to the menu when the file is loaded, not in ada-mode-hook.
Add -toolbar to the default ddd command Switches moved from
ada-prj-default-comp-cmd and ada-prj-default-make-cmd to
ada-prj-default-comp-opt
(ada-add-ada-menu): Remove the map and name parameters Add the Ada
Reference Manual to the menu
(ada-check-current): rewritten as a call to ada-compile-current
(ada-compile): Removed.
(ada-compile-application, ada-compile-current, ada-check-current):
Set the compilation-search-path so that compile.el automatically
finds the sources in src_dir. Automatic scrollong of the
compilation buffer. C-uC-cC-c asks for confirmation before
compiling
(ada-compile-current): New parameter, prj-field
(ada-complete-identifier): Load the .ali file before doing
processing
(ada-find-ali-file-in-dir): prepend build_dir to obj_dir to
conform to gnatmake's behavior.
(ada-find-file-in-dir): New function
(ada-find-references): Set the environment variables for gnatfind
(ada-find-src-file-in-dir): New function.
(ada-first-non-nil): Removed
(ada-gdb-application): Add support for jdb, the java debugger.
(ada-get-ada-file-name): Load the original-file first if not done
yet.
(ada-get-all-references): Handles the new ali syntax (parent types
are found between <>).
(ada-initialize-runtime-library): New function
(ada-mode-hook): Always load a project file when a file is opened,
so that the casing exceptions are correctly read.
(ada-operator-re): Add all missing operators ("abs", "rem", "**").
(ada-parse-prj-file): Use find-file-noselect instead of find-file
to open the project file, since the latter does not work with
speedbar Get default values before loading the prj file, or the
default executable file name is wrong. Use the absolute value of
src_dir to initialize ada-search-directories and
compilation-search-path,... Add the standard runtime library to
the search path for find-file.
(ada-prj-default-debugger): Was missing an opening '{'
(ada-prj-default-bind-opt, ada-prj-default-link-opt): New
variables.
(ada-prj-default-gnatmake-opt): New variable
(ada-prj-find-prj-file): Handles non-file buffers For non-Ada
buffers, the project file is the default one Save the windows
configuration before displaying the menu.
(ada-prj-src-dir, ada-prj-obj-dir, ada-prj-comp-opt,...): Removed
(ada-read-identifier): Fix xrefs on operators (for "mod", "and",
...) regexp-quote identifiers names to support operators +,
-,... in regexps.
(ada-remote): New function.
(ada-run-application): Erase the output buffer before starting the
run Support remote execution of the application. Use
call-process, or the arguments are incorrectly parsed
(ada-set-default-project-file): Reread the content of the active
project file, not the one from the current buffer When a project
file is set as the default project, all directories are
automatically associated with it.
(ada-set-environment): New function
(ada-treat-cmd-string): New special variable ${current}
(ada-treat-cmd-string): Revised. The substitution is now done for
any ${...} substring
(ada-xref-current): If no body was found, compiles the spec
instead. Setup ADA_{SOURCE,OBJECTS}_PATH before running the
compiler to get rid of command line length limitations.
(ada-xref-get-project-field): New function
(ada-xref-project-files): New variable
(ada-xref-runtime-library-specs-path)
(ada-xref-runtime-library-ali-path): New variables
(ada-xref-set-default-prj-values): Default run command now does a
cd to the build directory. New field: main_unit Provide a default
file name even if the current buffer has no prj file.
2000-07-24 11:13:11 +00:00
|
|
|
;; Memorize the newly read project file
|
|
|
|
(if (assoc prj-file ada-xref-project-files)
|
|
|
|
(setcdr (assoc prj-file ada-xref-project-files) project)
|
|
|
|
(add-to-list 'ada-xref-project-files (cons prj-file project)))
|
2002-04-09 18:54:20 +00:00
|
|
|
|
Got rid of all byte-compiler warnings on Emacs.
Add to the menu when the file is loaded, not in ada-mode-hook.
Add -toolbar to the default ddd command Switches moved from
ada-prj-default-comp-cmd and ada-prj-default-make-cmd to
ada-prj-default-comp-opt
(ada-add-ada-menu): Remove the map and name parameters Add the Ada
Reference Manual to the menu
(ada-check-current): rewritten as a call to ada-compile-current
(ada-compile): Removed.
(ada-compile-application, ada-compile-current, ada-check-current):
Set the compilation-search-path so that compile.el automatically
finds the sources in src_dir. Automatic scrollong of the
compilation buffer. C-uC-cC-c asks for confirmation before
compiling
(ada-compile-current): New parameter, prj-field
(ada-complete-identifier): Load the .ali file before doing
processing
(ada-find-ali-file-in-dir): prepend build_dir to obj_dir to
conform to gnatmake's behavior.
(ada-find-file-in-dir): New function
(ada-find-references): Set the environment variables for gnatfind
(ada-find-src-file-in-dir): New function.
(ada-first-non-nil): Removed
(ada-gdb-application): Add support for jdb, the java debugger.
(ada-get-ada-file-name): Load the original-file first if not done
yet.
(ada-get-all-references): Handles the new ali syntax (parent types
are found between <>).
(ada-initialize-runtime-library): New function
(ada-mode-hook): Always load a project file when a file is opened,
so that the casing exceptions are correctly read.
(ada-operator-re): Add all missing operators ("abs", "rem", "**").
(ada-parse-prj-file): Use find-file-noselect instead of find-file
to open the project file, since the latter does not work with
speedbar Get default values before loading the prj file, or the
default executable file name is wrong. Use the absolute value of
src_dir to initialize ada-search-directories and
compilation-search-path,... Add the standard runtime library to
the search path for find-file.
(ada-prj-default-debugger): Was missing an opening '{'
(ada-prj-default-bind-opt, ada-prj-default-link-opt): New
variables.
(ada-prj-default-gnatmake-opt): New variable
(ada-prj-find-prj-file): Handles non-file buffers For non-Ada
buffers, the project file is the default one Save the windows
configuration before displaying the menu.
(ada-prj-src-dir, ada-prj-obj-dir, ada-prj-comp-opt,...): Removed
(ada-read-identifier): Fix xrefs on operators (for "mod", "and",
...) regexp-quote identifiers names to support operators +,
-,... in regexps.
(ada-remote): New function.
(ada-run-application): Erase the output buffer before starting the
run Support remote execution of the application. Use
call-process, or the arguments are incorrectly parsed
(ada-set-default-project-file): Reread the content of the active
project file, not the one from the current buffer When a project
file is set as the default project, all directories are
automatically associated with it.
(ada-set-environment): New function
(ada-treat-cmd-string): New special variable ${current}
(ada-treat-cmd-string): Revised. The substitution is now done for
any ${...} substring
(ada-xref-current): If no body was found, compiles the spec
instead. Setup ADA_{SOURCE,OBJECTS}_PATH before running the
compiler to get rid of command line length limitations.
(ada-xref-get-project-field): New function
(ada-xref-project-files): New variable
(ada-xref-runtime-library-specs-path)
(ada-xref-runtime-library-ali-path): New variables
(ada-xref-set-default-prj-values): Default run command now does a
cd to the build directory. New field: main_unit Provide a default
file name even if the current buffer has no prj file.
2000-07-24 11:13:11 +00:00
|
|
|
;; Sets up the compilation-search-path so that Emacs is able to
|
|
|
|
;; go to the source of the errors in a compilation buffer
|
2002-04-09 18:54:20 +00:00
|
|
|
(setq compilation-search-path (ada-xref-get-src-dir-field))
|
|
|
|
|
2006-10-31 00:57:56 +00:00
|
|
|
;; Set the casing exceptions file list
|
|
|
|
(if casing
|
|
|
|
(progn
|
|
|
|
(setq ada-case-exception-file (reverse casing))
|
|
|
|
(ada-case-read-exceptions)))
|
2003-02-04 13:24:35 +00:00
|
|
|
|
Got rid of all byte-compiler warnings on Emacs.
Add to the menu when the file is loaded, not in ada-mode-hook.
Add -toolbar to the default ddd command Switches moved from
ada-prj-default-comp-cmd and ada-prj-default-make-cmd to
ada-prj-default-comp-opt
(ada-add-ada-menu): Remove the map and name parameters Add the Ada
Reference Manual to the menu
(ada-check-current): rewritten as a call to ada-compile-current
(ada-compile): Removed.
(ada-compile-application, ada-compile-current, ada-check-current):
Set the compilation-search-path so that compile.el automatically
finds the sources in src_dir. Automatic scrollong of the
compilation buffer. C-uC-cC-c asks for confirmation before
compiling
(ada-compile-current): New parameter, prj-field
(ada-complete-identifier): Load the .ali file before doing
processing
(ada-find-ali-file-in-dir): prepend build_dir to obj_dir to
conform to gnatmake's behavior.
(ada-find-file-in-dir): New function
(ada-find-references): Set the environment variables for gnatfind
(ada-find-src-file-in-dir): New function.
(ada-first-non-nil): Removed
(ada-gdb-application): Add support for jdb, the java debugger.
(ada-get-ada-file-name): Load the original-file first if not done
yet.
(ada-get-all-references): Handles the new ali syntax (parent types
are found between <>).
(ada-initialize-runtime-library): New function
(ada-mode-hook): Always load a project file when a file is opened,
so that the casing exceptions are correctly read.
(ada-operator-re): Add all missing operators ("abs", "rem", "**").
(ada-parse-prj-file): Use find-file-noselect instead of find-file
to open the project file, since the latter does not work with
speedbar Get default values before loading the prj file, or the
default executable file name is wrong. Use the absolute value of
src_dir to initialize ada-search-directories and
compilation-search-path,... Add the standard runtime library to
the search path for find-file.
(ada-prj-default-debugger): Was missing an opening '{'
(ada-prj-default-bind-opt, ada-prj-default-link-opt): New
variables.
(ada-prj-default-gnatmake-opt): New variable
(ada-prj-find-prj-file): Handles non-file buffers For non-Ada
buffers, the project file is the default one Save the windows
configuration before displaying the menu.
(ada-prj-src-dir, ada-prj-obj-dir, ada-prj-comp-opt,...): Removed
(ada-read-identifier): Fix xrefs on operators (for "mod", "and",
...) regexp-quote identifiers names to support operators +,
-,... in regexps.
(ada-remote): New function.
(ada-run-application): Erase the output buffer before starting the
run Support remote execution of the application. Use
call-process, or the arguments are incorrectly parsed
(ada-set-default-project-file): Reread the content of the active
project file, not the one from the current buffer When a project
file is set as the default project, all directories are
automatically associated with it.
(ada-set-environment): New function
(ada-treat-cmd-string): New special variable ${current}
(ada-treat-cmd-string): Revised. The substitution is now done for
any ${...} substring
(ada-xref-current): If no body was found, compiles the spec
instead. Setup ADA_{SOURCE,OBJECTS}_PATH before running the
compiler to get rid of command line length limitations.
(ada-xref-get-project-field): New function
(ada-xref-project-files): New variable
(ada-xref-runtime-library-specs-path)
(ada-xref-runtime-library-ali-path): New variables
(ada-xref-set-default-prj-values): Default run command now does a
cd to the build directory. New field: main_unit Provide a default
file name even if the current buffer has no prj file.
2000-07-24 11:13:11 +00:00
|
|
|
;; Add the directories to the search path for ff-find-other-file
|
|
|
|
;; Do not add the '/' or '\' at the end
|
2003-05-04 19:54:00 +00:00
|
|
|
(setq ada-search-directories-internal
|
Got rid of all byte-compiler warnings on Emacs.
Add to the menu when the file is loaded, not in ada-mode-hook.
Add -toolbar to the default ddd command Switches moved from
ada-prj-default-comp-cmd and ada-prj-default-make-cmd to
ada-prj-default-comp-opt
(ada-add-ada-menu): Remove the map and name parameters Add the Ada
Reference Manual to the menu
(ada-check-current): rewritten as a call to ada-compile-current
(ada-compile): Removed.
(ada-compile-application, ada-compile-current, ada-check-current):
Set the compilation-search-path so that compile.el automatically
finds the sources in src_dir. Automatic scrollong of the
compilation buffer. C-uC-cC-c asks for confirmation before
compiling
(ada-compile-current): New parameter, prj-field
(ada-complete-identifier): Load the .ali file before doing
processing
(ada-find-ali-file-in-dir): prepend build_dir to obj_dir to
conform to gnatmake's behavior.
(ada-find-file-in-dir): New function
(ada-find-references): Set the environment variables for gnatfind
(ada-find-src-file-in-dir): New function.
(ada-first-non-nil): Removed
(ada-gdb-application): Add support for jdb, the java debugger.
(ada-get-ada-file-name): Load the original-file first if not done
yet.
(ada-get-all-references): Handles the new ali syntax (parent types
are found between <>).
(ada-initialize-runtime-library): New function
(ada-mode-hook): Always load a project file when a file is opened,
so that the casing exceptions are correctly read.
(ada-operator-re): Add all missing operators ("abs", "rem", "**").
(ada-parse-prj-file): Use find-file-noselect instead of find-file
to open the project file, since the latter does not work with
speedbar Get default values before loading the prj file, or the
default executable file name is wrong. Use the absolute value of
src_dir to initialize ada-search-directories and
compilation-search-path,... Add the standard runtime library to
the search path for find-file.
(ada-prj-default-debugger): Was missing an opening '{'
(ada-prj-default-bind-opt, ada-prj-default-link-opt): New
variables.
(ada-prj-default-gnatmake-opt): New variable
(ada-prj-find-prj-file): Handles non-file buffers For non-Ada
buffers, the project file is the default one Save the windows
configuration before displaying the menu.
(ada-prj-src-dir, ada-prj-obj-dir, ada-prj-comp-opt,...): Removed
(ada-read-identifier): Fix xrefs on operators (for "mod", "and",
...) regexp-quote identifiers names to support operators +,
-,... in regexps.
(ada-remote): New function.
(ada-run-application): Erase the output buffer before starting the
run Support remote execution of the application. Use
call-process, or the arguments are incorrectly parsed
(ada-set-default-project-file): Reread the content of the active
project file, not the one from the current buffer When a project
file is set as the default project, all directories are
automatically associated with it.
(ada-set-environment): New function
(ada-treat-cmd-string): New special variable ${current}
(ada-treat-cmd-string): Revised. The substitution is now done for
any ${...} substring
(ada-xref-current): If no body was found, compiles the spec
instead. Setup ADA_{SOURCE,OBJECTS}_PATH before running the
compiler to get rid of command line length limitations.
(ada-xref-get-project-field): New function
(ada-xref-project-files): New variable
(ada-xref-runtime-library-specs-path)
(ada-xref-runtime-library-ali-path): New variables
(ada-xref-set-default-prj-values): Default run command now does a
cd to the build directory. New field: main_unit Provide a default
file name even if the current buffer has no prj file.
2000-07-24 11:13:11 +00:00
|
|
|
(append (mapcar 'directory-file-name compilation-search-path)
|
|
|
|
ada-search-directories))
|
2003-02-04 13:24:35 +00:00
|
|
|
|
2002-04-09 18:54:20 +00:00
|
|
|
(ada-xref-update-project-menu)
|
Got rid of all byte-compiler warnings on Emacs.
Add to the menu when the file is loaded, not in ada-mode-hook.
Add -toolbar to the default ddd command Switches moved from
ada-prj-default-comp-cmd and ada-prj-default-make-cmd to
ada-prj-default-comp-opt
(ada-add-ada-menu): Remove the map and name parameters Add the Ada
Reference Manual to the menu
(ada-check-current): rewritten as a call to ada-compile-current
(ada-compile): Removed.
(ada-compile-application, ada-compile-current, ada-check-current):
Set the compilation-search-path so that compile.el automatically
finds the sources in src_dir. Automatic scrollong of the
compilation buffer. C-uC-cC-c asks for confirmation before
compiling
(ada-compile-current): New parameter, prj-field
(ada-complete-identifier): Load the .ali file before doing
processing
(ada-find-ali-file-in-dir): prepend build_dir to obj_dir to
conform to gnatmake's behavior.
(ada-find-file-in-dir): New function
(ada-find-references): Set the environment variables for gnatfind
(ada-find-src-file-in-dir): New function.
(ada-first-non-nil): Removed
(ada-gdb-application): Add support for jdb, the java debugger.
(ada-get-ada-file-name): Load the original-file first if not done
yet.
(ada-get-all-references): Handles the new ali syntax (parent types
are found between <>).
(ada-initialize-runtime-library): New function
(ada-mode-hook): Always load a project file when a file is opened,
so that the casing exceptions are correctly read.
(ada-operator-re): Add all missing operators ("abs", "rem", "**").
(ada-parse-prj-file): Use find-file-noselect instead of find-file
to open the project file, since the latter does not work with
speedbar Get default values before loading the prj file, or the
default executable file name is wrong. Use the absolute value of
src_dir to initialize ada-search-directories and
compilation-search-path,... Add the standard runtime library to
the search path for find-file.
(ada-prj-default-debugger): Was missing an opening '{'
(ada-prj-default-bind-opt, ada-prj-default-link-opt): New
variables.
(ada-prj-default-gnatmake-opt): New variable
(ada-prj-find-prj-file): Handles non-file buffers For non-Ada
buffers, the project file is the default one Save the windows
configuration before displaying the menu.
(ada-prj-src-dir, ada-prj-obj-dir, ada-prj-comp-opt,...): Removed
(ada-read-identifier): Fix xrefs on operators (for "mod", "and",
...) regexp-quote identifiers names to support operators +,
-,... in regexps.
(ada-remote): New function.
(ada-run-application): Erase the output buffer before starting the
run Support remote execution of the application. Use
call-process, or the arguments are incorrectly parsed
(ada-set-default-project-file): Reread the content of the active
project file, not the one from the current buffer When a project
file is set as the default project, all directories are
automatically associated with it.
(ada-set-environment): New function
(ada-treat-cmd-string): New special variable ${current}
(ada-treat-cmd-string): Revised. The substitution is now done for
any ${...} substring
(ada-xref-current): If no body was found, compiles the spec
instead. Setup ADA_{SOURCE,OBJECTS}_PATH before running the
compiler to get rid of command line length limitations.
(ada-xref-get-project-field): New function
(ada-xref-project-files): New variable
(ada-xref-runtime-library-specs-path)
(ada-xref-runtime-library-ali-path): New variables
(ada-xref-set-default-prj-values): Default run command now does a
cd to the build directory. New field: main_unit Provide a default
file name even if the current buffer has no prj file.
2000-07-24 11:13:11 +00:00
|
|
|
)
|
2002-04-09 18:54:20 +00:00
|
|
|
|
|
|
|
;; No prj file ? => Setup default values
|
|
|
|
;; Note that nil means that all compilation modes will first look in the
|
2004-08-22 17:14:02 +00:00
|
|
|
;; current directory, and only then in the current file's directory. This
|
2002-04-09 18:54:20 +00:00
|
|
|
;; current file is assumed at this point to be in the common source
|
|
|
|
;; directory.
|
|
|
|
(setq compilation-search-path (list nil default-directory))
|
Got rid of all byte-compiler warnings on Emacs.
Add to the menu when the file is loaded, not in ada-mode-hook.
Add -toolbar to the default ddd command Switches moved from
ada-prj-default-comp-cmd and ada-prj-default-make-cmd to
ada-prj-default-comp-opt
(ada-add-ada-menu): Remove the map and name parameters Add the Ada
Reference Manual to the menu
(ada-check-current): rewritten as a call to ada-compile-current
(ada-compile): Removed.
(ada-compile-application, ada-compile-current, ada-check-current):
Set the compilation-search-path so that compile.el automatically
finds the sources in src_dir. Automatic scrollong of the
compilation buffer. C-uC-cC-c asks for confirmation before
compiling
(ada-compile-current): New parameter, prj-field
(ada-complete-identifier): Load the .ali file before doing
processing
(ada-find-ali-file-in-dir): prepend build_dir to obj_dir to
conform to gnatmake's behavior.
(ada-find-file-in-dir): New function
(ada-find-references): Set the environment variables for gnatfind
(ada-find-src-file-in-dir): New function.
(ada-first-non-nil): Removed
(ada-gdb-application): Add support for jdb, the java debugger.
(ada-get-ada-file-name): Load the original-file first if not done
yet.
(ada-get-all-references): Handles the new ali syntax (parent types
are found between <>).
(ada-initialize-runtime-library): New function
(ada-mode-hook): Always load a project file when a file is opened,
so that the casing exceptions are correctly read.
(ada-operator-re): Add all missing operators ("abs", "rem", "**").
(ada-parse-prj-file): Use find-file-noselect instead of find-file
to open the project file, since the latter does not work with
speedbar Get default values before loading the prj file, or the
default executable file name is wrong. Use the absolute value of
src_dir to initialize ada-search-directories and
compilation-search-path,... Add the standard runtime library to
the search path for find-file.
(ada-prj-default-debugger): Was missing an opening '{'
(ada-prj-default-bind-opt, ada-prj-default-link-opt): New
variables.
(ada-prj-default-gnatmake-opt): New variable
(ada-prj-find-prj-file): Handles non-file buffers For non-Ada
buffers, the project file is the default one Save the windows
configuration before displaying the menu.
(ada-prj-src-dir, ada-prj-obj-dir, ada-prj-comp-opt,...): Removed
(ada-read-identifier): Fix xrefs on operators (for "mod", "and",
...) regexp-quote identifiers names to support operators +,
-,... in regexps.
(ada-remote): New function.
(ada-run-application): Erase the output buffer before starting the
run Support remote execution of the application. Use
call-process, or the arguments are incorrectly parsed
(ada-set-default-project-file): Reread the content of the active
project file, not the one from the current buffer When a project
file is set as the default project, all directories are
automatically associated with it.
(ada-set-environment): New function
(ada-treat-cmd-string): New special variable ${current}
(ada-treat-cmd-string): Revised. The substitution is now done for
any ${...} substring
(ada-xref-current): If no body was found, compiles the spec
instead. Setup ADA_{SOURCE,OBJECTS}_PATH before running the
compiler to get rid of command line length limitations.
(ada-xref-get-project-field): New function
(ada-xref-project-files): New variable
(ada-xref-runtime-library-specs-path)
(ada-xref-runtime-library-ali-path): New variables
(ada-xref-set-default-prj-values): Default run command now does a
cd to the build directory. New field: main_unit Provide a default
file name even if the current buffer has no prj file.
2000-07-24 11:13:11 +00:00
|
|
|
))
|
2003-02-04 13:24:35 +00:00
|
|
|
|
|
|
|
|
Update copyright notice.
(ada-xref-create-ali): The default is now not to create automatically the
ALI files by compiling the unit, since this isn't always reliable and
requires an up-to-date project file.
(ada-prj-default-comp-cmd): No longer use gcc directly to compile
a file, but use gnatmake instead, since this gives access to the GNAT
project files.
(ada-xref-search-with-egrep): New variable, suggested by P. Waroquiers.
(ada-load-project-hook): New variable, for support of GNAT project files.
(ada-update-project-menu): Fix the detection of the project file name.
(ada-add-keymap): Change key binding for ada-find-file, that conflicted
with another binding in ada-mode.el.
(ada-add-menu): New menu "List Local References", to list the reference
to the entity only in the current file, instead of looking in the whole
project. Much faster.
(ada-find-references): New parameters arg and local-only.
(ada-find-any-references): New parameters local-only and append.
(ada-goto-declaration): Fix handling of predefined entities in xref.
(ada-get-all-references): Updated to the new xref format in GNAT 3.15,
still compatible with GNAT 3.14 of course. Fix various calls to
count-lines, that didn't work correctly when the buffer was narrowed.
2002-06-20 17:31:56 +00:00
|
|
|
(defun ada-find-references (&optional pos arg local-only)
|
1999-10-28 11:12:54 +00:00
|
|
|
"Find all references to the entity under POS.
|
Update copyright notice.
(ada-xref-create-ali): The default is now not to create automatically the
ALI files by compiling the unit, since this isn't always reliable and
requires an up-to-date project file.
(ada-prj-default-comp-cmd): No longer use gcc directly to compile
a file, but use gnatmake instead, since this gives access to the GNAT
project files.
(ada-xref-search-with-egrep): New variable, suggested by P. Waroquiers.
(ada-load-project-hook): New variable, for support of GNAT project files.
(ada-update-project-menu): Fix the detection of the project file name.
(ada-add-keymap): Change key binding for ada-find-file, that conflicted
with another binding in ada-mode.el.
(ada-add-menu): New menu "List Local References", to list the reference
to the entity only in the current file, instead of looking in the whole
project. Much faster.
(ada-find-references): New parameters arg and local-only.
(ada-find-any-references): New parameters local-only and append.
(ada-goto-declaration): Fix handling of predefined entities in xref.
(ada-get-all-references): Updated to the new xref format in GNAT 3.15,
still compatible with GNAT 3.14 of course. Fix various calls to
count-lines, that didn't work correctly when the buffer was narrowed.
2002-06-20 17:31:56 +00:00
|
|
|
Calls gnatfind to find the references.
|
2004-08-22 17:14:02 +00:00
|
|
|
If ARG is t, the contents of the old *gnatfind* buffer is preserved.
|
|
|
|
If LOCAL-ONLY is t, only the declarations in the current file are returned."
|
|
|
|
(interactive "d\nP")
|
1999-10-07 14:25:59 +00:00
|
|
|
(ada-require-project-file)
|
|
|
|
|
|
|
|
(let* ((identlist (ada-read-identifier pos))
|
2006-10-31 00:57:56 +00:00
|
|
|
(alifile (ada-get-ali-file-name (ada-file-of identlist)))
|
Got rid of all byte-compiler warnings on Emacs.
Add to the menu when the file is loaded, not in ada-mode-hook.
Add -toolbar to the default ddd command Switches moved from
ada-prj-default-comp-cmd and ada-prj-default-make-cmd to
ada-prj-default-comp-opt
(ada-add-ada-menu): Remove the map and name parameters Add the Ada
Reference Manual to the menu
(ada-check-current): rewritten as a call to ada-compile-current
(ada-compile): Removed.
(ada-compile-application, ada-compile-current, ada-check-current):
Set the compilation-search-path so that compile.el automatically
finds the sources in src_dir. Automatic scrollong of the
compilation buffer. C-uC-cC-c asks for confirmation before
compiling
(ada-compile-current): New parameter, prj-field
(ada-complete-identifier): Load the .ali file before doing
processing
(ada-find-ali-file-in-dir): prepend build_dir to obj_dir to
conform to gnatmake's behavior.
(ada-find-file-in-dir): New function
(ada-find-references): Set the environment variables for gnatfind
(ada-find-src-file-in-dir): New function.
(ada-first-non-nil): Removed
(ada-gdb-application): Add support for jdb, the java debugger.
(ada-get-ada-file-name): Load the original-file first if not done
yet.
(ada-get-all-references): Handles the new ali syntax (parent types
are found between <>).
(ada-initialize-runtime-library): New function
(ada-mode-hook): Always load a project file when a file is opened,
so that the casing exceptions are correctly read.
(ada-operator-re): Add all missing operators ("abs", "rem", "**").
(ada-parse-prj-file): Use find-file-noselect instead of find-file
to open the project file, since the latter does not work with
speedbar Get default values before loading the prj file, or the
default executable file name is wrong. Use the absolute value of
src_dir to initialize ada-search-directories and
compilation-search-path,... Add the standard runtime library to
the search path for find-file.
(ada-prj-default-debugger): Was missing an opening '{'
(ada-prj-default-bind-opt, ada-prj-default-link-opt): New
variables.
(ada-prj-default-gnatmake-opt): New variable
(ada-prj-find-prj-file): Handles non-file buffers For non-Ada
buffers, the project file is the default one Save the windows
configuration before displaying the menu.
(ada-prj-src-dir, ada-prj-obj-dir, ada-prj-comp-opt,...): Removed
(ada-read-identifier): Fix xrefs on operators (for "mod", "and",
...) regexp-quote identifiers names to support operators +,
-,... in regexps.
(ada-remote): New function.
(ada-run-application): Erase the output buffer before starting the
run Support remote execution of the application. Use
call-process, or the arguments are incorrectly parsed
(ada-set-default-project-file): Reread the content of the active
project file, not the one from the current buffer When a project
file is set as the default project, all directories are
automatically associated with it.
(ada-set-environment): New function
(ada-treat-cmd-string): New special variable ${current}
(ada-treat-cmd-string): Revised. The substitution is now done for
any ${...} substring
(ada-xref-current): If no body was found, compiles the spec
instead. Setup ADA_{SOURCE,OBJECTS}_PATH before running the
compiler to get rid of command line length limitations.
(ada-xref-get-project-field): New function
(ada-xref-project-files): New variable
(ada-xref-runtime-library-specs-path)
(ada-xref-runtime-library-ali-path): New variables
(ada-xref-set-default-prj-values): Default run command now does a
cd to the build directory. New field: main_unit Provide a default
file name even if the current buffer has no prj file.
2000-07-24 11:13:11 +00:00
|
|
|
(process-environment (ada-set-environment)))
|
1999-10-07 14:25:59 +00:00
|
|
|
|
|
|
|
(set-buffer (get-file-buffer (ada-file-of identlist)))
|
|
|
|
|
|
|
|
;; if the file is more recent than the executable
|
|
|
|
(if (or (buffer-modified-p (current-buffer))
|
2006-10-31 00:57:56 +00:00
|
|
|
(file-newer-than-file-p (ada-file-of identlist) alifile))
|
|
|
|
(ada-find-any-references (ada-name-of identlist)
|
|
|
|
(ada-file-of identlist)
|
|
|
|
nil nil local-only arg)
|
1999-10-07 14:25:59 +00:00
|
|
|
(ada-find-any-references (ada-name-of identlist)
|
2006-10-31 00:57:56 +00:00
|
|
|
(ada-file-of identlist)
|
|
|
|
(ada-line-of identlist)
|
|
|
|
(ada-column-of identlist) local-only arg)))
|
1999-10-07 14:25:59 +00:00
|
|
|
)
|
|
|
|
|
Update copyright notice.
(ada-xref-create-ali): The default is now not to create automatically the
ALI files by compiling the unit, since this isn't always reliable and
requires an up-to-date project file.
(ada-prj-default-comp-cmd): No longer use gcc directly to compile
a file, but use gnatmake instead, since this gives access to the GNAT
project files.
(ada-xref-search-with-egrep): New variable, suggested by P. Waroquiers.
(ada-load-project-hook): New variable, for support of GNAT project files.
(ada-update-project-menu): Fix the detection of the project file name.
(ada-add-keymap): Change key binding for ada-find-file, that conflicted
with another binding in ada-mode.el.
(ada-add-menu): New menu "List Local References", to list the reference
to the entity only in the current file, instead of looking in the whole
project. Much faster.
(ada-find-references): New parameters arg and local-only.
(ada-find-any-references): New parameters local-only and append.
(ada-goto-declaration): Fix handling of predefined entities in xref.
(ada-get-all-references): Updated to the new xref format in GNAT 3.15,
still compatible with GNAT 3.14 of course. Fix various calls to
count-lines, that didn't work correctly when the buffer was narrowed.
2002-06-20 17:31:56 +00:00
|
|
|
(defun ada-find-local-references (&optional pos arg)
|
|
|
|
"Find all references to the entity under POS.
|
2004-08-22 17:14:02 +00:00
|
|
|
Calls `gnatfind' to find the references.
|
|
|
|
If ARG is t, the contents of the old *gnatfind* buffer is preserved."
|
|
|
|
(interactive "d\nP")
|
Update copyright notice.
(ada-xref-create-ali): The default is now not to create automatically the
ALI files by compiling the unit, since this isn't always reliable and
requires an up-to-date project file.
(ada-prj-default-comp-cmd): No longer use gcc directly to compile
a file, but use gnatmake instead, since this gives access to the GNAT
project files.
(ada-xref-search-with-egrep): New variable, suggested by P. Waroquiers.
(ada-load-project-hook): New variable, for support of GNAT project files.
(ada-update-project-menu): Fix the detection of the project file name.
(ada-add-keymap): Change key binding for ada-find-file, that conflicted
with another binding in ada-mode.el.
(ada-add-menu): New menu "List Local References", to list the reference
to the entity only in the current file, instead of looking in the whole
project. Much faster.
(ada-find-references): New parameters arg and local-only.
(ada-find-any-references): New parameters local-only and append.
(ada-goto-declaration): Fix handling of predefined entities in xref.
(ada-get-all-references): Updated to the new xref format in GNAT 3.15,
still compatible with GNAT 3.14 of course. Fix various calls to
count-lines, that didn't work correctly when the buffer was narrowed.
2002-06-20 17:31:56 +00:00
|
|
|
(ada-find-references pos arg t))
|
|
|
|
|
|
|
|
(defun ada-find-any-references
|
|
|
|
(entity &optional file line column local-only append)
|
1999-10-28 11:12:54 +00:00
|
|
|
"Search for references to any entity whose name is ENTITY.
|
Update copyright notice.
(ada-xref-create-ali): The default is now not to create automatically the
ALI files by compiling the unit, since this isn't always reliable and
requires an up-to-date project file.
(ada-prj-default-comp-cmd): No longer use gcc directly to compile
a file, but use gnatmake instead, since this gives access to the GNAT
project files.
(ada-xref-search-with-egrep): New variable, suggested by P. Waroquiers.
(ada-load-project-hook): New variable, for support of GNAT project files.
(ada-update-project-menu): Fix the detection of the project file name.
(ada-add-keymap): Change key binding for ada-find-file, that conflicted
with another binding in ada-mode.el.
(ada-add-menu): New menu "List Local References", to list the reference
to the entity only in the current file, instead of looking in the whole
project. Much faster.
(ada-find-references): New parameters arg and local-only.
(ada-find-any-references): New parameters local-only and append.
(ada-goto-declaration): Fix handling of predefined entities in xref.
(ada-get-all-references): Updated to the new xref format in GNAT 3.15,
still compatible with GNAT 3.14 of course. Fix various calls to
count-lines, that didn't work correctly when the buffer was narrowed.
2002-06-20 17:31:56 +00:00
|
|
|
ENTITY was first found the location given by FILE, LINE and COLUMN.
|
2004-08-22 17:14:02 +00:00
|
|
|
If LOCAL-ONLY is t, then list only the references in FILE, which
|
Update copyright notice.
(ada-xref-create-ali): The default is now not to create automatically the
ALI files by compiling the unit, since this isn't always reliable and
requires an up-to-date project file.
(ada-prj-default-comp-cmd): No longer use gcc directly to compile
a file, but use gnatmake instead, since this gives access to the GNAT
project files.
(ada-xref-search-with-egrep): New variable, suggested by P. Waroquiers.
(ada-load-project-hook): New variable, for support of GNAT project files.
(ada-update-project-menu): Fix the detection of the project file name.
(ada-add-keymap): Change key binding for ada-find-file, that conflicted
with another binding in ada-mode.el.
(ada-add-menu): New menu "List Local References", to list the reference
to the entity only in the current file, instead of looking in the whole
project. Much faster.
(ada-find-references): New parameters arg and local-only.
(ada-find-any-references): New parameters local-only and append.
(ada-goto-declaration): Fix handling of predefined entities in xref.
(ada-get-all-references): Updated to the new xref format in GNAT 3.15,
still compatible with GNAT 3.14 of course. Fix various calls to
count-lines, that didn't work correctly when the buffer was narrowed.
2002-06-20 17:31:56 +00:00
|
|
|
is much faster.
|
2004-08-22 17:14:02 +00:00
|
|
|
If APPEND is t, then append the output of the command to the existing
|
|
|
|
buffer `*gnatfind*', if there is one."
|
1999-10-07 14:25:59 +00:00
|
|
|
(interactive "sEntity name: ")
|
|
|
|
(ada-require-project-file)
|
|
|
|
|
2004-08-22 17:14:02 +00:00
|
|
|
;; Prepare the gnatfind command. Note that we must protect the quotes
|
2002-04-09 18:54:20 +00:00
|
|
|
;; around operators, so that they are correctly handled and can be
|
|
|
|
;; processed (gnatfind \"+\":...).
|
|
|
|
(let* ((quote-entity
|
|
|
|
(if (= (aref entity 0) ?\")
|
|
|
|
(if is-windows
|
|
|
|
(concat "\\\"" (substring entity 1 -1) "\\\"")
|
|
|
|
(concat "'\"" (substring entity 1 -1) "\"'"))
|
|
|
|
entity))
|
|
|
|
(switches (ada-xref-get-project-field 'gnatfind_opt))
|
2003-05-04 19:54:00 +00:00
|
|
|
(command (concat "gnat find " switches " "
|
2002-04-09 18:54:20 +00:00
|
|
|
quote-entity
|
2006-10-31 00:57:56 +00:00
|
|
|
(if file (concat ":" (file-name-nondirectory file)))
|
|
|
|
(if line (concat ":" line))
|
|
|
|
(if column (concat ":" column))
|
Update copyright notice.
(ada-xref-create-ali): The default is now not to create automatically the
ALI files by compiling the unit, since this isn't always reliable and
requires an up-to-date project file.
(ada-prj-default-comp-cmd): No longer use gcc directly to compile
a file, but use gnatmake instead, since this gives access to the GNAT
project files.
(ada-xref-search-with-egrep): New variable, suggested by P. Waroquiers.
(ada-load-project-hook): New variable, for support of GNAT project files.
(ada-update-project-menu): Fix the detection of the project file name.
(ada-add-keymap): Change key binding for ada-find-file, that conflicted
with another binding in ada-mode.el.
(ada-add-menu): New menu "List Local References", to list the reference
to the entity only in the current file, instead of looking in the whole
project. Much faster.
(ada-find-references): New parameters arg and local-only.
(ada-find-any-references): New parameters local-only and append.
(ada-goto-declaration): Fix handling of predefined entities in xref.
(ada-get-all-references): Updated to the new xref format in GNAT 3.15,
still compatible with GNAT 3.14 of course. Fix various calls to
count-lines, that didn't work correctly when the buffer was narrowed.
2002-06-20 17:31:56 +00:00
|
|
|
(if local-only (concat " " (file-name-nondirectory file)))
|
|
|
|
))
|
|
|
|
old-contents)
|
1999-10-07 14:25:59 +00:00
|
|
|
|
|
|
|
;; If a project file is defined, use it
|
2002-04-09 18:54:20 +00:00
|
|
|
(if (and ada-prj-default-project-file
|
|
|
|
(not (string= ada-prj-default-project-file "")))
|
2006-10-31 00:57:56 +00:00
|
|
|
(if (string-equal (file-name-extension ada-prj-default-project-file)
|
|
|
|
"gpr")
|
|
|
|
(setq command (concat command " -P" ada-prj-default-project-file))
|
|
|
|
(setq command (concat command " -p" ada-prj-default-project-file))))
|
1999-10-07 14:25:59 +00:00
|
|
|
|
Update copyright notice.
(ada-xref-create-ali): The default is now not to create automatically the
ALI files by compiling the unit, since this isn't always reliable and
requires an up-to-date project file.
(ada-prj-default-comp-cmd): No longer use gcc directly to compile
a file, but use gnatmake instead, since this gives access to the GNAT
project files.
(ada-xref-search-with-egrep): New variable, suggested by P. Waroquiers.
(ada-load-project-hook): New variable, for support of GNAT project files.
(ada-update-project-menu): Fix the detection of the project file name.
(ada-add-keymap): Change key binding for ada-find-file, that conflicted
with another binding in ada-mode.el.
(ada-add-menu): New menu "List Local References", to list the reference
to the entity only in the current file, instead of looking in the whole
project. Much faster.
(ada-find-references): New parameters arg and local-only.
(ada-find-any-references): New parameters local-only and append.
(ada-goto-declaration): Fix handling of predefined entities in xref.
(ada-get-all-references): Updated to the new xref format in GNAT 3.15,
still compatible with GNAT 3.14 of course. Fix various calls to
count-lines, that didn't work correctly when the buffer was narrowed.
2002-06-20 17:31:56 +00:00
|
|
|
(if (and append (get-buffer "*gnatfind*"))
|
|
|
|
(save-excursion
|
|
|
|
(set-buffer "*gnatfind*")
|
|
|
|
(setq old-contents (buffer-string))))
|
2003-02-04 13:24:35 +00:00
|
|
|
|
2004-08-22 17:14:02 +00:00
|
|
|
(let ((compilation-error "reference"))
|
|
|
|
(compilation-start command))
|
1999-10-07 14:25:59 +00:00
|
|
|
|
|
|
|
;; Hide the "Compilation" menu
|
|
|
|
(save-excursion
|
|
|
|
(set-buffer "*gnatfind*")
|
Update copyright notice.
(ada-xref-create-ali): The default is now not to create automatically the
ALI files by compiling the unit, since this isn't always reliable and
requires an up-to-date project file.
(ada-prj-default-comp-cmd): No longer use gcc directly to compile
a file, but use gnatmake instead, since this gives access to the GNAT
project files.
(ada-xref-search-with-egrep): New variable, suggested by P. Waroquiers.
(ada-load-project-hook): New variable, for support of GNAT project files.
(ada-update-project-menu): Fix the detection of the project file name.
(ada-add-keymap): Change key binding for ada-find-file, that conflicted
with another binding in ada-mode.el.
(ada-add-menu): New menu "List Local References", to list the reference
to the entity only in the current file, instead of looking in the whole
project. Much faster.
(ada-find-references): New parameters arg and local-only.
(ada-find-any-references): New parameters local-only and append.
(ada-goto-declaration): Fix handling of predefined entities in xref.
(ada-get-all-references): Updated to the new xref format in GNAT 3.15,
still compatible with GNAT 3.14 of course. Fix various calls to
count-lines, that didn't work correctly when the buffer was narrowed.
2002-06-20 17:31:56 +00:00
|
|
|
(local-unset-key [menu-bar compilation-menu])
|
|
|
|
|
|
|
|
(if old-contents
|
|
|
|
(progn
|
|
|
|
(goto-char 1)
|
|
|
|
(insert old-contents)
|
|
|
|
(goto-char (point-max)))))
|
1999-10-07 14:25:59 +00:00
|
|
|
)
|
|
|
|
)
|
|
|
|
|
2002-04-09 18:54:20 +00:00
|
|
|
(defalias 'ada-change-prj (symbol-function 'ada-set-default-project-file))
|
1999-10-07 14:25:59 +00:00
|
|
|
|
|
|
|
;; ----- Identifier Completion --------------------------------------------
|
|
|
|
(defun ada-complete-identifier (pos)
|
2006-10-31 00:57:56 +00:00
|
|
|
"Try to complete the identifier around POS, using compiler cross-reference information."
|
1999-10-07 14:25:59 +00:00
|
|
|
(interactive "d")
|
|
|
|
(ada-require-project-file)
|
|
|
|
|
Got rid of all byte-compiler warnings on Emacs.
Add to the menu when the file is loaded, not in ada-mode-hook.
Add -toolbar to the default ddd command Switches moved from
ada-prj-default-comp-cmd and ada-prj-default-make-cmd to
ada-prj-default-comp-opt
(ada-add-ada-menu): Remove the map and name parameters Add the Ada
Reference Manual to the menu
(ada-check-current): rewritten as a call to ada-compile-current
(ada-compile): Removed.
(ada-compile-application, ada-compile-current, ada-check-current):
Set the compilation-search-path so that compile.el automatically
finds the sources in src_dir. Automatic scrollong of the
compilation buffer. C-uC-cC-c asks for confirmation before
compiling
(ada-compile-current): New parameter, prj-field
(ada-complete-identifier): Load the .ali file before doing
processing
(ada-find-ali-file-in-dir): prepend build_dir to obj_dir to
conform to gnatmake's behavior.
(ada-find-file-in-dir): New function
(ada-find-references): Set the environment variables for gnatfind
(ada-find-src-file-in-dir): New function.
(ada-first-non-nil): Removed
(ada-gdb-application): Add support for jdb, the java debugger.
(ada-get-ada-file-name): Load the original-file first if not done
yet.
(ada-get-all-references): Handles the new ali syntax (parent types
are found between <>).
(ada-initialize-runtime-library): New function
(ada-mode-hook): Always load a project file when a file is opened,
so that the casing exceptions are correctly read.
(ada-operator-re): Add all missing operators ("abs", "rem", "**").
(ada-parse-prj-file): Use find-file-noselect instead of find-file
to open the project file, since the latter does not work with
speedbar Get default values before loading the prj file, or the
default executable file name is wrong. Use the absolute value of
src_dir to initialize ada-search-directories and
compilation-search-path,... Add the standard runtime library to
the search path for find-file.
(ada-prj-default-debugger): Was missing an opening '{'
(ada-prj-default-bind-opt, ada-prj-default-link-opt): New
variables.
(ada-prj-default-gnatmake-opt): New variable
(ada-prj-find-prj-file): Handles non-file buffers For non-Ada
buffers, the project file is the default one Save the windows
configuration before displaying the menu.
(ada-prj-src-dir, ada-prj-obj-dir, ada-prj-comp-opt,...): Removed
(ada-read-identifier): Fix xrefs on operators (for "mod", "and",
...) regexp-quote identifiers names to support operators +,
-,... in regexps.
(ada-remote): New function.
(ada-run-application): Erase the output buffer before starting the
run Support remote execution of the application. Use
call-process, or the arguments are incorrectly parsed
(ada-set-default-project-file): Reread the content of the active
project file, not the one from the current buffer When a project
file is set as the default project, all directories are
automatically associated with it.
(ada-set-environment): New function
(ada-treat-cmd-string): New special variable ${current}
(ada-treat-cmd-string): Revised. The substitution is now done for
any ${...} substring
(ada-xref-current): If no body was found, compiles the spec
instead. Setup ADA_{SOURCE,OBJECTS}_PATH before running the
compiler to get rid of command line length limitations.
(ada-xref-get-project-field): New function
(ada-xref-project-files): New variable
(ada-xref-runtime-library-specs-path)
(ada-xref-runtime-library-ali-path): New variables
(ada-xref-set-default-prj-values): Default run command now does a
cd to the build directory. New field: main_unit Provide a default
file name even if the current buffer has no prj file.
2000-07-24 11:13:11 +00:00
|
|
|
;; Initialize function-local variables and jump to the .ali buffer
|
1999-10-07 14:25:59 +00:00
|
|
|
;; Note that for regexp search is case insensitive too
|
|
|
|
(let* ((curbuf (current-buffer))
|
2006-10-31 00:57:56 +00:00
|
|
|
(identlist (ada-read-identifier pos))
|
|
|
|
(sofar (concat "^[0-9]+[a-zA-Z][0-9]+[ *]\\("
|
|
|
|
(regexp-quote (ada-name-of identlist))
|
|
|
|
"[a-zA-Z0-9_]*\\)"))
|
|
|
|
(completed nil)
|
|
|
|
(symalist nil))
|
1999-10-07 14:25:59 +00:00
|
|
|
|
Got rid of all byte-compiler warnings on Emacs.
Add to the menu when the file is loaded, not in ada-mode-hook.
Add -toolbar to the default ddd command Switches moved from
ada-prj-default-comp-cmd and ada-prj-default-make-cmd to
ada-prj-default-comp-opt
(ada-add-ada-menu): Remove the map and name parameters Add the Ada
Reference Manual to the menu
(ada-check-current): rewritten as a call to ada-compile-current
(ada-compile): Removed.
(ada-compile-application, ada-compile-current, ada-check-current):
Set the compilation-search-path so that compile.el automatically
finds the sources in src_dir. Automatic scrollong of the
compilation buffer. C-uC-cC-c asks for confirmation before
compiling
(ada-compile-current): New parameter, prj-field
(ada-complete-identifier): Load the .ali file before doing
processing
(ada-find-ali-file-in-dir): prepend build_dir to obj_dir to
conform to gnatmake's behavior.
(ada-find-file-in-dir): New function
(ada-find-references): Set the environment variables for gnatfind
(ada-find-src-file-in-dir): New function.
(ada-first-non-nil): Removed
(ada-gdb-application): Add support for jdb, the java debugger.
(ada-get-ada-file-name): Load the original-file first if not done
yet.
(ada-get-all-references): Handles the new ali syntax (parent types
are found between <>).
(ada-initialize-runtime-library): New function
(ada-mode-hook): Always load a project file when a file is opened,
so that the casing exceptions are correctly read.
(ada-operator-re): Add all missing operators ("abs", "rem", "**").
(ada-parse-prj-file): Use find-file-noselect instead of find-file
to open the project file, since the latter does not work with
speedbar Get default values before loading the prj file, or the
default executable file name is wrong. Use the absolute value of
src_dir to initialize ada-search-directories and
compilation-search-path,... Add the standard runtime library to
the search path for find-file.
(ada-prj-default-debugger): Was missing an opening '{'
(ada-prj-default-bind-opt, ada-prj-default-link-opt): New
variables.
(ada-prj-default-gnatmake-opt): New variable
(ada-prj-find-prj-file): Handles non-file buffers For non-Ada
buffers, the project file is the default one Save the windows
configuration before displaying the menu.
(ada-prj-src-dir, ada-prj-obj-dir, ada-prj-comp-opt,...): Removed
(ada-read-identifier): Fix xrefs on operators (for "mod", "and",
...) regexp-quote identifiers names to support operators +,
-,... in regexps.
(ada-remote): New function.
(ada-run-application): Erase the output buffer before starting the
run Support remote execution of the application. Use
call-process, or the arguments are incorrectly parsed
(ada-set-default-project-file): Reread the content of the active
project file, not the one from the current buffer When a project
file is set as the default project, all directories are
automatically associated with it.
(ada-set-environment): New function
(ada-treat-cmd-string): New special variable ${current}
(ada-treat-cmd-string): Revised. The substitution is now done for
any ${...} substring
(ada-xref-current): If no body was found, compiles the spec
instead. Setup ADA_{SOURCE,OBJECTS}_PATH before running the
compiler to get rid of command line length limitations.
(ada-xref-get-project-field): New function
(ada-xref-project-files): New variable
(ada-xref-runtime-library-specs-path)
(ada-xref-runtime-library-ali-path): New variables
(ada-xref-set-default-prj-values): Default run command now does a
cd to the build directory. New field: main_unit Provide a default
file name even if the current buffer has no prj file.
2000-07-24 11:13:11 +00:00
|
|
|
;; Open the .ali file
|
|
|
|
(set-buffer (ada-get-ali-buffer (buffer-file-name)))
|
1999-10-07 14:25:59 +00:00
|
|
|
(goto-char (point-max))
|
|
|
|
|
|
|
|
;; build an alist of possible completions
|
|
|
|
(while (re-search-backward sofar nil t)
|
|
|
|
(setq symalist (cons (cons (match-string 1) nil) symalist)))
|
|
|
|
|
|
|
|
(setq completed (try-completion "" symalist))
|
|
|
|
|
|
|
|
;; kills .ali buffer
|
|
|
|
(kill-buffer nil)
|
|
|
|
|
|
|
|
;; deletes the incomplete identifier in the buffer
|
|
|
|
(set-buffer curbuf)
|
|
|
|
(looking-at "[a-zA-Z0-9_]+")
|
|
|
|
(replace-match "")
|
|
|
|
;; inserts the completed symbol
|
|
|
|
(insert completed)
|
|
|
|
))
|
|
|
|
|
|
|
|
;; ----- Cross-referencing ----------------------------------------
|
|
|
|
|
|
|
|
(defun ada-point-and-xref ()
|
2003-04-29 23:40:08 +00:00
|
|
|
"Jump to the declaration of the entity below the cursor."
|
1999-10-07 14:25:59 +00:00
|
|
|
(interactive)
|
|
|
|
(mouse-set-point last-input-event)
|
|
|
|
(ada-goto-declaration (point)))
|
|
|
|
|
2003-04-29 23:40:08 +00:00
|
|
|
(defun ada-point-and-xref-body ()
|
|
|
|
"Jump to the body of the entity under the cursor."
|
|
|
|
(interactive)
|
|
|
|
(mouse-set-point last-input-event)
|
|
|
|
(ada-goto-body (point)))
|
|
|
|
|
|
|
|
(defun ada-goto-body (pos &optional other-frame)
|
|
|
|
"Display the body of the entity around POS.
|
2006-10-31 00:57:56 +00:00
|
|
|
OTHER-FRAME non-nil means display in another frame.
|
2003-04-29 23:40:08 +00:00
|
|
|
If the entity doesn't have a body, display its declaration.
|
|
|
|
As a side effect, the buffer for the declaration is also open."
|
|
|
|
(interactive "d")
|
|
|
|
(ada-goto-declaration pos other-frame)
|
|
|
|
|
|
|
|
;; Temporarily force the display in the same buffer, since we
|
|
|
|
;; already changed previously
|
|
|
|
(let ((ada-xref-other-buffer nil))
|
|
|
|
(ada-goto-declaration (point) nil)))
|
|
|
|
|
2002-04-09 18:54:20 +00:00
|
|
|
(defun ada-goto-declaration (pos &optional other-frame)
|
1999-10-28 11:12:54 +00:00
|
|
|
"Display the declaration of the identifier around POS.
|
|
|
|
The declaration is shown in another buffer if `ada-xref-other-buffer' is
|
2002-04-09 18:54:20 +00:00
|
|
|
non-nil.
|
|
|
|
If OTHER-FRAME is non-nil, display the cross-reference in another frame."
|
1999-10-07 14:25:59 +00:00
|
|
|
(interactive "d")
|
|
|
|
(ada-require-project-file)
|
|
|
|
(push-mark pos)
|
|
|
|
(ada-xref-push-pos (buffer-file-name) pos)
|
|
|
|
|
2002-04-09 18:54:20 +00:00
|
|
|
;; First try the standard algorithm by looking into the .ali file, but if
|
|
|
|
;; that file was too old or even did not exist, try to look in the whole
|
|
|
|
;; object path for a possible location.
|
|
|
|
(let ((identlist (ada-read-identifier pos)))
|
|
|
|
(condition-case nil
|
|
|
|
(ada-find-in-ali identlist other-frame)
|
Update copyright notice.
(ada-xref-create-ali): The default is now not to create automatically the
ALI files by compiling the unit, since this isn't always reliable and
requires an up-to-date project file.
(ada-prj-default-comp-cmd): No longer use gcc directly to compile
a file, but use gnatmake instead, since this gives access to the GNAT
project files.
(ada-xref-search-with-egrep): New variable, suggested by P. Waroquiers.
(ada-load-project-hook): New variable, for support of GNAT project files.
(ada-update-project-menu): Fix the detection of the project file name.
(ada-add-keymap): Change key binding for ada-find-file, that conflicted
with another binding in ada-mode.el.
(ada-add-menu): New menu "List Local References", to list the reference
to the entity only in the current file, instead of looking in the whole
project. Much faster.
(ada-find-references): New parameters arg and local-only.
(ada-find-any-references): New parameters local-only and append.
(ada-goto-declaration): Fix handling of predefined entities in xref.
(ada-get-all-references): Updated to the new xref format in GNAT 3.15,
still compatible with GNAT 3.14 of course. Fix various calls to
count-lines, that didn't work correctly when the buffer was narrowed.
2002-06-20 17:31:56 +00:00
|
|
|
(error
|
|
|
|
(let ((ali-file (ada-get-ali-file-name (ada-file-of identlist))))
|
|
|
|
|
|
|
|
;; If the ALI file was up-to-date, then we probably have a predefined
|
|
|
|
;; entity, whose references are not given by GNAT
|
|
|
|
(if (and (file-exists-p ali-file)
|
|
|
|
(file-newer-than-file-p ali-file (ada-file-of identlist)))
|
2006-10-31 00:57:56 +00:00
|
|
|
(message "No cross-reference found -- may be a predefined entity.")
|
Update copyright notice.
(ada-xref-create-ali): The default is now not to create automatically the
ALI files by compiling the unit, since this isn't always reliable and
requires an up-to-date project file.
(ada-prj-default-comp-cmd): No longer use gcc directly to compile
a file, but use gnatmake instead, since this gives access to the GNAT
project files.
(ada-xref-search-with-egrep): New variable, suggested by P. Waroquiers.
(ada-load-project-hook): New variable, for support of GNAT project files.
(ada-update-project-menu): Fix the detection of the project file name.
(ada-add-keymap): Change key binding for ada-find-file, that conflicted
with another binding in ada-mode.el.
(ada-add-menu): New menu "List Local References", to list the reference
to the entity only in the current file, instead of looking in the whole
project. Much faster.
(ada-find-references): New parameters arg and local-only.
(ada-find-any-references): New parameters local-only and append.
(ada-goto-declaration): Fix handling of predefined entities in xref.
(ada-get-all-references): Updated to the new xref format in GNAT 3.15,
still compatible with GNAT 3.14 of course. Fix various calls to
count-lines, that didn't work correctly when the buffer was narrowed.
2002-06-20 17:31:56 +00:00
|
|
|
|
|
|
|
;; Else, look in every ALI file, except if the user doesn't want that
|
|
|
|
(if ada-xref-search-with-egrep
|
|
|
|
(ada-find-in-src-path identlist other-frame)
|
2004-08-22 17:14:02 +00:00
|
|
|
(message "Cross-referencing information is not up-to-date; please recompile.")
|
Update copyright notice.
(ada-xref-create-ali): The default is now not to create automatically the
ALI files by compiling the unit, since this isn't always reliable and
requires an up-to-date project file.
(ada-prj-default-comp-cmd): No longer use gcc directly to compile
a file, but use gnatmake instead, since this gives access to the GNAT
project files.
(ada-xref-search-with-egrep): New variable, suggested by P. Waroquiers.
(ada-load-project-hook): New variable, for support of GNAT project files.
(ada-update-project-menu): Fix the detection of the project file name.
(ada-add-keymap): Change key binding for ada-find-file, that conflicted
with another binding in ada-mode.el.
(ada-add-menu): New menu "List Local References", to list the reference
to the entity only in the current file, instead of looking in the whole
project. Much faster.
(ada-find-references): New parameters arg and local-only.
(ada-find-any-references): New parameters local-only and append.
(ada-goto-declaration): Fix handling of predefined entities in xref.
(ada-get-all-references): Updated to the new xref format in GNAT 3.15,
still compatible with GNAT 3.14 of course. Fix various calls to
count-lines, that didn't work correctly when the buffer was narrowed.
2002-06-20 17:31:56 +00:00
|
|
|
)))))))
|
2002-04-09 18:54:20 +00:00
|
|
|
|
2003-05-13 21:15:44 +00:00
|
|
|
(defun ada-goto-declaration-other-frame (pos)
|
1999-10-28 11:12:54 +00:00
|
|
|
"Display the declaration of the identifier around POS.
|
|
|
|
The declation is shown in another frame if `ada-xref-other-buffer' is non-nil."
|
1999-10-07 14:25:59 +00:00
|
|
|
(interactive "d")
|
2002-04-09 18:54:20 +00:00
|
|
|
(ada-goto-declaration pos t))
|
1999-10-07 14:25:59 +00:00
|
|
|
|
Got rid of all byte-compiler warnings on Emacs.
Add to the menu when the file is loaded, not in ada-mode-hook.
Add -toolbar to the default ddd command Switches moved from
ada-prj-default-comp-cmd and ada-prj-default-make-cmd to
ada-prj-default-comp-opt
(ada-add-ada-menu): Remove the map and name parameters Add the Ada
Reference Manual to the menu
(ada-check-current): rewritten as a call to ada-compile-current
(ada-compile): Removed.
(ada-compile-application, ada-compile-current, ada-check-current):
Set the compilation-search-path so that compile.el automatically
finds the sources in src_dir. Automatic scrollong of the
compilation buffer. C-uC-cC-c asks for confirmation before
compiling
(ada-compile-current): New parameter, prj-field
(ada-complete-identifier): Load the .ali file before doing
processing
(ada-find-ali-file-in-dir): prepend build_dir to obj_dir to
conform to gnatmake's behavior.
(ada-find-file-in-dir): New function
(ada-find-references): Set the environment variables for gnatfind
(ada-find-src-file-in-dir): New function.
(ada-first-non-nil): Removed
(ada-gdb-application): Add support for jdb, the java debugger.
(ada-get-ada-file-name): Load the original-file first if not done
yet.
(ada-get-all-references): Handles the new ali syntax (parent types
are found between <>).
(ada-initialize-runtime-library): New function
(ada-mode-hook): Always load a project file when a file is opened,
so that the casing exceptions are correctly read.
(ada-operator-re): Add all missing operators ("abs", "rem", "**").
(ada-parse-prj-file): Use find-file-noselect instead of find-file
to open the project file, since the latter does not work with
speedbar Get default values before loading the prj file, or the
default executable file name is wrong. Use the absolute value of
src_dir to initialize ada-search-directories and
compilation-search-path,... Add the standard runtime library to
the search path for find-file.
(ada-prj-default-debugger): Was missing an opening '{'
(ada-prj-default-bind-opt, ada-prj-default-link-opt): New
variables.
(ada-prj-default-gnatmake-opt): New variable
(ada-prj-find-prj-file): Handles non-file buffers For non-Ada
buffers, the project file is the default one Save the windows
configuration before displaying the menu.
(ada-prj-src-dir, ada-prj-obj-dir, ada-prj-comp-opt,...): Removed
(ada-read-identifier): Fix xrefs on operators (for "mod", "and",
...) regexp-quote identifiers names to support operators +,
-,... in regexps.
(ada-remote): New function.
(ada-run-application): Erase the output buffer before starting the
run Support remote execution of the application. Use
call-process, or the arguments are incorrectly parsed
(ada-set-default-project-file): Reread the content of the active
project file, not the one from the current buffer When a project
file is set as the default project, all directories are
automatically associated with it.
(ada-set-environment): New function
(ada-treat-cmd-string): New special variable ${current}
(ada-treat-cmd-string): Revised. The substitution is now done for
any ${...} substring
(ada-xref-current): If no body was found, compiles the spec
instead. Setup ADA_{SOURCE,OBJECTS}_PATH before running the
compiler to get rid of command line length limitations.
(ada-xref-get-project-field): New function
(ada-xref-project-files): New variable
(ada-xref-runtime-library-specs-path)
(ada-xref-runtime-library-ali-path): New variables
(ada-xref-set-default-prj-values): Default run command now does a
cd to the build directory. New field: main_unit Provide a default
file name even if the current buffer has no prj file.
2000-07-24 11:13:11 +00:00
|
|
|
(defun ada-remote (command)
|
|
|
|
"Return the remote version of COMMAND, or COMMAND if remote_machine is nil."
|
|
|
|
(let ((machine (ada-xref-get-project-field 'remote_machine)))
|
|
|
|
(if (or (not machine) (string= machine ""))
|
|
|
|
command
|
|
|
|
(format "%s %s '(%s)'"
|
|
|
|
remote-shell-program
|
|
|
|
machine
|
|
|
|
command))))
|
|
|
|
|
|
|
|
(defun ada-get-absolute-dir-list (dir-list root-dir)
|
2006-10-31 00:57:56 +00:00
|
|
|
"Return the list of absolute directories found in DIR-LIST.
|
|
|
|
If a directory is a relative directory, ROOT-DIR is prepended."
|
2002-04-09 18:54:20 +00:00
|
|
|
(mapcar (lambda (x) (expand-file-name x root-dir)) dir-list))
|
Got rid of all byte-compiler warnings on Emacs.
Add to the menu when the file is loaded, not in ada-mode-hook.
Add -toolbar to the default ddd command Switches moved from
ada-prj-default-comp-cmd and ada-prj-default-make-cmd to
ada-prj-default-comp-opt
(ada-add-ada-menu): Remove the map and name parameters Add the Ada
Reference Manual to the menu
(ada-check-current): rewritten as a call to ada-compile-current
(ada-compile): Removed.
(ada-compile-application, ada-compile-current, ada-check-current):
Set the compilation-search-path so that compile.el automatically
finds the sources in src_dir. Automatic scrollong of the
compilation buffer. C-uC-cC-c asks for confirmation before
compiling
(ada-compile-current): New parameter, prj-field
(ada-complete-identifier): Load the .ali file before doing
processing
(ada-find-ali-file-in-dir): prepend build_dir to obj_dir to
conform to gnatmake's behavior.
(ada-find-file-in-dir): New function
(ada-find-references): Set the environment variables for gnatfind
(ada-find-src-file-in-dir): New function.
(ada-first-non-nil): Removed
(ada-gdb-application): Add support for jdb, the java debugger.
(ada-get-ada-file-name): Load the original-file first if not done
yet.
(ada-get-all-references): Handles the new ali syntax (parent types
are found between <>).
(ada-initialize-runtime-library): New function
(ada-mode-hook): Always load a project file when a file is opened,
so that the casing exceptions are correctly read.
(ada-operator-re): Add all missing operators ("abs", "rem", "**").
(ada-parse-prj-file): Use find-file-noselect instead of find-file
to open the project file, since the latter does not work with
speedbar Get default values before loading the prj file, or the
default executable file name is wrong. Use the absolute value of
src_dir to initialize ada-search-directories and
compilation-search-path,... Add the standard runtime library to
the search path for find-file.
(ada-prj-default-debugger): Was missing an opening '{'
(ada-prj-default-bind-opt, ada-prj-default-link-opt): New
variables.
(ada-prj-default-gnatmake-opt): New variable
(ada-prj-find-prj-file): Handles non-file buffers For non-Ada
buffers, the project file is the default one Save the windows
configuration before displaying the menu.
(ada-prj-src-dir, ada-prj-obj-dir, ada-prj-comp-opt,...): Removed
(ada-read-identifier): Fix xrefs on operators (for "mod", "and",
...) regexp-quote identifiers names to support operators +,
-,... in regexps.
(ada-remote): New function.
(ada-run-application): Erase the output buffer before starting the
run Support remote execution of the application. Use
call-process, or the arguments are incorrectly parsed
(ada-set-default-project-file): Reread the content of the active
project file, not the one from the current buffer When a project
file is set as the default project, all directories are
automatically associated with it.
(ada-set-environment): New function
(ada-treat-cmd-string): New special variable ${current}
(ada-treat-cmd-string): Revised. The substitution is now done for
any ${...} substring
(ada-xref-current): If no body was found, compiles the spec
instead. Setup ADA_{SOURCE,OBJECTS}_PATH before running the
compiler to get rid of command line length limitations.
(ada-xref-get-project-field): New function
(ada-xref-project-files): New variable
(ada-xref-runtime-library-specs-path)
(ada-xref-runtime-library-ali-path): New variables
(ada-xref-set-default-prj-values): Default run command now does a
cd to the build directory. New field: main_unit Provide a default
file name even if the current buffer has no prj file.
2000-07-24 11:13:11 +00:00
|
|
|
|
|
|
|
(defun ada-set-environment ()
|
2004-08-22 17:14:02 +00:00
|
|
|
"Prepare an environment for Ada compilation.
|
|
|
|
This returns a new value to use for `process-environment',
|
|
|
|
but does not actually put it into use.
|
Got rid of all byte-compiler warnings on Emacs.
Add to the menu when the file is loaded, not in ada-mode-hook.
Add -toolbar to the default ddd command Switches moved from
ada-prj-default-comp-cmd and ada-prj-default-make-cmd to
ada-prj-default-comp-opt
(ada-add-ada-menu): Remove the map and name parameters Add the Ada
Reference Manual to the menu
(ada-check-current): rewritten as a call to ada-compile-current
(ada-compile): Removed.
(ada-compile-application, ada-compile-current, ada-check-current):
Set the compilation-search-path so that compile.el automatically
finds the sources in src_dir. Automatic scrollong of the
compilation buffer. C-uC-cC-c asks for confirmation before
compiling
(ada-compile-current): New parameter, prj-field
(ada-complete-identifier): Load the .ali file before doing
processing
(ada-find-ali-file-in-dir): prepend build_dir to obj_dir to
conform to gnatmake's behavior.
(ada-find-file-in-dir): New function
(ada-find-references): Set the environment variables for gnatfind
(ada-find-src-file-in-dir): New function.
(ada-first-non-nil): Removed
(ada-gdb-application): Add support for jdb, the java debugger.
(ada-get-ada-file-name): Load the original-file first if not done
yet.
(ada-get-all-references): Handles the new ali syntax (parent types
are found between <>).
(ada-initialize-runtime-library): New function
(ada-mode-hook): Always load a project file when a file is opened,
so that the casing exceptions are correctly read.
(ada-operator-re): Add all missing operators ("abs", "rem", "**").
(ada-parse-prj-file): Use find-file-noselect instead of find-file
to open the project file, since the latter does not work with
speedbar Get default values before loading the prj file, or the
default executable file name is wrong. Use the absolute value of
src_dir to initialize ada-search-directories and
compilation-search-path,... Add the standard runtime library to
the search path for find-file.
(ada-prj-default-debugger): Was missing an opening '{'
(ada-prj-default-bind-opt, ada-prj-default-link-opt): New
variables.
(ada-prj-default-gnatmake-opt): New variable
(ada-prj-find-prj-file): Handles non-file buffers For non-Ada
buffers, the project file is the default one Save the windows
configuration before displaying the menu.
(ada-prj-src-dir, ada-prj-obj-dir, ada-prj-comp-opt,...): Removed
(ada-read-identifier): Fix xrefs on operators (for "mod", "and",
...) regexp-quote identifiers names to support operators +,
-,... in regexps.
(ada-remote): New function.
(ada-run-application): Erase the output buffer before starting the
run Support remote execution of the application. Use
call-process, or the arguments are incorrectly parsed
(ada-set-default-project-file): Reread the content of the active
project file, not the one from the current buffer When a project
file is set as the default project, all directories are
automatically associated with it.
(ada-set-environment): New function
(ada-treat-cmd-string): New special variable ${current}
(ada-treat-cmd-string): Revised. The substitution is now done for
any ${...} substring
(ada-xref-current): If no body was found, compiles the spec
instead. Setup ADA_{SOURCE,OBJECTS}_PATH before running the
compiler to get rid of command line length limitations.
(ada-xref-get-project-field): New function
(ada-xref-project-files): New variable
(ada-xref-runtime-library-specs-path)
(ada-xref-runtime-library-ali-path): New variables
(ada-xref-set-default-prj-values): Default run command now does a
cd to the build directory. New field: main_unit Provide a default
file name even if the current buffer has no prj file.
2000-07-24 11:13:11 +00:00
|
|
|
It modifies the source path and object path with the values found in the
|
|
|
|
project file."
|
|
|
|
(let ((include (getenv "ADA_INCLUDE_PATH"))
|
|
|
|
(objects (getenv "ADA_OBJECTS_PATH"))
|
|
|
|
(build-dir (ada-xref-get-project-field 'build_dir)))
|
|
|
|
(if include
|
2002-04-09 18:54:20 +00:00
|
|
|
(set 'include (concat path-separator include)))
|
Got rid of all byte-compiler warnings on Emacs.
Add to the menu when the file is loaded, not in ada-mode-hook.
Add -toolbar to the default ddd command Switches moved from
ada-prj-default-comp-cmd and ada-prj-default-make-cmd to
ada-prj-default-comp-opt
(ada-add-ada-menu): Remove the map and name parameters Add the Ada
Reference Manual to the menu
(ada-check-current): rewritten as a call to ada-compile-current
(ada-compile): Removed.
(ada-compile-application, ada-compile-current, ada-check-current):
Set the compilation-search-path so that compile.el automatically
finds the sources in src_dir. Automatic scrollong of the
compilation buffer. C-uC-cC-c asks for confirmation before
compiling
(ada-compile-current): New parameter, prj-field
(ada-complete-identifier): Load the .ali file before doing
processing
(ada-find-ali-file-in-dir): prepend build_dir to obj_dir to
conform to gnatmake's behavior.
(ada-find-file-in-dir): New function
(ada-find-references): Set the environment variables for gnatfind
(ada-find-src-file-in-dir): New function.
(ada-first-non-nil): Removed
(ada-gdb-application): Add support for jdb, the java debugger.
(ada-get-ada-file-name): Load the original-file first if not done
yet.
(ada-get-all-references): Handles the new ali syntax (parent types
are found between <>).
(ada-initialize-runtime-library): New function
(ada-mode-hook): Always load a project file when a file is opened,
so that the casing exceptions are correctly read.
(ada-operator-re): Add all missing operators ("abs", "rem", "**").
(ada-parse-prj-file): Use find-file-noselect instead of find-file
to open the project file, since the latter does not work with
speedbar Get default values before loading the prj file, or the
default executable file name is wrong. Use the absolute value of
src_dir to initialize ada-search-directories and
compilation-search-path,... Add the standard runtime library to
the search path for find-file.
(ada-prj-default-debugger): Was missing an opening '{'
(ada-prj-default-bind-opt, ada-prj-default-link-opt): New
variables.
(ada-prj-default-gnatmake-opt): New variable
(ada-prj-find-prj-file): Handles non-file buffers For non-Ada
buffers, the project file is the default one Save the windows
configuration before displaying the menu.
(ada-prj-src-dir, ada-prj-obj-dir, ada-prj-comp-opt,...): Removed
(ada-read-identifier): Fix xrefs on operators (for "mod", "and",
...) regexp-quote identifiers names to support operators +,
-,... in regexps.
(ada-remote): New function.
(ada-run-application): Erase the output buffer before starting the
run Support remote execution of the application. Use
call-process, or the arguments are incorrectly parsed
(ada-set-default-project-file): Reread the content of the active
project file, not the one from the current buffer When a project
file is set as the default project, all directories are
automatically associated with it.
(ada-set-environment): New function
(ada-treat-cmd-string): New special variable ${current}
(ada-treat-cmd-string): Revised. The substitution is now done for
any ${...} substring
(ada-xref-current): If no body was found, compiles the spec
instead. Setup ADA_{SOURCE,OBJECTS}_PATH before running the
compiler to get rid of command line length limitations.
(ada-xref-get-project-field): New function
(ada-xref-project-files): New variable
(ada-xref-runtime-library-specs-path)
(ada-xref-runtime-library-ali-path): New variables
(ada-xref-set-default-prj-values): Default run command now does a
cd to the build directory. New field: main_unit Provide a default
file name even if the current buffer has no prj file.
2000-07-24 11:13:11 +00:00
|
|
|
(if objects
|
2002-04-09 18:54:20 +00:00
|
|
|
(set 'objects (concat path-separator objects)))
|
Got rid of all byte-compiler warnings on Emacs.
Add to the menu when the file is loaded, not in ada-mode-hook.
Add -toolbar to the default ddd command Switches moved from
ada-prj-default-comp-cmd and ada-prj-default-make-cmd to
ada-prj-default-comp-opt
(ada-add-ada-menu): Remove the map and name parameters Add the Ada
Reference Manual to the menu
(ada-check-current): rewritten as a call to ada-compile-current
(ada-compile): Removed.
(ada-compile-application, ada-compile-current, ada-check-current):
Set the compilation-search-path so that compile.el automatically
finds the sources in src_dir. Automatic scrollong of the
compilation buffer. C-uC-cC-c asks for confirmation before
compiling
(ada-compile-current): New parameter, prj-field
(ada-complete-identifier): Load the .ali file before doing
processing
(ada-find-ali-file-in-dir): prepend build_dir to obj_dir to
conform to gnatmake's behavior.
(ada-find-file-in-dir): New function
(ada-find-references): Set the environment variables for gnatfind
(ada-find-src-file-in-dir): New function.
(ada-first-non-nil): Removed
(ada-gdb-application): Add support for jdb, the java debugger.
(ada-get-ada-file-name): Load the original-file first if not done
yet.
(ada-get-all-references): Handles the new ali syntax (parent types
are found between <>).
(ada-initialize-runtime-library): New function
(ada-mode-hook): Always load a project file when a file is opened,
so that the casing exceptions are correctly read.
(ada-operator-re): Add all missing operators ("abs", "rem", "**").
(ada-parse-prj-file): Use find-file-noselect instead of find-file
to open the project file, since the latter does not work with
speedbar Get default values before loading the prj file, or the
default executable file name is wrong. Use the absolute value of
src_dir to initialize ada-search-directories and
compilation-search-path,... Add the standard runtime library to
the search path for find-file.
(ada-prj-default-debugger): Was missing an opening '{'
(ada-prj-default-bind-opt, ada-prj-default-link-opt): New
variables.
(ada-prj-default-gnatmake-opt): New variable
(ada-prj-find-prj-file): Handles non-file buffers For non-Ada
buffers, the project file is the default one Save the windows
configuration before displaying the menu.
(ada-prj-src-dir, ada-prj-obj-dir, ada-prj-comp-opt,...): Removed
(ada-read-identifier): Fix xrefs on operators (for "mod", "and",
...) regexp-quote identifiers names to support operators +,
-,... in regexps.
(ada-remote): New function.
(ada-run-application): Erase the output buffer before starting the
run Support remote execution of the application. Use
call-process, or the arguments are incorrectly parsed
(ada-set-default-project-file): Reread the content of the active
project file, not the one from the current buffer When a project
file is set as the default project, all directories are
automatically associated with it.
(ada-set-environment): New function
(ada-treat-cmd-string): New special variable ${current}
(ada-treat-cmd-string): Revised. The substitution is now done for
any ${...} substring
(ada-xref-current): If no body was found, compiles the spec
instead. Setup ADA_{SOURCE,OBJECTS}_PATH before running the
compiler to get rid of command line length limitations.
(ada-xref-get-project-field): New function
(ada-xref-project-files): New variable
(ada-xref-runtime-library-specs-path)
(ada-xref-runtime-library-ali-path): New variables
(ada-xref-set-default-prj-values): Default run command now does a
cd to the build directory. New field: main_unit Provide a default
file name even if the current buffer has no prj file.
2000-07-24 11:13:11 +00:00
|
|
|
(cons
|
|
|
|
(concat "ADA_INCLUDE_PATH="
|
2002-04-09 18:54:20 +00:00
|
|
|
(mapconcat (lambda(x) (expand-file-name x build-dir))
|
Got rid of all byte-compiler warnings on Emacs.
Add to the menu when the file is loaded, not in ada-mode-hook.
Add -toolbar to the default ddd command Switches moved from
ada-prj-default-comp-cmd and ada-prj-default-make-cmd to
ada-prj-default-comp-opt
(ada-add-ada-menu): Remove the map and name parameters Add the Ada
Reference Manual to the menu
(ada-check-current): rewritten as a call to ada-compile-current
(ada-compile): Removed.
(ada-compile-application, ada-compile-current, ada-check-current):
Set the compilation-search-path so that compile.el automatically
finds the sources in src_dir. Automatic scrollong of the
compilation buffer. C-uC-cC-c asks for confirmation before
compiling
(ada-compile-current): New parameter, prj-field
(ada-complete-identifier): Load the .ali file before doing
processing
(ada-find-ali-file-in-dir): prepend build_dir to obj_dir to
conform to gnatmake's behavior.
(ada-find-file-in-dir): New function
(ada-find-references): Set the environment variables for gnatfind
(ada-find-src-file-in-dir): New function.
(ada-first-non-nil): Removed
(ada-gdb-application): Add support for jdb, the java debugger.
(ada-get-ada-file-name): Load the original-file first if not done
yet.
(ada-get-all-references): Handles the new ali syntax (parent types
are found between <>).
(ada-initialize-runtime-library): New function
(ada-mode-hook): Always load a project file when a file is opened,
so that the casing exceptions are correctly read.
(ada-operator-re): Add all missing operators ("abs", "rem", "**").
(ada-parse-prj-file): Use find-file-noselect instead of find-file
to open the project file, since the latter does not work with
speedbar Get default values before loading the prj file, or the
default executable file name is wrong. Use the absolute value of
src_dir to initialize ada-search-directories and
compilation-search-path,... Add the standard runtime library to
the search path for find-file.
(ada-prj-default-debugger): Was missing an opening '{'
(ada-prj-default-bind-opt, ada-prj-default-link-opt): New
variables.
(ada-prj-default-gnatmake-opt): New variable
(ada-prj-find-prj-file): Handles non-file buffers For non-Ada
buffers, the project file is the default one Save the windows
configuration before displaying the menu.
(ada-prj-src-dir, ada-prj-obj-dir, ada-prj-comp-opt,...): Removed
(ada-read-identifier): Fix xrefs on operators (for "mod", "and",
...) regexp-quote identifiers names to support operators +,
-,... in regexps.
(ada-remote): New function.
(ada-run-application): Erase the output buffer before starting the
run Support remote execution of the application. Use
call-process, or the arguments are incorrectly parsed
(ada-set-default-project-file): Reread the content of the active
project file, not the one from the current buffer When a project
file is set as the default project, all directories are
automatically associated with it.
(ada-set-environment): New function
(ada-treat-cmd-string): New special variable ${current}
(ada-treat-cmd-string): Revised. The substitution is now done for
any ${...} substring
(ada-xref-current): If no body was found, compiles the spec
instead. Setup ADA_{SOURCE,OBJECTS}_PATH before running the
compiler to get rid of command line length limitations.
(ada-xref-get-project-field): New function
(ada-xref-project-files): New variable
(ada-xref-runtime-library-specs-path)
(ada-xref-runtime-library-ali-path): New variables
(ada-xref-set-default-prj-values): Default run command now does a
cd to the build directory. New field: main_unit Provide a default
file name even if the current buffer has no prj file.
2000-07-24 11:13:11 +00:00
|
|
|
(ada-xref-get-project-field 'src_dir)
|
2002-04-09 18:54:20 +00:00
|
|
|
path-separator)
|
|
|
|
include)
|
Got rid of all byte-compiler warnings on Emacs.
Add to the menu when the file is loaded, not in ada-mode-hook.
Add -toolbar to the default ddd command Switches moved from
ada-prj-default-comp-cmd and ada-prj-default-make-cmd to
ada-prj-default-comp-opt
(ada-add-ada-menu): Remove the map and name parameters Add the Ada
Reference Manual to the menu
(ada-check-current): rewritten as a call to ada-compile-current
(ada-compile): Removed.
(ada-compile-application, ada-compile-current, ada-check-current):
Set the compilation-search-path so that compile.el automatically
finds the sources in src_dir. Automatic scrollong of the
compilation buffer. C-uC-cC-c asks for confirmation before
compiling
(ada-compile-current): New parameter, prj-field
(ada-complete-identifier): Load the .ali file before doing
processing
(ada-find-ali-file-in-dir): prepend build_dir to obj_dir to
conform to gnatmake's behavior.
(ada-find-file-in-dir): New function
(ada-find-references): Set the environment variables for gnatfind
(ada-find-src-file-in-dir): New function.
(ada-first-non-nil): Removed
(ada-gdb-application): Add support for jdb, the java debugger.
(ada-get-ada-file-name): Load the original-file first if not done
yet.
(ada-get-all-references): Handles the new ali syntax (parent types
are found between <>).
(ada-initialize-runtime-library): New function
(ada-mode-hook): Always load a project file when a file is opened,
so that the casing exceptions are correctly read.
(ada-operator-re): Add all missing operators ("abs", "rem", "**").
(ada-parse-prj-file): Use find-file-noselect instead of find-file
to open the project file, since the latter does not work with
speedbar Get default values before loading the prj file, or the
default executable file name is wrong. Use the absolute value of
src_dir to initialize ada-search-directories and
compilation-search-path,... Add the standard runtime library to
the search path for find-file.
(ada-prj-default-debugger): Was missing an opening '{'
(ada-prj-default-bind-opt, ada-prj-default-link-opt): New
variables.
(ada-prj-default-gnatmake-opt): New variable
(ada-prj-find-prj-file): Handles non-file buffers For non-Ada
buffers, the project file is the default one Save the windows
configuration before displaying the menu.
(ada-prj-src-dir, ada-prj-obj-dir, ada-prj-comp-opt,...): Removed
(ada-read-identifier): Fix xrefs on operators (for "mod", "and",
...) regexp-quote identifiers names to support operators +,
-,... in regexps.
(ada-remote): New function.
(ada-run-application): Erase the output buffer before starting the
run Support remote execution of the application. Use
call-process, or the arguments are incorrectly parsed
(ada-set-default-project-file): Reread the content of the active
project file, not the one from the current buffer When a project
file is set as the default project, all directories are
automatically associated with it.
(ada-set-environment): New function
(ada-treat-cmd-string): New special variable ${current}
(ada-treat-cmd-string): Revised. The substitution is now done for
any ${...} substring
(ada-xref-current): If no body was found, compiles the spec
instead. Setup ADA_{SOURCE,OBJECTS}_PATH before running the
compiler to get rid of command line length limitations.
(ada-xref-get-project-field): New function
(ada-xref-project-files): New variable
(ada-xref-runtime-library-specs-path)
(ada-xref-runtime-library-ali-path): New variables
(ada-xref-set-default-prj-values): Default run command now does a
cd to the build directory. New field: main_unit Provide a default
file name even if the current buffer has no prj file.
2000-07-24 11:13:11 +00:00
|
|
|
(cons
|
|
|
|
(concat "ADA_OBJECTS_PATH="
|
2002-04-09 18:54:20 +00:00
|
|
|
(mapconcat (lambda(x) (expand-file-name x build-dir))
|
Got rid of all byte-compiler warnings on Emacs.
Add to the menu when the file is loaded, not in ada-mode-hook.
Add -toolbar to the default ddd command Switches moved from
ada-prj-default-comp-cmd and ada-prj-default-make-cmd to
ada-prj-default-comp-opt
(ada-add-ada-menu): Remove the map and name parameters Add the Ada
Reference Manual to the menu
(ada-check-current): rewritten as a call to ada-compile-current
(ada-compile): Removed.
(ada-compile-application, ada-compile-current, ada-check-current):
Set the compilation-search-path so that compile.el automatically
finds the sources in src_dir. Automatic scrollong of the
compilation buffer. C-uC-cC-c asks for confirmation before
compiling
(ada-compile-current): New parameter, prj-field
(ada-complete-identifier): Load the .ali file before doing
processing
(ada-find-ali-file-in-dir): prepend build_dir to obj_dir to
conform to gnatmake's behavior.
(ada-find-file-in-dir): New function
(ada-find-references): Set the environment variables for gnatfind
(ada-find-src-file-in-dir): New function.
(ada-first-non-nil): Removed
(ada-gdb-application): Add support for jdb, the java debugger.
(ada-get-ada-file-name): Load the original-file first if not done
yet.
(ada-get-all-references): Handles the new ali syntax (parent types
are found between <>).
(ada-initialize-runtime-library): New function
(ada-mode-hook): Always load a project file when a file is opened,
so that the casing exceptions are correctly read.
(ada-operator-re): Add all missing operators ("abs", "rem", "**").
(ada-parse-prj-file): Use find-file-noselect instead of find-file
to open the project file, since the latter does not work with
speedbar Get default values before loading the prj file, or the
default executable file name is wrong. Use the absolute value of
src_dir to initialize ada-search-directories and
compilation-search-path,... Add the standard runtime library to
the search path for find-file.
(ada-prj-default-debugger): Was missing an opening '{'
(ada-prj-default-bind-opt, ada-prj-default-link-opt): New
variables.
(ada-prj-default-gnatmake-opt): New variable
(ada-prj-find-prj-file): Handles non-file buffers For non-Ada
buffers, the project file is the default one Save the windows
configuration before displaying the menu.
(ada-prj-src-dir, ada-prj-obj-dir, ada-prj-comp-opt,...): Removed
(ada-read-identifier): Fix xrefs on operators (for "mod", "and",
...) regexp-quote identifiers names to support operators +,
-,... in regexps.
(ada-remote): New function.
(ada-run-application): Erase the output buffer before starting the
run Support remote execution of the application. Use
call-process, or the arguments are incorrectly parsed
(ada-set-default-project-file): Reread the content of the active
project file, not the one from the current buffer When a project
file is set as the default project, all directories are
automatically associated with it.
(ada-set-environment): New function
(ada-treat-cmd-string): New special variable ${current}
(ada-treat-cmd-string): Revised. The substitution is now done for
any ${...} substring
(ada-xref-current): If no body was found, compiles the spec
instead. Setup ADA_{SOURCE,OBJECTS}_PATH before running the
compiler to get rid of command line length limitations.
(ada-xref-get-project-field): New function
(ada-xref-project-files): New variable
(ada-xref-runtime-library-specs-path)
(ada-xref-runtime-library-ali-path): New variables
(ada-xref-set-default-prj-values): Default run command now does a
cd to the build directory. New field: main_unit Provide a default
file name even if the current buffer has no prj file.
2000-07-24 11:13:11 +00:00
|
|
|
(ada-xref-get-project-field 'obj_dir)
|
2002-04-09 18:54:20 +00:00
|
|
|
path-separator)
|
|
|
|
objects)
|
Got rid of all byte-compiler warnings on Emacs.
Add to the menu when the file is loaded, not in ada-mode-hook.
Add -toolbar to the default ddd command Switches moved from
ada-prj-default-comp-cmd and ada-prj-default-make-cmd to
ada-prj-default-comp-opt
(ada-add-ada-menu): Remove the map and name parameters Add the Ada
Reference Manual to the menu
(ada-check-current): rewritten as a call to ada-compile-current
(ada-compile): Removed.
(ada-compile-application, ada-compile-current, ada-check-current):
Set the compilation-search-path so that compile.el automatically
finds the sources in src_dir. Automatic scrollong of the
compilation buffer. C-uC-cC-c asks for confirmation before
compiling
(ada-compile-current): New parameter, prj-field
(ada-complete-identifier): Load the .ali file before doing
processing
(ada-find-ali-file-in-dir): prepend build_dir to obj_dir to
conform to gnatmake's behavior.
(ada-find-file-in-dir): New function
(ada-find-references): Set the environment variables for gnatfind
(ada-find-src-file-in-dir): New function.
(ada-first-non-nil): Removed
(ada-gdb-application): Add support for jdb, the java debugger.
(ada-get-ada-file-name): Load the original-file first if not done
yet.
(ada-get-all-references): Handles the new ali syntax (parent types
are found between <>).
(ada-initialize-runtime-library): New function
(ada-mode-hook): Always load a project file when a file is opened,
so that the casing exceptions are correctly read.
(ada-operator-re): Add all missing operators ("abs", "rem", "**").
(ada-parse-prj-file): Use find-file-noselect instead of find-file
to open the project file, since the latter does not work with
speedbar Get default values before loading the prj file, or the
default executable file name is wrong. Use the absolute value of
src_dir to initialize ada-search-directories and
compilation-search-path,... Add the standard runtime library to
the search path for find-file.
(ada-prj-default-debugger): Was missing an opening '{'
(ada-prj-default-bind-opt, ada-prj-default-link-opt): New
variables.
(ada-prj-default-gnatmake-opt): New variable
(ada-prj-find-prj-file): Handles non-file buffers For non-Ada
buffers, the project file is the default one Save the windows
configuration before displaying the menu.
(ada-prj-src-dir, ada-prj-obj-dir, ada-prj-comp-opt,...): Removed
(ada-read-identifier): Fix xrefs on operators (for "mod", "and",
...) regexp-quote identifiers names to support operators +,
-,... in regexps.
(ada-remote): New function.
(ada-run-application): Erase the output buffer before starting the
run Support remote execution of the application. Use
call-process, or the arguments are incorrectly parsed
(ada-set-default-project-file): Reread the content of the active
project file, not the one from the current buffer When a project
file is set as the default project, all directories are
automatically associated with it.
(ada-set-environment): New function
(ada-treat-cmd-string): New special variable ${current}
(ada-treat-cmd-string): Revised. The substitution is now done for
any ${...} substring
(ada-xref-current): If no body was found, compiles the spec
instead. Setup ADA_{SOURCE,OBJECTS}_PATH before running the
compiler to get rid of command line length limitations.
(ada-xref-get-project-field): New function
(ada-xref-project-files): New variable
(ada-xref-runtime-library-specs-path)
(ada-xref-runtime-library-ali-path): New variables
(ada-xref-set-default-prj-values): Default run command now does a
cd to the build directory. New field: main_unit Provide a default
file name even if the current buffer has no prj file.
2000-07-24 11:13:11 +00:00
|
|
|
process-environment))))
|
|
|
|
|
|
|
|
(defun ada-compile-application (&optional arg)
|
2004-08-22 17:14:02 +00:00
|
|
|
"Compile the application, using the command found in the project file.
|
Got rid of all byte-compiler warnings on Emacs.
Add to the menu when the file is loaded, not in ada-mode-hook.
Add -toolbar to the default ddd command Switches moved from
ada-prj-default-comp-cmd and ada-prj-default-make-cmd to
ada-prj-default-comp-opt
(ada-add-ada-menu): Remove the map and name parameters Add the Ada
Reference Manual to the menu
(ada-check-current): rewritten as a call to ada-compile-current
(ada-compile): Removed.
(ada-compile-application, ada-compile-current, ada-check-current):
Set the compilation-search-path so that compile.el automatically
finds the sources in src_dir. Automatic scrollong of the
compilation buffer. C-uC-cC-c asks for confirmation before
compiling
(ada-compile-current): New parameter, prj-field
(ada-complete-identifier): Load the .ali file before doing
processing
(ada-find-ali-file-in-dir): prepend build_dir to obj_dir to
conform to gnatmake's behavior.
(ada-find-file-in-dir): New function
(ada-find-references): Set the environment variables for gnatfind
(ada-find-src-file-in-dir): New function.
(ada-first-non-nil): Removed
(ada-gdb-application): Add support for jdb, the java debugger.
(ada-get-ada-file-name): Load the original-file first if not done
yet.
(ada-get-all-references): Handles the new ali syntax (parent types
are found between <>).
(ada-initialize-runtime-library): New function
(ada-mode-hook): Always load a project file when a file is opened,
so that the casing exceptions are correctly read.
(ada-operator-re): Add all missing operators ("abs", "rem", "**").
(ada-parse-prj-file): Use find-file-noselect instead of find-file
to open the project file, since the latter does not work with
speedbar Get default values before loading the prj file, or the
default executable file name is wrong. Use the absolute value of
src_dir to initialize ada-search-directories and
compilation-search-path,... Add the standard runtime library to
the search path for find-file.
(ada-prj-default-debugger): Was missing an opening '{'
(ada-prj-default-bind-opt, ada-prj-default-link-opt): New
variables.
(ada-prj-default-gnatmake-opt): New variable
(ada-prj-find-prj-file): Handles non-file buffers For non-Ada
buffers, the project file is the default one Save the windows
configuration before displaying the menu.
(ada-prj-src-dir, ada-prj-obj-dir, ada-prj-comp-opt,...): Removed
(ada-read-identifier): Fix xrefs on operators (for "mod", "and",
...) regexp-quote identifiers names to support operators +,
-,... in regexps.
(ada-remote): New function.
(ada-run-application): Erase the output buffer before starting the
run Support remote execution of the application. Use
call-process, or the arguments are incorrectly parsed
(ada-set-default-project-file): Reread the content of the active
project file, not the one from the current buffer When a project
file is set as the default project, all directories are
automatically associated with it.
(ada-set-environment): New function
(ada-treat-cmd-string): New special variable ${current}
(ada-treat-cmd-string): Revised. The substitution is now done for
any ${...} substring
(ada-xref-current): If no body was found, compiles the spec
instead. Setup ADA_{SOURCE,OBJECTS}_PATH before running the
compiler to get rid of command line length limitations.
(ada-xref-get-project-field): New function
(ada-xref-project-files): New variable
(ada-xref-runtime-library-specs-path)
(ada-xref-runtime-library-ali-path): New variables
(ada-xref-set-default-prj-values): Default run command now does a
cd to the build directory. New field: main_unit Provide a default
file name even if the current buffer has no prj file.
2000-07-24 11:13:11 +00:00
|
|
|
If ARG is not nil, ask for user confirmation."
|
|
|
|
(interactive "P")
|
1999-10-07 14:25:59 +00:00
|
|
|
(ada-require-project-file)
|
Got rid of all byte-compiler warnings on Emacs.
Add to the menu when the file is loaded, not in ada-mode-hook.
Add -toolbar to the default ddd command Switches moved from
ada-prj-default-comp-cmd and ada-prj-default-make-cmd to
ada-prj-default-comp-opt
(ada-add-ada-menu): Remove the map and name parameters Add the Ada
Reference Manual to the menu
(ada-check-current): rewritten as a call to ada-compile-current
(ada-compile): Removed.
(ada-compile-application, ada-compile-current, ada-check-current):
Set the compilation-search-path so that compile.el automatically
finds the sources in src_dir. Automatic scrollong of the
compilation buffer. C-uC-cC-c asks for confirmation before
compiling
(ada-compile-current): New parameter, prj-field
(ada-complete-identifier): Load the .ali file before doing
processing
(ada-find-ali-file-in-dir): prepend build_dir to obj_dir to
conform to gnatmake's behavior.
(ada-find-file-in-dir): New function
(ada-find-references): Set the environment variables for gnatfind
(ada-find-src-file-in-dir): New function.
(ada-first-non-nil): Removed
(ada-gdb-application): Add support for jdb, the java debugger.
(ada-get-ada-file-name): Load the original-file first if not done
yet.
(ada-get-all-references): Handles the new ali syntax (parent types
are found between <>).
(ada-initialize-runtime-library): New function
(ada-mode-hook): Always load a project file when a file is opened,
so that the casing exceptions are correctly read.
(ada-operator-re): Add all missing operators ("abs", "rem", "**").
(ada-parse-prj-file): Use find-file-noselect instead of find-file
to open the project file, since the latter does not work with
speedbar Get default values before loading the prj file, or the
default executable file name is wrong. Use the absolute value of
src_dir to initialize ada-search-directories and
compilation-search-path,... Add the standard runtime library to
the search path for find-file.
(ada-prj-default-debugger): Was missing an opening '{'
(ada-prj-default-bind-opt, ada-prj-default-link-opt): New
variables.
(ada-prj-default-gnatmake-opt): New variable
(ada-prj-find-prj-file): Handles non-file buffers For non-Ada
buffers, the project file is the default one Save the windows
configuration before displaying the menu.
(ada-prj-src-dir, ada-prj-obj-dir, ada-prj-comp-opt,...): Removed
(ada-read-identifier): Fix xrefs on operators (for "mod", "and",
...) regexp-quote identifiers names to support operators +,
-,... in regexps.
(ada-remote): New function.
(ada-run-application): Erase the output buffer before starting the
run Support remote execution of the application. Use
call-process, or the arguments are incorrectly parsed
(ada-set-default-project-file): Reread the content of the active
project file, not the one from the current buffer When a project
file is set as the default project, all directories are
automatically associated with it.
(ada-set-environment): New function
(ada-treat-cmd-string): New special variable ${current}
(ada-treat-cmd-string): Revised. The substitution is now done for
any ${...} substring
(ada-xref-current): If no body was found, compiles the spec
instead. Setup ADA_{SOURCE,OBJECTS}_PATH before running the
compiler to get rid of command line length limitations.
(ada-xref-get-project-field): New function
(ada-xref-project-files): New variable
(ada-xref-runtime-library-specs-path)
(ada-xref-runtime-library-ali-path): New variables
(ada-xref-set-default-prj-values): Default run command now does a
cd to the build directory. New field: main_unit Provide a default
file name even if the current buffer has no prj file.
2000-07-24 11:13:11 +00:00
|
|
|
(let ((cmd (ada-xref-get-project-field 'make_cmd))
|
|
|
|
(process-environment (ada-set-environment))
|
|
|
|
(compilation-scroll-output t))
|
|
|
|
|
2002-04-09 18:54:20 +00:00
|
|
|
(setq compilation-search-path (ada-xref-get-src-dir-field))
|
Got rid of all byte-compiler warnings on Emacs.
Add to the menu when the file is loaded, not in ada-mode-hook.
Add -toolbar to the default ddd command Switches moved from
ada-prj-default-comp-cmd and ada-prj-default-make-cmd to
ada-prj-default-comp-opt
(ada-add-ada-menu): Remove the map and name parameters Add the Ada
Reference Manual to the menu
(ada-check-current): rewritten as a call to ada-compile-current
(ada-compile): Removed.
(ada-compile-application, ada-compile-current, ada-check-current):
Set the compilation-search-path so that compile.el automatically
finds the sources in src_dir. Automatic scrollong of the
compilation buffer. C-uC-cC-c asks for confirmation before
compiling
(ada-compile-current): New parameter, prj-field
(ada-complete-identifier): Load the .ali file before doing
processing
(ada-find-ali-file-in-dir): prepend build_dir to obj_dir to
conform to gnatmake's behavior.
(ada-find-file-in-dir): New function
(ada-find-references): Set the environment variables for gnatfind
(ada-find-src-file-in-dir): New function.
(ada-first-non-nil): Removed
(ada-gdb-application): Add support for jdb, the java debugger.
(ada-get-ada-file-name): Load the original-file first if not done
yet.
(ada-get-all-references): Handles the new ali syntax (parent types
are found between <>).
(ada-initialize-runtime-library): New function
(ada-mode-hook): Always load a project file when a file is opened,
so that the casing exceptions are correctly read.
(ada-operator-re): Add all missing operators ("abs", "rem", "**").
(ada-parse-prj-file): Use find-file-noselect instead of find-file
to open the project file, since the latter does not work with
speedbar Get default values before loading the prj file, or the
default executable file name is wrong. Use the absolute value of
src_dir to initialize ada-search-directories and
compilation-search-path,... Add the standard runtime library to
the search path for find-file.
(ada-prj-default-debugger): Was missing an opening '{'
(ada-prj-default-bind-opt, ada-prj-default-link-opt): New
variables.
(ada-prj-default-gnatmake-opt): New variable
(ada-prj-find-prj-file): Handles non-file buffers For non-Ada
buffers, the project file is the default one Save the windows
configuration before displaying the menu.
(ada-prj-src-dir, ada-prj-obj-dir, ada-prj-comp-opt,...): Removed
(ada-read-identifier): Fix xrefs on operators (for "mod", "and",
...) regexp-quote identifiers names to support operators +,
-,... in regexps.
(ada-remote): New function.
(ada-run-application): Erase the output buffer before starting the
run Support remote execution of the application. Use
call-process, or the arguments are incorrectly parsed
(ada-set-default-project-file): Reread the content of the active
project file, not the one from the current buffer When a project
file is set as the default project, all directories are
automatically associated with it.
(ada-set-environment): New function
(ada-treat-cmd-string): New special variable ${current}
(ada-treat-cmd-string): Revised. The substitution is now done for
any ${...} substring
(ada-xref-current): If no body was found, compiles the spec
instead. Setup ADA_{SOURCE,OBJECTS}_PATH before running the
compiler to get rid of command line length limitations.
(ada-xref-get-project-field): New function
(ada-xref-project-files): New variable
(ada-xref-runtime-library-specs-path)
(ada-xref-runtime-library-ali-path): New variables
(ada-xref-set-default-prj-values): Default run command now does a
cd to the build directory. New field: main_unit Provide a default
file name even if the current buffer has no prj file.
2000-07-24 11:13:11 +00:00
|
|
|
|
|
|
|
;; If no project file was found, ask the user
|
|
|
|
(unless cmd
|
2002-04-09 18:54:20 +00:00
|
|
|
(setq cmd '("") arg t))
|
Got rid of all byte-compiler warnings on Emacs.
Add to the menu when the file is loaded, not in ada-mode-hook.
Add -toolbar to the default ddd command Switches moved from
ada-prj-default-comp-cmd and ada-prj-default-make-cmd to
ada-prj-default-comp-opt
(ada-add-ada-menu): Remove the map and name parameters Add the Ada
Reference Manual to the menu
(ada-check-current): rewritten as a call to ada-compile-current
(ada-compile): Removed.
(ada-compile-application, ada-compile-current, ada-check-current):
Set the compilation-search-path so that compile.el automatically
finds the sources in src_dir. Automatic scrollong of the
compilation buffer. C-uC-cC-c asks for confirmation before
compiling
(ada-compile-current): New parameter, prj-field
(ada-complete-identifier): Load the .ali file before doing
processing
(ada-find-ali-file-in-dir): prepend build_dir to obj_dir to
conform to gnatmake's behavior.
(ada-find-file-in-dir): New function
(ada-find-references): Set the environment variables for gnatfind
(ada-find-src-file-in-dir): New function.
(ada-first-non-nil): Removed
(ada-gdb-application): Add support for jdb, the java debugger.
(ada-get-ada-file-name): Load the original-file first if not done
yet.
(ada-get-all-references): Handles the new ali syntax (parent types
are found between <>).
(ada-initialize-runtime-library): New function
(ada-mode-hook): Always load a project file when a file is opened,
so that the casing exceptions are correctly read.
(ada-operator-re): Add all missing operators ("abs", "rem", "**").
(ada-parse-prj-file): Use find-file-noselect instead of find-file
to open the project file, since the latter does not work with
speedbar Get default values before loading the prj file, or the
default executable file name is wrong. Use the absolute value of
src_dir to initialize ada-search-directories and
compilation-search-path,... Add the standard runtime library to
the search path for find-file.
(ada-prj-default-debugger): Was missing an opening '{'
(ada-prj-default-bind-opt, ada-prj-default-link-opt): New
variables.
(ada-prj-default-gnatmake-opt): New variable
(ada-prj-find-prj-file): Handles non-file buffers For non-Ada
buffers, the project file is the default one Save the windows
configuration before displaying the menu.
(ada-prj-src-dir, ada-prj-obj-dir, ada-prj-comp-opt,...): Removed
(ada-read-identifier): Fix xrefs on operators (for "mod", "and",
...) regexp-quote identifiers names to support operators +,
-,... in regexps.
(ada-remote): New function.
(ada-run-application): Erase the output buffer before starting the
run Support remote execution of the application. Use
call-process, or the arguments are incorrectly parsed
(ada-set-default-project-file): Reread the content of the active
project file, not the one from the current buffer When a project
file is set as the default project, all directories are
automatically associated with it.
(ada-set-environment): New function
(ada-treat-cmd-string): New special variable ${current}
(ada-treat-cmd-string): Revised. The substitution is now done for
any ${...} substring
(ada-xref-current): If no body was found, compiles the spec
instead. Setup ADA_{SOURCE,OBJECTS}_PATH before running the
compiler to get rid of command line length limitations.
(ada-xref-get-project-field): New function
(ada-xref-project-files): New variable
(ada-xref-runtime-library-specs-path)
(ada-xref-runtime-library-ali-path): New variables
(ada-xref-set-default-prj-values): Default run command now does a
cd to the build directory. New field: main_unit Provide a default
file name even if the current buffer has no prj file.
2000-07-24 11:13:11 +00:00
|
|
|
|
2002-04-09 18:54:20 +00:00
|
|
|
;; Make a single command from the list of commands, including the
|
|
|
|
;; commands to run it on a remote machine.
|
|
|
|
(setq cmd (ada-remote (mapconcat 'identity cmd ada-command-separator)))
|
2003-02-04 13:24:35 +00:00
|
|
|
|
2002-04-09 18:54:20 +00:00
|
|
|
(if (or ada-xref-confirm-compile arg)
|
|
|
|
(setq cmd (read-from-minibuffer "enter command to compile: " cmd)))
|
|
|
|
|
|
|
|
;; Insert newlines so as to separate the name of the commands to run
|
2004-08-22 17:14:02 +00:00
|
|
|
;; and the output of the commands. This doesn't work with cmdproxy.exe,
|
2002-04-09 18:54:20 +00:00
|
|
|
;; which gets confused by newline characters.
|
2003-04-29 23:40:08 +00:00
|
|
|
(if (not (string-match ".exe" shell-file-name))
|
2002-04-09 18:54:20 +00:00
|
|
|
(setq cmd (concat cmd "\n\n")))
|
2003-02-04 13:24:35 +00:00
|
|
|
|
2002-04-09 18:54:20 +00:00
|
|
|
(compile (ada-quote-cmd cmd))))
|
1999-10-07 14:25:59 +00:00
|
|
|
|
Got rid of all byte-compiler warnings on Emacs.
Add to the menu when the file is loaded, not in ada-mode-hook.
Add -toolbar to the default ddd command Switches moved from
ada-prj-default-comp-cmd and ada-prj-default-make-cmd to
ada-prj-default-comp-opt
(ada-add-ada-menu): Remove the map and name parameters Add the Ada
Reference Manual to the menu
(ada-check-current): rewritten as a call to ada-compile-current
(ada-compile): Removed.
(ada-compile-application, ada-compile-current, ada-check-current):
Set the compilation-search-path so that compile.el automatically
finds the sources in src_dir. Automatic scrollong of the
compilation buffer. C-uC-cC-c asks for confirmation before
compiling
(ada-compile-current): New parameter, prj-field
(ada-complete-identifier): Load the .ali file before doing
processing
(ada-find-ali-file-in-dir): prepend build_dir to obj_dir to
conform to gnatmake's behavior.
(ada-find-file-in-dir): New function
(ada-find-references): Set the environment variables for gnatfind
(ada-find-src-file-in-dir): New function.
(ada-first-non-nil): Removed
(ada-gdb-application): Add support for jdb, the java debugger.
(ada-get-ada-file-name): Load the original-file first if not done
yet.
(ada-get-all-references): Handles the new ali syntax (parent types
are found between <>).
(ada-initialize-runtime-library): New function
(ada-mode-hook): Always load a project file when a file is opened,
so that the casing exceptions are correctly read.
(ada-operator-re): Add all missing operators ("abs", "rem", "**").
(ada-parse-prj-file): Use find-file-noselect instead of find-file
to open the project file, since the latter does not work with
speedbar Get default values before loading the prj file, or the
default executable file name is wrong. Use the absolute value of
src_dir to initialize ada-search-directories and
compilation-search-path,... Add the standard runtime library to
the search path for find-file.
(ada-prj-default-debugger): Was missing an opening '{'
(ada-prj-default-bind-opt, ada-prj-default-link-opt): New
variables.
(ada-prj-default-gnatmake-opt): New variable
(ada-prj-find-prj-file): Handles non-file buffers For non-Ada
buffers, the project file is the default one Save the windows
configuration before displaying the menu.
(ada-prj-src-dir, ada-prj-obj-dir, ada-prj-comp-opt,...): Removed
(ada-read-identifier): Fix xrefs on operators (for "mod", "and",
...) regexp-quote identifiers names to support operators +,
-,... in regexps.
(ada-remote): New function.
(ada-run-application): Erase the output buffer before starting the
run Support remote execution of the application. Use
call-process, or the arguments are incorrectly parsed
(ada-set-default-project-file): Reread the content of the active
project file, not the one from the current buffer When a project
file is set as the default project, all directories are
automatically associated with it.
(ada-set-environment): New function
(ada-treat-cmd-string): New special variable ${current}
(ada-treat-cmd-string): Revised. The substitution is now done for
any ${...} substring
(ada-xref-current): If no body was found, compiles the spec
instead. Setup ADA_{SOURCE,OBJECTS}_PATH before running the
compiler to get rid of command line length limitations.
(ada-xref-get-project-field): New function
(ada-xref-project-files): New variable
(ada-xref-runtime-library-specs-path)
(ada-xref-runtime-library-ali-path): New variables
(ada-xref-set-default-prj-values): Default run command now does a
cd to the build directory. New field: main_unit Provide a default
file name even if the current buffer has no prj file.
2000-07-24 11:13:11 +00:00
|
|
|
(defun ada-compile-current (&optional arg prj-field)
|
|
|
|
"Recompile the current file.
|
|
|
|
If ARG is not nil, ask for user confirmation of the command.
|
|
|
|
PRJ-FIELD is the name of the field to use in the project file to get the
|
|
|
|
command, and should be either comp_cmd (default) or check_cmd."
|
|
|
|
(interactive "P")
|
1999-10-07 14:25:59 +00:00
|
|
|
(ada-require-project-file)
|
Got rid of all byte-compiler warnings on Emacs.
Add to the menu when the file is loaded, not in ada-mode-hook.
Add -toolbar to the default ddd command Switches moved from
ada-prj-default-comp-cmd and ada-prj-default-make-cmd to
ada-prj-default-comp-opt
(ada-add-ada-menu): Remove the map and name parameters Add the Ada
Reference Manual to the menu
(ada-check-current): rewritten as a call to ada-compile-current
(ada-compile): Removed.
(ada-compile-application, ada-compile-current, ada-check-current):
Set the compilation-search-path so that compile.el automatically
finds the sources in src_dir. Automatic scrollong of the
compilation buffer. C-uC-cC-c asks for confirmation before
compiling
(ada-compile-current): New parameter, prj-field
(ada-complete-identifier): Load the .ali file before doing
processing
(ada-find-ali-file-in-dir): prepend build_dir to obj_dir to
conform to gnatmake's behavior.
(ada-find-file-in-dir): New function
(ada-find-references): Set the environment variables for gnatfind
(ada-find-src-file-in-dir): New function.
(ada-first-non-nil): Removed
(ada-gdb-application): Add support for jdb, the java debugger.
(ada-get-ada-file-name): Load the original-file first if not done
yet.
(ada-get-all-references): Handles the new ali syntax (parent types
are found between <>).
(ada-initialize-runtime-library): New function
(ada-mode-hook): Always load a project file when a file is opened,
so that the casing exceptions are correctly read.
(ada-operator-re): Add all missing operators ("abs", "rem", "**").
(ada-parse-prj-file): Use find-file-noselect instead of find-file
to open the project file, since the latter does not work with
speedbar Get default values before loading the prj file, or the
default executable file name is wrong. Use the absolute value of
src_dir to initialize ada-search-directories and
compilation-search-path,... Add the standard runtime library to
the search path for find-file.
(ada-prj-default-debugger): Was missing an opening '{'
(ada-prj-default-bind-opt, ada-prj-default-link-opt): New
variables.
(ada-prj-default-gnatmake-opt): New variable
(ada-prj-find-prj-file): Handles non-file buffers For non-Ada
buffers, the project file is the default one Save the windows
configuration before displaying the menu.
(ada-prj-src-dir, ada-prj-obj-dir, ada-prj-comp-opt,...): Removed
(ada-read-identifier): Fix xrefs on operators (for "mod", "and",
...) regexp-quote identifiers names to support operators +,
-,... in regexps.
(ada-remote): New function.
(ada-run-application): Erase the output buffer before starting the
run Support remote execution of the application. Use
call-process, or the arguments are incorrectly parsed
(ada-set-default-project-file): Reread the content of the active
project file, not the one from the current buffer When a project
file is set as the default project, all directories are
automatically associated with it.
(ada-set-environment): New function
(ada-treat-cmd-string): New special variable ${current}
(ada-treat-cmd-string): Revised. The substitution is now done for
any ${...} substring
(ada-xref-current): If no body was found, compiles the spec
instead. Setup ADA_{SOURCE,OBJECTS}_PATH before running the
compiler to get rid of command line length limitations.
(ada-xref-get-project-field): New function
(ada-xref-project-files): New variable
(ada-xref-runtime-library-specs-path)
(ada-xref-runtime-library-ali-path): New variables
(ada-xref-set-default-prj-values): Default run command now does a
cd to the build directory. New field: main_unit Provide a default
file name even if the current buffer has no prj file.
2000-07-24 11:13:11 +00:00
|
|
|
(let* ((field (if prj-field prj-field 'comp_cmd))
|
|
|
|
(cmd (ada-xref-get-project-field field))
|
|
|
|
(process-environment (ada-set-environment))
|
|
|
|
(compilation-scroll-output t))
|
2003-02-04 13:24:35 +00:00
|
|
|
|
2002-04-09 18:54:20 +00:00
|
|
|
(setq compilation-search-path (ada-xref-get-src-dir-field))
|
Got rid of all byte-compiler warnings on Emacs.
Add to the menu when the file is loaded, not in ada-mode-hook.
Add -toolbar to the default ddd command Switches moved from
ada-prj-default-comp-cmd and ada-prj-default-make-cmd to
ada-prj-default-comp-opt
(ada-add-ada-menu): Remove the map and name parameters Add the Ada
Reference Manual to the menu
(ada-check-current): rewritten as a call to ada-compile-current
(ada-compile): Removed.
(ada-compile-application, ada-compile-current, ada-check-current):
Set the compilation-search-path so that compile.el automatically
finds the sources in src_dir. Automatic scrollong of the
compilation buffer. C-uC-cC-c asks for confirmation before
compiling
(ada-compile-current): New parameter, prj-field
(ada-complete-identifier): Load the .ali file before doing
processing
(ada-find-ali-file-in-dir): prepend build_dir to obj_dir to
conform to gnatmake's behavior.
(ada-find-file-in-dir): New function
(ada-find-references): Set the environment variables for gnatfind
(ada-find-src-file-in-dir): New function.
(ada-first-non-nil): Removed
(ada-gdb-application): Add support for jdb, the java debugger.
(ada-get-ada-file-name): Load the original-file first if not done
yet.
(ada-get-all-references): Handles the new ali syntax (parent types
are found between <>).
(ada-initialize-runtime-library): New function
(ada-mode-hook): Always load a project file when a file is opened,
so that the casing exceptions are correctly read.
(ada-operator-re): Add all missing operators ("abs", "rem", "**").
(ada-parse-prj-file): Use find-file-noselect instead of find-file
to open the project file, since the latter does not work with
speedbar Get default values before loading the prj file, or the
default executable file name is wrong. Use the absolute value of
src_dir to initialize ada-search-directories and
compilation-search-path,... Add the standard runtime library to
the search path for find-file.
(ada-prj-default-debugger): Was missing an opening '{'
(ada-prj-default-bind-opt, ada-prj-default-link-opt): New
variables.
(ada-prj-default-gnatmake-opt): New variable
(ada-prj-find-prj-file): Handles non-file buffers For non-Ada
buffers, the project file is the default one Save the windows
configuration before displaying the menu.
(ada-prj-src-dir, ada-prj-obj-dir, ada-prj-comp-opt,...): Removed
(ada-read-identifier): Fix xrefs on operators (for "mod", "and",
...) regexp-quote identifiers names to support operators +,
-,... in regexps.
(ada-remote): New function.
(ada-run-application): Erase the output buffer before starting the
run Support remote execution of the application. Use
call-process, or the arguments are incorrectly parsed
(ada-set-default-project-file): Reread the content of the active
project file, not the one from the current buffer When a project
file is set as the default project, all directories are
automatically associated with it.
(ada-set-environment): New function
(ada-treat-cmd-string): New special variable ${current}
(ada-treat-cmd-string): Revised. The substitution is now done for
any ${...} substring
(ada-xref-current): If no body was found, compiles the spec
instead. Setup ADA_{SOURCE,OBJECTS}_PATH before running the
compiler to get rid of command line length limitations.
(ada-xref-get-project-field): New function
(ada-xref-project-files): New variable
(ada-xref-runtime-library-specs-path)
(ada-xref-runtime-library-ali-path): New variables
(ada-xref-set-default-prj-values): Default run command now does a
cd to the build directory. New field: main_unit Provide a default
file name even if the current buffer has no prj file.
2000-07-24 11:13:11 +00:00
|
|
|
|
2002-04-09 18:54:20 +00:00
|
|
|
(unless cmd
|
|
|
|
(setq cmd '("") arg t))
|
2003-02-04 13:24:35 +00:00
|
|
|
|
2002-04-09 18:54:20 +00:00
|
|
|
;; Make a single command from the list of commands, including the
|
|
|
|
;; commands to run it on a remote machine.
|
|
|
|
(setq cmd (ada-remote (mapconcat 'identity cmd ada-command-separator)))
|
2003-02-04 13:24:35 +00:00
|
|
|
|
Got rid of all byte-compiler warnings on Emacs.
Add to the menu when the file is loaded, not in ada-mode-hook.
Add -toolbar to the default ddd command Switches moved from
ada-prj-default-comp-cmd and ada-prj-default-make-cmd to
ada-prj-default-comp-opt
(ada-add-ada-menu): Remove the map and name parameters Add the Ada
Reference Manual to the menu
(ada-check-current): rewritten as a call to ada-compile-current
(ada-compile): Removed.
(ada-compile-application, ada-compile-current, ada-check-current):
Set the compilation-search-path so that compile.el automatically
finds the sources in src_dir. Automatic scrollong of the
compilation buffer. C-uC-cC-c asks for confirmation before
compiling
(ada-compile-current): New parameter, prj-field
(ada-complete-identifier): Load the .ali file before doing
processing
(ada-find-ali-file-in-dir): prepend build_dir to obj_dir to
conform to gnatmake's behavior.
(ada-find-file-in-dir): New function
(ada-find-references): Set the environment variables for gnatfind
(ada-find-src-file-in-dir): New function.
(ada-first-non-nil): Removed
(ada-gdb-application): Add support for jdb, the java debugger.
(ada-get-ada-file-name): Load the original-file first if not done
yet.
(ada-get-all-references): Handles the new ali syntax (parent types
are found between <>).
(ada-initialize-runtime-library): New function
(ada-mode-hook): Always load a project file when a file is opened,
so that the casing exceptions are correctly read.
(ada-operator-re): Add all missing operators ("abs", "rem", "**").
(ada-parse-prj-file): Use find-file-noselect instead of find-file
to open the project file, since the latter does not work with
speedbar Get default values before loading the prj file, or the
default executable file name is wrong. Use the absolute value of
src_dir to initialize ada-search-directories and
compilation-search-path,... Add the standard runtime library to
the search path for find-file.
(ada-prj-default-debugger): Was missing an opening '{'
(ada-prj-default-bind-opt, ada-prj-default-link-opt): New
variables.
(ada-prj-default-gnatmake-opt): New variable
(ada-prj-find-prj-file): Handles non-file buffers For non-Ada
buffers, the project file is the default one Save the windows
configuration before displaying the menu.
(ada-prj-src-dir, ada-prj-obj-dir, ada-prj-comp-opt,...): Removed
(ada-read-identifier): Fix xrefs on operators (for "mod", "and",
...) regexp-quote identifiers names to support operators +,
-,... in regexps.
(ada-remote): New function.
(ada-run-application): Erase the output buffer before starting the
run Support remote execution of the application. Use
call-process, or the arguments are incorrectly parsed
(ada-set-default-project-file): Reread the content of the active
project file, not the one from the current buffer When a project
file is set as the default project, all directories are
automatically associated with it.
(ada-set-environment): New function
(ada-treat-cmd-string): New special variable ${current}
(ada-treat-cmd-string): Revised. The substitution is now done for
any ${...} substring
(ada-xref-current): If no body was found, compiles the spec
instead. Setup ADA_{SOURCE,OBJECTS}_PATH before running the
compiler to get rid of command line length limitations.
(ada-xref-get-project-field): New function
(ada-xref-project-files): New variable
(ada-xref-runtime-library-specs-path)
(ada-xref-runtime-library-ali-path): New variables
(ada-xref-set-default-prj-values): Default run command now does a
cd to the build directory. New field: main_unit Provide a default
file name even if the current buffer has no prj file.
2000-07-24 11:13:11 +00:00
|
|
|
;; If no project file was found, ask the user
|
2002-04-09 18:54:20 +00:00
|
|
|
(if (or ada-xref-confirm-compile arg)
|
|
|
|
(setq cmd (read-from-minibuffer "enter command to compile: " cmd)))
|
|
|
|
|
|
|
|
(compile (ada-quote-cmd cmd))))
|
Got rid of all byte-compiler warnings on Emacs.
Add to the menu when the file is loaded, not in ada-mode-hook.
Add -toolbar to the default ddd command Switches moved from
ada-prj-default-comp-cmd and ada-prj-default-make-cmd to
ada-prj-default-comp-opt
(ada-add-ada-menu): Remove the map and name parameters Add the Ada
Reference Manual to the menu
(ada-check-current): rewritten as a call to ada-compile-current
(ada-compile): Removed.
(ada-compile-application, ada-compile-current, ada-check-current):
Set the compilation-search-path so that compile.el automatically
finds the sources in src_dir. Automatic scrollong of the
compilation buffer. C-uC-cC-c asks for confirmation before
compiling
(ada-compile-current): New parameter, prj-field
(ada-complete-identifier): Load the .ali file before doing
processing
(ada-find-ali-file-in-dir): prepend build_dir to obj_dir to
conform to gnatmake's behavior.
(ada-find-file-in-dir): New function
(ada-find-references): Set the environment variables for gnatfind
(ada-find-src-file-in-dir): New function.
(ada-first-non-nil): Removed
(ada-gdb-application): Add support for jdb, the java debugger.
(ada-get-ada-file-name): Load the original-file first if not done
yet.
(ada-get-all-references): Handles the new ali syntax (parent types
are found between <>).
(ada-initialize-runtime-library): New function
(ada-mode-hook): Always load a project file when a file is opened,
so that the casing exceptions are correctly read.
(ada-operator-re): Add all missing operators ("abs", "rem", "**").
(ada-parse-prj-file): Use find-file-noselect instead of find-file
to open the project file, since the latter does not work with
speedbar Get default values before loading the prj file, or the
default executable file name is wrong. Use the absolute value of
src_dir to initialize ada-search-directories and
compilation-search-path,... Add the standard runtime library to
the search path for find-file.
(ada-prj-default-debugger): Was missing an opening '{'
(ada-prj-default-bind-opt, ada-prj-default-link-opt): New
variables.
(ada-prj-default-gnatmake-opt): New variable
(ada-prj-find-prj-file): Handles non-file buffers For non-Ada
buffers, the project file is the default one Save the windows
configuration before displaying the menu.
(ada-prj-src-dir, ada-prj-obj-dir, ada-prj-comp-opt,...): Removed
(ada-read-identifier): Fix xrefs on operators (for "mod", "and",
...) regexp-quote identifiers names to support operators +,
-,... in regexps.
(ada-remote): New function.
(ada-run-application): Erase the output buffer before starting the
run Support remote execution of the application. Use
call-process, or the arguments are incorrectly parsed
(ada-set-default-project-file): Reread the content of the active
project file, not the one from the current buffer When a project
file is set as the default project, all directories are
automatically associated with it.
(ada-set-environment): New function
(ada-treat-cmd-string): New special variable ${current}
(ada-treat-cmd-string): Revised. The substitution is now done for
any ${...} substring
(ada-xref-current): If no body was found, compiles the spec
instead. Setup ADA_{SOURCE,OBJECTS}_PATH before running the
compiler to get rid of command line length limitations.
(ada-xref-get-project-field): New function
(ada-xref-project-files): New variable
(ada-xref-runtime-library-specs-path)
(ada-xref-runtime-library-ali-path): New variables
(ada-xref-set-default-prj-values): Default run command now does a
cd to the build directory. New field: main_unit Provide a default
file name even if the current buffer has no prj file.
2000-07-24 11:13:11 +00:00
|
|
|
|
|
|
|
(defun ada-check-current (&optional arg)
|
|
|
|
"Recompile the current file.
|
|
|
|
If ARG is not nil, ask for user confirmation of the command."
|
|
|
|
(interactive "P")
|
|
|
|
(ada-compile-current arg 'check_cmd))
|
1999-10-07 14:25:59 +00:00
|
|
|
|
Got rid of all byte-compiler warnings on Emacs.
Add to the menu when the file is loaded, not in ada-mode-hook.
Add -toolbar to the default ddd command Switches moved from
ada-prj-default-comp-cmd and ada-prj-default-make-cmd to
ada-prj-default-comp-opt
(ada-add-ada-menu): Remove the map and name parameters Add the Ada
Reference Manual to the menu
(ada-check-current): rewritten as a call to ada-compile-current
(ada-compile): Removed.
(ada-compile-application, ada-compile-current, ada-check-current):
Set the compilation-search-path so that compile.el automatically
finds the sources in src_dir. Automatic scrollong of the
compilation buffer. C-uC-cC-c asks for confirmation before
compiling
(ada-compile-current): New parameter, prj-field
(ada-complete-identifier): Load the .ali file before doing
processing
(ada-find-ali-file-in-dir): prepend build_dir to obj_dir to
conform to gnatmake's behavior.
(ada-find-file-in-dir): New function
(ada-find-references): Set the environment variables for gnatfind
(ada-find-src-file-in-dir): New function.
(ada-first-non-nil): Removed
(ada-gdb-application): Add support for jdb, the java debugger.
(ada-get-ada-file-name): Load the original-file first if not done
yet.
(ada-get-all-references): Handles the new ali syntax (parent types
are found between <>).
(ada-initialize-runtime-library): New function
(ada-mode-hook): Always load a project file when a file is opened,
so that the casing exceptions are correctly read.
(ada-operator-re): Add all missing operators ("abs", "rem", "**").
(ada-parse-prj-file): Use find-file-noselect instead of find-file
to open the project file, since the latter does not work with
speedbar Get default values before loading the prj file, or the
default executable file name is wrong. Use the absolute value of
src_dir to initialize ada-search-directories and
compilation-search-path,... Add the standard runtime library to
the search path for find-file.
(ada-prj-default-debugger): Was missing an opening '{'
(ada-prj-default-bind-opt, ada-prj-default-link-opt): New
variables.
(ada-prj-default-gnatmake-opt): New variable
(ada-prj-find-prj-file): Handles non-file buffers For non-Ada
buffers, the project file is the default one Save the windows
configuration before displaying the menu.
(ada-prj-src-dir, ada-prj-obj-dir, ada-prj-comp-opt,...): Removed
(ada-read-identifier): Fix xrefs on operators (for "mod", "and",
...) regexp-quote identifiers names to support operators +,
-,... in regexps.
(ada-remote): New function.
(ada-run-application): Erase the output buffer before starting the
run Support remote execution of the application. Use
call-process, or the arguments are incorrectly parsed
(ada-set-default-project-file): Reread the content of the active
project file, not the one from the current buffer When a project
file is set as the default project, all directories are
automatically associated with it.
(ada-set-environment): New function
(ada-treat-cmd-string): New special variable ${current}
(ada-treat-cmd-string): Revised. The substitution is now done for
any ${...} substring
(ada-xref-current): If no body was found, compiles the spec
instead. Setup ADA_{SOURCE,OBJECTS}_PATH before running the
compiler to get rid of command line length limitations.
(ada-xref-get-project-field): New function
(ada-xref-project-files): New variable
(ada-xref-runtime-library-specs-path)
(ada-xref-runtime-library-ali-path): New variables
(ada-xref-set-default-prj-values): Default run command now does a
cd to the build directory. New field: main_unit Provide a default
file name even if the current buffer has no prj file.
2000-07-24 11:13:11 +00:00
|
|
|
(defun ada-run-application (&optional arg)
|
|
|
|
"Run the application.
|
2004-08-22 17:14:02 +00:00
|
|
|
if ARG is not-nil, ask for user confirmation."
|
1999-10-07 14:25:59 +00:00
|
|
|
(interactive)
|
|
|
|
(ada-require-project-file)
|
|
|
|
|
Got rid of all byte-compiler warnings on Emacs.
Add to the menu when the file is loaded, not in ada-mode-hook.
Add -toolbar to the default ddd command Switches moved from
ada-prj-default-comp-cmd and ada-prj-default-make-cmd to
ada-prj-default-comp-opt
(ada-add-ada-menu): Remove the map and name parameters Add the Ada
Reference Manual to the menu
(ada-check-current): rewritten as a call to ada-compile-current
(ada-compile): Removed.
(ada-compile-application, ada-compile-current, ada-check-current):
Set the compilation-search-path so that compile.el automatically
finds the sources in src_dir. Automatic scrollong of the
compilation buffer. C-uC-cC-c asks for confirmation before
compiling
(ada-compile-current): New parameter, prj-field
(ada-complete-identifier): Load the .ali file before doing
processing
(ada-find-ali-file-in-dir): prepend build_dir to obj_dir to
conform to gnatmake's behavior.
(ada-find-file-in-dir): New function
(ada-find-references): Set the environment variables for gnatfind
(ada-find-src-file-in-dir): New function.
(ada-first-non-nil): Removed
(ada-gdb-application): Add support for jdb, the java debugger.
(ada-get-ada-file-name): Load the original-file first if not done
yet.
(ada-get-all-references): Handles the new ali syntax (parent types
are found between <>).
(ada-initialize-runtime-library): New function
(ada-mode-hook): Always load a project file when a file is opened,
so that the casing exceptions are correctly read.
(ada-operator-re): Add all missing operators ("abs", "rem", "**").
(ada-parse-prj-file): Use find-file-noselect instead of find-file
to open the project file, since the latter does not work with
speedbar Get default values before loading the prj file, or the
default executable file name is wrong. Use the absolute value of
src_dir to initialize ada-search-directories and
compilation-search-path,... Add the standard runtime library to
the search path for find-file.
(ada-prj-default-debugger): Was missing an opening '{'
(ada-prj-default-bind-opt, ada-prj-default-link-opt): New
variables.
(ada-prj-default-gnatmake-opt): New variable
(ada-prj-find-prj-file): Handles non-file buffers For non-Ada
buffers, the project file is the default one Save the windows
configuration before displaying the menu.
(ada-prj-src-dir, ada-prj-obj-dir, ada-prj-comp-opt,...): Removed
(ada-read-identifier): Fix xrefs on operators (for "mod", "and",
...) regexp-quote identifiers names to support operators +,
-,... in regexps.
(ada-remote): New function.
(ada-run-application): Erase the output buffer before starting the
run Support remote execution of the application. Use
call-process, or the arguments are incorrectly parsed
(ada-set-default-project-file): Reread the content of the active
project file, not the one from the current buffer When a project
file is set as the default project, all directories are
automatically associated with it.
(ada-set-environment): New function
(ada-treat-cmd-string): New special variable ${current}
(ada-treat-cmd-string): Revised. The substitution is now done for
any ${...} substring
(ada-xref-current): If no body was found, compiles the spec
instead. Setup ADA_{SOURCE,OBJECTS}_PATH before running the
compiler to get rid of command line length limitations.
(ada-xref-get-project-field): New function
(ada-xref-project-files): New variable
(ada-xref-runtime-library-specs-path)
(ada-xref-runtime-library-ali-path): New variables
(ada-xref-set-default-prj-values): Default run command now does a
cd to the build directory. New field: main_unit Provide a default
file name even if the current buffer has no prj file.
2000-07-24 11:13:11 +00:00
|
|
|
(let ((machine (ada-xref-get-project-field 'cross_prefix)))
|
|
|
|
(if (and machine (not (string= machine "")))
|
|
|
|
(error "This feature is not supported yet for cross environments")))
|
1999-10-07 14:25:59 +00:00
|
|
|
|
Got rid of all byte-compiler warnings on Emacs.
Add to the menu when the file is loaded, not in ada-mode-hook.
Add -toolbar to the default ddd command Switches moved from
ada-prj-default-comp-cmd and ada-prj-default-make-cmd to
ada-prj-default-comp-opt
(ada-add-ada-menu): Remove the map and name parameters Add the Ada
Reference Manual to the menu
(ada-check-current): rewritten as a call to ada-compile-current
(ada-compile): Removed.
(ada-compile-application, ada-compile-current, ada-check-current):
Set the compilation-search-path so that compile.el automatically
finds the sources in src_dir. Automatic scrollong of the
compilation buffer. C-uC-cC-c asks for confirmation before
compiling
(ada-compile-current): New parameter, prj-field
(ada-complete-identifier): Load the .ali file before doing
processing
(ada-find-ali-file-in-dir): prepend build_dir to obj_dir to
conform to gnatmake's behavior.
(ada-find-file-in-dir): New function
(ada-find-references): Set the environment variables for gnatfind
(ada-find-src-file-in-dir): New function.
(ada-first-non-nil): Removed
(ada-gdb-application): Add support for jdb, the java debugger.
(ada-get-ada-file-name): Load the original-file first if not done
yet.
(ada-get-all-references): Handles the new ali syntax (parent types
are found between <>).
(ada-initialize-runtime-library): New function
(ada-mode-hook): Always load a project file when a file is opened,
so that the casing exceptions are correctly read.
(ada-operator-re): Add all missing operators ("abs", "rem", "**").
(ada-parse-prj-file): Use find-file-noselect instead of find-file
to open the project file, since the latter does not work with
speedbar Get default values before loading the prj file, or the
default executable file name is wrong. Use the absolute value of
src_dir to initialize ada-search-directories and
compilation-search-path,... Add the standard runtime library to
the search path for find-file.
(ada-prj-default-debugger): Was missing an opening '{'
(ada-prj-default-bind-opt, ada-prj-default-link-opt): New
variables.
(ada-prj-default-gnatmake-opt): New variable
(ada-prj-find-prj-file): Handles non-file buffers For non-Ada
buffers, the project file is the default one Save the windows
configuration before displaying the menu.
(ada-prj-src-dir, ada-prj-obj-dir, ada-prj-comp-opt,...): Removed
(ada-read-identifier): Fix xrefs on operators (for "mod", "and",
...) regexp-quote identifiers names to support operators +,
-,... in regexps.
(ada-remote): New function.
(ada-run-application): Erase the output buffer before starting the
run Support remote execution of the application. Use
call-process, or the arguments are incorrectly parsed
(ada-set-default-project-file): Reread the content of the active
project file, not the one from the current buffer When a project
file is set as the default project, all directories are
automatically associated with it.
(ada-set-environment): New function
(ada-treat-cmd-string): New special variable ${current}
(ada-treat-cmd-string): Revised. The substitution is now done for
any ${...} substring
(ada-xref-current): If no body was found, compiles the spec
instead. Setup ADA_{SOURCE,OBJECTS}_PATH before running the
compiler to get rid of command line length limitations.
(ada-xref-get-project-field): New function
(ada-xref-project-files): New variable
(ada-xref-runtime-library-specs-path)
(ada-xref-runtime-library-ali-path): New variables
(ada-xref-set-default-prj-values): Default run command now does a
cd to the build directory. New field: main_unit Provide a default
file name even if the current buffer has no prj file.
2000-07-24 11:13:11 +00:00
|
|
|
(let ((command (ada-xref-get-project-field 'run_cmd)))
|
1999-10-07 14:25:59 +00:00
|
|
|
|
Got rid of all byte-compiler warnings on Emacs.
Add to the menu when the file is loaded, not in ada-mode-hook.
Add -toolbar to the default ddd command Switches moved from
ada-prj-default-comp-cmd and ada-prj-default-make-cmd to
ada-prj-default-comp-opt
(ada-add-ada-menu): Remove the map and name parameters Add the Ada
Reference Manual to the menu
(ada-check-current): rewritten as a call to ada-compile-current
(ada-compile): Removed.
(ada-compile-application, ada-compile-current, ada-check-current):
Set the compilation-search-path so that compile.el automatically
finds the sources in src_dir. Automatic scrollong of the
compilation buffer. C-uC-cC-c asks for confirmation before
compiling
(ada-compile-current): New parameter, prj-field
(ada-complete-identifier): Load the .ali file before doing
processing
(ada-find-ali-file-in-dir): prepend build_dir to obj_dir to
conform to gnatmake's behavior.
(ada-find-file-in-dir): New function
(ada-find-references): Set the environment variables for gnatfind
(ada-find-src-file-in-dir): New function.
(ada-first-non-nil): Removed
(ada-gdb-application): Add support for jdb, the java debugger.
(ada-get-ada-file-name): Load the original-file first if not done
yet.
(ada-get-all-references): Handles the new ali syntax (parent types
are found between <>).
(ada-initialize-runtime-library): New function
(ada-mode-hook): Always load a project file when a file is opened,
so that the casing exceptions are correctly read.
(ada-operator-re): Add all missing operators ("abs", "rem", "**").
(ada-parse-prj-file): Use find-file-noselect instead of find-file
to open the project file, since the latter does not work with
speedbar Get default values before loading the prj file, or the
default executable file name is wrong. Use the absolute value of
src_dir to initialize ada-search-directories and
compilation-search-path,... Add the standard runtime library to
the search path for find-file.
(ada-prj-default-debugger): Was missing an opening '{'
(ada-prj-default-bind-opt, ada-prj-default-link-opt): New
variables.
(ada-prj-default-gnatmake-opt): New variable
(ada-prj-find-prj-file): Handles non-file buffers For non-Ada
buffers, the project file is the default one Save the windows
configuration before displaying the menu.
(ada-prj-src-dir, ada-prj-obj-dir, ada-prj-comp-opt,...): Removed
(ada-read-identifier): Fix xrefs on operators (for "mod", "and",
...) regexp-quote identifiers names to support operators +,
-,... in regexps.
(ada-remote): New function.
(ada-run-application): Erase the output buffer before starting the
run Support remote execution of the application. Use
call-process, or the arguments are incorrectly parsed
(ada-set-default-project-file): Reread the content of the active
project file, not the one from the current buffer When a project
file is set as the default project, all directories are
automatically associated with it.
(ada-set-environment): New function
(ada-treat-cmd-string): New special variable ${current}
(ada-treat-cmd-string): Revised. The substitution is now done for
any ${...} substring
(ada-xref-current): If no body was found, compiles the spec
instead. Setup ADA_{SOURCE,OBJECTS}_PATH before running the
compiler to get rid of command line length limitations.
(ada-xref-get-project-field): New function
(ada-xref-project-files): New variable
(ada-xref-runtime-library-specs-path)
(ada-xref-runtime-library-ali-path): New variables
(ada-xref-set-default-prj-values): Default run command now does a
cd to the build directory. New field: main_unit Provide a default
file name even if the current buffer has no prj file.
2000-07-24 11:13:11 +00:00
|
|
|
;; Guess the command if it wasn't specified
|
2002-04-09 18:54:20 +00:00
|
|
|
(if (not command)
|
2006-10-31 00:57:56 +00:00
|
|
|
(set 'command (list (file-name-sans-extension (buffer-name)))))
|
1999-10-07 14:25:59 +00:00
|
|
|
|
2002-04-09 18:54:20 +00:00
|
|
|
;; Modify the command to run remotely
|
|
|
|
(setq command (ada-remote (mapconcat 'identity command
|
|
|
|
ada-command-separator)))
|
2003-02-04 13:24:35 +00:00
|
|
|
|
Got rid of all byte-compiler warnings on Emacs.
Add to the menu when the file is loaded, not in ada-mode-hook.
Add -toolbar to the default ddd command Switches moved from
ada-prj-default-comp-cmd and ada-prj-default-make-cmd to
ada-prj-default-comp-opt
(ada-add-ada-menu): Remove the map and name parameters Add the Ada
Reference Manual to the menu
(ada-check-current): rewritten as a call to ada-compile-current
(ada-compile): Removed.
(ada-compile-application, ada-compile-current, ada-check-current):
Set the compilation-search-path so that compile.el automatically
finds the sources in src_dir. Automatic scrollong of the
compilation buffer. C-uC-cC-c asks for confirmation before
compiling
(ada-compile-current): New parameter, prj-field
(ada-complete-identifier): Load the .ali file before doing
processing
(ada-find-ali-file-in-dir): prepend build_dir to obj_dir to
conform to gnatmake's behavior.
(ada-find-file-in-dir): New function
(ada-find-references): Set the environment variables for gnatfind
(ada-find-src-file-in-dir): New function.
(ada-first-non-nil): Removed
(ada-gdb-application): Add support for jdb, the java debugger.
(ada-get-ada-file-name): Load the original-file first if not done
yet.
(ada-get-all-references): Handles the new ali syntax (parent types
are found between <>).
(ada-initialize-runtime-library): New function
(ada-mode-hook): Always load a project file when a file is opened,
so that the casing exceptions are correctly read.
(ada-operator-re): Add all missing operators ("abs", "rem", "**").
(ada-parse-prj-file): Use find-file-noselect instead of find-file
to open the project file, since the latter does not work with
speedbar Get default values before loading the prj file, or the
default executable file name is wrong. Use the absolute value of
src_dir to initialize ada-search-directories and
compilation-search-path,... Add the standard runtime library to
the search path for find-file.
(ada-prj-default-debugger): Was missing an opening '{'
(ada-prj-default-bind-opt, ada-prj-default-link-opt): New
variables.
(ada-prj-default-gnatmake-opt): New variable
(ada-prj-find-prj-file): Handles non-file buffers For non-Ada
buffers, the project file is the default one Save the windows
configuration before displaying the menu.
(ada-prj-src-dir, ada-prj-obj-dir, ada-prj-comp-opt,...): Removed
(ada-read-identifier): Fix xrefs on operators (for "mod", "and",
...) regexp-quote identifiers names to support operators +,
-,... in regexps.
(ada-remote): New function.
(ada-run-application): Erase the output buffer before starting the
run Support remote execution of the application. Use
call-process, or the arguments are incorrectly parsed
(ada-set-default-project-file): Reread the content of the active
project file, not the one from the current buffer When a project
file is set as the default project, all directories are
automatically associated with it.
(ada-set-environment): New function
(ada-treat-cmd-string): New special variable ${current}
(ada-treat-cmd-string): Revised. The substitution is now done for
any ${...} substring
(ada-xref-current): If no body was found, compiles the spec
instead. Setup ADA_{SOURCE,OBJECTS}_PATH before running the
compiler to get rid of command line length limitations.
(ada-xref-get-project-field): New function
(ada-xref-project-files): New variable
(ada-xref-runtime-library-specs-path)
(ada-xref-runtime-library-ali-path): New variables
(ada-xref-set-default-prj-values): Default run command now does a
cd to the build directory. New field: main_unit Provide a default
file name even if the current buffer has no prj file.
2000-07-24 11:13:11 +00:00
|
|
|
;; Ask for the arguments to the command if required
|
|
|
|
(if (or ada-xref-confirm-compile arg)
|
2002-04-09 18:54:20 +00:00
|
|
|
(setq command (read-from-minibuffer "Enter command to execute: "
|
|
|
|
command)))
|
1999-10-07 14:25:59 +00:00
|
|
|
|
|
|
|
;; Run the command
|
|
|
|
(save-excursion
|
|
|
|
(set-buffer (get-buffer-create "*run*"))
|
Got rid of all byte-compiler warnings on Emacs.
Add to the menu when the file is loaded, not in ada-mode-hook.
Add -toolbar to the default ddd command Switches moved from
ada-prj-default-comp-cmd and ada-prj-default-make-cmd to
ada-prj-default-comp-opt
(ada-add-ada-menu): Remove the map and name parameters Add the Ada
Reference Manual to the menu
(ada-check-current): rewritten as a call to ada-compile-current
(ada-compile): Removed.
(ada-compile-application, ada-compile-current, ada-check-current):
Set the compilation-search-path so that compile.el automatically
finds the sources in src_dir. Automatic scrollong of the
compilation buffer. C-uC-cC-c asks for confirmation before
compiling
(ada-compile-current): New parameter, prj-field
(ada-complete-identifier): Load the .ali file before doing
processing
(ada-find-ali-file-in-dir): prepend build_dir to obj_dir to
conform to gnatmake's behavior.
(ada-find-file-in-dir): New function
(ada-find-references): Set the environment variables for gnatfind
(ada-find-src-file-in-dir): New function.
(ada-first-non-nil): Removed
(ada-gdb-application): Add support for jdb, the java debugger.
(ada-get-ada-file-name): Load the original-file first if not done
yet.
(ada-get-all-references): Handles the new ali syntax (parent types
are found between <>).
(ada-initialize-runtime-library): New function
(ada-mode-hook): Always load a project file when a file is opened,
so that the casing exceptions are correctly read.
(ada-operator-re): Add all missing operators ("abs", "rem", "**").
(ada-parse-prj-file): Use find-file-noselect instead of find-file
to open the project file, since the latter does not work with
speedbar Get default values before loading the prj file, or the
default executable file name is wrong. Use the absolute value of
src_dir to initialize ada-search-directories and
compilation-search-path,... Add the standard runtime library to
the search path for find-file.
(ada-prj-default-debugger): Was missing an opening '{'
(ada-prj-default-bind-opt, ada-prj-default-link-opt): New
variables.
(ada-prj-default-gnatmake-opt): New variable
(ada-prj-find-prj-file): Handles non-file buffers For non-Ada
buffers, the project file is the default one Save the windows
configuration before displaying the menu.
(ada-prj-src-dir, ada-prj-obj-dir, ada-prj-comp-opt,...): Removed
(ada-read-identifier): Fix xrefs on operators (for "mod", "and",
...) regexp-quote identifiers names to support operators +,
-,... in regexps.
(ada-remote): New function.
(ada-run-application): Erase the output buffer before starting the
run Support remote execution of the application. Use
call-process, or the arguments are incorrectly parsed
(ada-set-default-project-file): Reread the content of the active
project file, not the one from the current buffer When a project
file is set as the default project, all directories are
automatically associated with it.
(ada-set-environment): New function
(ada-treat-cmd-string): New special variable ${current}
(ada-treat-cmd-string): Revised. The substitution is now done for
any ${...} substring
(ada-xref-current): If no body was found, compiles the spec
instead. Setup ADA_{SOURCE,OBJECTS}_PATH before running the
compiler to get rid of command line length limitations.
(ada-xref-get-project-field): New function
(ada-xref-project-files): New variable
(ada-xref-runtime-library-specs-path)
(ada-xref-runtime-library-ali-path): New variables
(ada-xref-set-default-prj-values): Default run command now does a
cd to the build directory. New field: main_unit Provide a default
file name even if the current buffer has no prj file.
2000-07-24 11:13:11 +00:00
|
|
|
(set 'buffer-read-only nil)
|
2002-04-09 18:54:20 +00:00
|
|
|
|
Got rid of all byte-compiler warnings on Emacs.
Add to the menu when the file is loaded, not in ada-mode-hook.
Add -toolbar to the default ddd command Switches moved from
ada-prj-default-comp-cmd and ada-prj-default-make-cmd to
ada-prj-default-comp-opt
(ada-add-ada-menu): Remove the map and name parameters Add the Ada
Reference Manual to the menu
(ada-check-current): rewritten as a call to ada-compile-current
(ada-compile): Removed.
(ada-compile-application, ada-compile-current, ada-check-current):
Set the compilation-search-path so that compile.el automatically
finds the sources in src_dir. Automatic scrollong of the
compilation buffer. C-uC-cC-c asks for confirmation before
compiling
(ada-compile-current): New parameter, prj-field
(ada-complete-identifier): Load the .ali file before doing
processing
(ada-find-ali-file-in-dir): prepend build_dir to obj_dir to
conform to gnatmake's behavior.
(ada-find-file-in-dir): New function
(ada-find-references): Set the environment variables for gnatfind
(ada-find-src-file-in-dir): New function.
(ada-first-non-nil): Removed
(ada-gdb-application): Add support for jdb, the java debugger.
(ada-get-ada-file-name): Load the original-file first if not done
yet.
(ada-get-all-references): Handles the new ali syntax (parent types
are found between <>).
(ada-initialize-runtime-library): New function
(ada-mode-hook): Always load a project file when a file is opened,
so that the casing exceptions are correctly read.
(ada-operator-re): Add all missing operators ("abs", "rem", "**").
(ada-parse-prj-file): Use find-file-noselect instead of find-file
to open the project file, since the latter does not work with
speedbar Get default values before loading the prj file, or the
default executable file name is wrong. Use the absolute value of
src_dir to initialize ada-search-directories and
compilation-search-path,... Add the standard runtime library to
the search path for find-file.
(ada-prj-default-debugger): Was missing an opening '{'
(ada-prj-default-bind-opt, ada-prj-default-link-opt): New
variables.
(ada-prj-default-gnatmake-opt): New variable
(ada-prj-find-prj-file): Handles non-file buffers For non-Ada
buffers, the project file is the default one Save the windows
configuration before displaying the menu.
(ada-prj-src-dir, ada-prj-obj-dir, ada-prj-comp-opt,...): Removed
(ada-read-identifier): Fix xrefs on operators (for "mod", "and",
...) regexp-quote identifiers names to support operators +,
-,... in regexps.
(ada-remote): New function.
(ada-run-application): Erase the output buffer before starting the
run Support remote execution of the application. Use
call-process, or the arguments are incorrectly parsed
(ada-set-default-project-file): Reread the content of the active
project file, not the one from the current buffer When a project
file is set as the default project, all directories are
automatically associated with it.
(ada-set-environment): New function
(ada-treat-cmd-string): New special variable ${current}
(ada-treat-cmd-string): Revised. The substitution is now done for
any ${...} substring
(ada-xref-current): If no body was found, compiles the spec
instead. Setup ADA_{SOURCE,OBJECTS}_PATH before running the
compiler to get rid of command line length limitations.
(ada-xref-get-project-field): New function
(ada-xref-project-files): New variable
(ada-xref-runtime-library-specs-path)
(ada-xref-runtime-library-ali-path): New variables
(ada-xref-set-default-prj-values): Default run command now does a
cd to the build directory. New field: main_unit Provide a default
file name even if the current buffer has no prj file.
2000-07-24 11:13:11 +00:00
|
|
|
(erase-buffer)
|
2002-04-09 18:54:20 +00:00
|
|
|
(start-process "run" (current-buffer) shell-file-name
|
|
|
|
"-c" command)
|
|
|
|
(comint-mode)
|
|
|
|
;; Set these two variables to their default values, since otherwise
|
|
|
|
;; the output buffer is scrolled so that only the last output line
|
|
|
|
;; is visible at the top of the buffer.
|
|
|
|
(set (make-local-variable 'scroll-step) 0)
|
|
|
|
(set (make-local-variable 'scroll-conservatively) 0)
|
1999-10-07 14:25:59 +00:00
|
|
|
)
|
|
|
|
(display-buffer "*run*")
|
|
|
|
|
|
|
|
;; change to buffer *run* for interactive programs
|
|
|
|
(other-window 1)
|
|
|
|
(switch-to-buffer "*run*")
|
Got rid of all byte-compiler warnings on Emacs.
Add to the menu when the file is loaded, not in ada-mode-hook.
Add -toolbar to the default ddd command Switches moved from
ada-prj-default-comp-cmd and ada-prj-default-make-cmd to
ada-prj-default-comp-opt
(ada-add-ada-menu): Remove the map and name parameters Add the Ada
Reference Manual to the menu
(ada-check-current): rewritten as a call to ada-compile-current
(ada-compile): Removed.
(ada-compile-application, ada-compile-current, ada-check-current):
Set the compilation-search-path so that compile.el automatically
finds the sources in src_dir. Automatic scrollong of the
compilation buffer. C-uC-cC-c asks for confirmation before
compiling
(ada-compile-current): New parameter, prj-field
(ada-complete-identifier): Load the .ali file before doing
processing
(ada-find-ali-file-in-dir): prepend build_dir to obj_dir to
conform to gnatmake's behavior.
(ada-find-file-in-dir): New function
(ada-find-references): Set the environment variables for gnatfind
(ada-find-src-file-in-dir): New function.
(ada-first-non-nil): Removed
(ada-gdb-application): Add support for jdb, the java debugger.
(ada-get-ada-file-name): Load the original-file first if not done
yet.
(ada-get-all-references): Handles the new ali syntax (parent types
are found between <>).
(ada-initialize-runtime-library): New function
(ada-mode-hook): Always load a project file when a file is opened,
so that the casing exceptions are correctly read.
(ada-operator-re): Add all missing operators ("abs", "rem", "**").
(ada-parse-prj-file): Use find-file-noselect instead of find-file
to open the project file, since the latter does not work with
speedbar Get default values before loading the prj file, or the
default executable file name is wrong. Use the absolute value of
src_dir to initialize ada-search-directories and
compilation-search-path,... Add the standard runtime library to
the search path for find-file.
(ada-prj-default-debugger): Was missing an opening '{'
(ada-prj-default-bind-opt, ada-prj-default-link-opt): New
variables.
(ada-prj-default-gnatmake-opt): New variable
(ada-prj-find-prj-file): Handles non-file buffers For non-Ada
buffers, the project file is the default one Save the windows
configuration before displaying the menu.
(ada-prj-src-dir, ada-prj-obj-dir, ada-prj-comp-opt,...): Removed
(ada-read-identifier): Fix xrefs on operators (for "mod", "and",
...) regexp-quote identifiers names to support operators +,
-,... in regexps.
(ada-remote): New function.
(ada-run-application): Erase the output buffer before starting the
run Support remote execution of the application. Use
call-process, or the arguments are incorrectly parsed
(ada-set-default-project-file): Reread the content of the active
project file, not the one from the current buffer When a project
file is set as the default project, all directories are
automatically associated with it.
(ada-set-environment): New function
(ada-treat-cmd-string): New special variable ${current}
(ada-treat-cmd-string): Revised. The substitution is now done for
any ${...} substring
(ada-xref-current): If no body was found, compiles the spec
instead. Setup ADA_{SOURCE,OBJECTS}_PATH before running the
compiler to get rid of command line length limitations.
(ada-xref-get-project-field): New function
(ada-xref-project-files): New variable
(ada-xref-runtime-library-specs-path)
(ada-xref-runtime-library-ali-path): New variables
(ada-xref-set-default-prj-values): Default run command now does a
cd to the build directory. New field: main_unit Provide a default
file name even if the current buffer has no prj file.
2000-07-24 11:13:11 +00:00
|
|
|
))
|
1999-10-07 14:25:59 +00:00
|
|
|
|
2002-04-09 18:54:20 +00:00
|
|
|
(defun ada-gdb-application (&optional arg executable-name)
|
Got rid of all byte-compiler warnings on Emacs.
Add to the menu when the file is loaded, not in ada-mode-hook.
Add -toolbar to the default ddd command Switches moved from
ada-prj-default-comp-cmd and ada-prj-default-make-cmd to
ada-prj-default-comp-opt
(ada-add-ada-menu): Remove the map and name parameters Add the Ada
Reference Manual to the menu
(ada-check-current): rewritten as a call to ada-compile-current
(ada-compile): Removed.
(ada-compile-application, ada-compile-current, ada-check-current):
Set the compilation-search-path so that compile.el automatically
finds the sources in src_dir. Automatic scrollong of the
compilation buffer. C-uC-cC-c asks for confirmation before
compiling
(ada-compile-current): New parameter, prj-field
(ada-complete-identifier): Load the .ali file before doing
processing
(ada-find-ali-file-in-dir): prepend build_dir to obj_dir to
conform to gnatmake's behavior.
(ada-find-file-in-dir): New function
(ada-find-references): Set the environment variables for gnatfind
(ada-find-src-file-in-dir): New function.
(ada-first-non-nil): Removed
(ada-gdb-application): Add support for jdb, the java debugger.
(ada-get-ada-file-name): Load the original-file first if not done
yet.
(ada-get-all-references): Handles the new ali syntax (parent types
are found between <>).
(ada-initialize-runtime-library): New function
(ada-mode-hook): Always load a project file when a file is opened,
so that the casing exceptions are correctly read.
(ada-operator-re): Add all missing operators ("abs", "rem", "**").
(ada-parse-prj-file): Use find-file-noselect instead of find-file
to open the project file, since the latter does not work with
speedbar Get default values before loading the prj file, or the
default executable file name is wrong. Use the absolute value of
src_dir to initialize ada-search-directories and
compilation-search-path,... Add the standard runtime library to
the search path for find-file.
(ada-prj-default-debugger): Was missing an opening '{'
(ada-prj-default-bind-opt, ada-prj-default-link-opt): New
variables.
(ada-prj-default-gnatmake-opt): New variable
(ada-prj-find-prj-file): Handles non-file buffers For non-Ada
buffers, the project file is the default one Save the windows
configuration before displaying the menu.
(ada-prj-src-dir, ada-prj-obj-dir, ada-prj-comp-opt,...): Removed
(ada-read-identifier): Fix xrefs on operators (for "mod", "and",
...) regexp-quote identifiers names to support operators +,
-,... in regexps.
(ada-remote): New function.
(ada-run-application): Erase the output buffer before starting the
run Support remote execution of the application. Use
call-process, or the arguments are incorrectly parsed
(ada-set-default-project-file): Reread the content of the active
project file, not the one from the current buffer When a project
file is set as the default project, all directories are
automatically associated with it.
(ada-set-environment): New function
(ada-treat-cmd-string): New special variable ${current}
(ada-treat-cmd-string): Revised. The substitution is now done for
any ${...} substring
(ada-xref-current): If no body was found, compiles the spec
instead. Setup ADA_{SOURCE,OBJECTS}_PATH before running the
compiler to get rid of command line length limitations.
(ada-xref-get-project-field): New function
(ada-xref-project-files): New variable
(ada-xref-runtime-library-specs-path)
(ada-xref-runtime-library-ali-path): New variables
(ada-xref-set-default-prj-values): Default run command now does a
cd to the build directory. New field: main_unit Provide a default
file name even if the current buffer has no prj file.
2000-07-24 11:13:11 +00:00
|
|
|
"Start the debugger on the application.
|
2006-10-31 00:57:56 +00:00
|
|
|
If ARG is non-nil, ask the user to confirm the command.
|
2002-04-09 18:54:20 +00:00
|
|
|
EXECUTABLE-NAME, if non-nil, is debugged instead of the file specified in the
|
2006-10-31 00:57:56 +00:00
|
|
|
project file."
|
Got rid of all byte-compiler warnings on Emacs.
Add to the menu when the file is loaded, not in ada-mode-hook.
Add -toolbar to the default ddd command Switches moved from
ada-prj-default-comp-cmd and ada-prj-default-make-cmd to
ada-prj-default-comp-opt
(ada-add-ada-menu): Remove the map and name parameters Add the Ada
Reference Manual to the menu
(ada-check-current): rewritten as a call to ada-compile-current
(ada-compile): Removed.
(ada-compile-application, ada-compile-current, ada-check-current):
Set the compilation-search-path so that compile.el automatically
finds the sources in src_dir. Automatic scrollong of the
compilation buffer. C-uC-cC-c asks for confirmation before
compiling
(ada-compile-current): New parameter, prj-field
(ada-complete-identifier): Load the .ali file before doing
processing
(ada-find-ali-file-in-dir): prepend build_dir to obj_dir to
conform to gnatmake's behavior.
(ada-find-file-in-dir): New function
(ada-find-references): Set the environment variables for gnatfind
(ada-find-src-file-in-dir): New function.
(ada-first-non-nil): Removed
(ada-gdb-application): Add support for jdb, the java debugger.
(ada-get-ada-file-name): Load the original-file first if not done
yet.
(ada-get-all-references): Handles the new ali syntax (parent types
are found between <>).
(ada-initialize-runtime-library): New function
(ada-mode-hook): Always load a project file when a file is opened,
so that the casing exceptions are correctly read.
(ada-operator-re): Add all missing operators ("abs", "rem", "**").
(ada-parse-prj-file): Use find-file-noselect instead of find-file
to open the project file, since the latter does not work with
speedbar Get default values before loading the prj file, or the
default executable file name is wrong. Use the absolute value of
src_dir to initialize ada-search-directories and
compilation-search-path,... Add the standard runtime library to
the search path for find-file.
(ada-prj-default-debugger): Was missing an opening '{'
(ada-prj-default-bind-opt, ada-prj-default-link-opt): New
variables.
(ada-prj-default-gnatmake-opt): New variable
(ada-prj-find-prj-file): Handles non-file buffers For non-Ada
buffers, the project file is the default one Save the windows
configuration before displaying the menu.
(ada-prj-src-dir, ada-prj-obj-dir, ada-prj-comp-opt,...): Removed
(ada-read-identifier): Fix xrefs on operators (for "mod", "and",
...) regexp-quote identifiers names to support operators +,
-,... in regexps.
(ada-remote): New function.
(ada-run-application): Erase the output buffer before starting the
run Support remote execution of the application. Use
call-process, or the arguments are incorrectly parsed
(ada-set-default-project-file): Reread the content of the active
project file, not the one from the current buffer When a project
file is set as the default project, all directories are
automatically associated with it.
(ada-set-environment): New function
(ada-treat-cmd-string): New special variable ${current}
(ada-treat-cmd-string): Revised. The substitution is now done for
any ${...} substring
(ada-xref-current): If no body was found, compiles the spec
instead. Setup ADA_{SOURCE,OBJECTS}_PATH before running the
compiler to get rid of command line length limitations.
(ada-xref-get-project-field): New function
(ada-xref-project-files): New variable
(ada-xref-runtime-library-specs-path)
(ada-xref-runtime-library-ali-path): New variables
(ada-xref-set-default-prj-values): Default run command now does a
cd to the build directory. New field: main_unit Provide a default
file name even if the current buffer has no prj file.
2000-07-24 11:13:11 +00:00
|
|
|
(interactive "P")
|
1999-10-07 14:25:59 +00:00
|
|
|
(let ((buffer (current-buffer))
|
2002-04-09 18:54:20 +00:00
|
|
|
cmd pre-cmd post-cmd)
|
1999-10-07 14:25:59 +00:00
|
|
|
(ada-require-project-file)
|
2002-04-09 18:54:20 +00:00
|
|
|
(setq cmd (if executable-name
|
|
|
|
(concat ada-prj-default-debugger " " executable-name)
|
|
|
|
(ada-xref-get-project-field 'debug_cmd))
|
|
|
|
pre-cmd (ada-xref-get-project-field 'debug_pre_cmd)
|
|
|
|
post-cmd (ada-xref-get-project-field 'debug_post_cmd))
|
Got rid of all byte-compiler warnings on Emacs.
Add to the menu when the file is loaded, not in ada-mode-hook.
Add -toolbar to the default ddd command Switches moved from
ada-prj-default-comp-cmd and ada-prj-default-make-cmd to
ada-prj-default-comp-opt
(ada-add-ada-menu): Remove the map and name parameters Add the Ada
Reference Manual to the menu
(ada-check-current): rewritten as a call to ada-compile-current
(ada-compile): Removed.
(ada-compile-application, ada-compile-current, ada-check-current):
Set the compilation-search-path so that compile.el automatically
finds the sources in src_dir. Automatic scrollong of the
compilation buffer. C-uC-cC-c asks for confirmation before
compiling
(ada-compile-current): New parameter, prj-field
(ada-complete-identifier): Load the .ali file before doing
processing
(ada-find-ali-file-in-dir): prepend build_dir to obj_dir to
conform to gnatmake's behavior.
(ada-find-file-in-dir): New function
(ada-find-references): Set the environment variables for gnatfind
(ada-find-src-file-in-dir): New function.
(ada-first-non-nil): Removed
(ada-gdb-application): Add support for jdb, the java debugger.
(ada-get-ada-file-name): Load the original-file first if not done
yet.
(ada-get-all-references): Handles the new ali syntax (parent types
are found between <>).
(ada-initialize-runtime-library): New function
(ada-mode-hook): Always load a project file when a file is opened,
so that the casing exceptions are correctly read.
(ada-operator-re): Add all missing operators ("abs", "rem", "**").
(ada-parse-prj-file): Use find-file-noselect instead of find-file
to open the project file, since the latter does not work with
speedbar Get default values before loading the prj file, or the
default executable file name is wrong. Use the absolute value of
src_dir to initialize ada-search-directories and
compilation-search-path,... Add the standard runtime library to
the search path for find-file.
(ada-prj-default-debugger): Was missing an opening '{'
(ada-prj-default-bind-opt, ada-prj-default-link-opt): New
variables.
(ada-prj-default-gnatmake-opt): New variable
(ada-prj-find-prj-file): Handles non-file buffers For non-Ada
buffers, the project file is the default one Save the windows
configuration before displaying the menu.
(ada-prj-src-dir, ada-prj-obj-dir, ada-prj-comp-opt,...): Removed
(ada-read-identifier): Fix xrefs on operators (for "mod", "and",
...) regexp-quote identifiers names to support operators +,
-,... in regexps.
(ada-remote): New function.
(ada-run-application): Erase the output buffer before starting the
run Support remote execution of the application. Use
call-process, or the arguments are incorrectly parsed
(ada-set-default-project-file): Reread the content of the active
project file, not the one from the current buffer When a project
file is set as the default project, all directories are
automatically associated with it.
(ada-set-environment): New function
(ada-treat-cmd-string): New special variable ${current}
(ada-treat-cmd-string): Revised. The substitution is now done for
any ${...} substring
(ada-xref-current): If no body was found, compiles the spec
instead. Setup ADA_{SOURCE,OBJECTS}_PATH before running the
compiler to get rid of command line length limitations.
(ada-xref-get-project-field): New function
(ada-xref-project-files): New variable
(ada-xref-runtime-library-specs-path)
(ada-xref-runtime-library-ali-path): New variables
(ada-xref-set-default-prj-values): Default run command now does a
cd to the build directory. New field: main_unit Provide a default
file name even if the current buffer has no prj file.
2000-07-24 11:13:11 +00:00
|
|
|
|
|
|
|
;; If the command was not given in the project file, start a bare gdb
|
|
|
|
(if (not cmd)
|
|
|
|
(set 'cmd (concat ada-prj-default-debugger
|
|
|
|
" "
|
2002-04-09 18:54:20 +00:00
|
|
|
(or executable-name
|
|
|
|
(file-name-sans-extension (buffer-file-name))))))
|
|
|
|
|
|
|
|
;; For gvd, add an extra switch so that the Emacs window is completly
|
|
|
|
;; swallowed inside the Gvd one
|
|
|
|
(if (and ada-tight-gvd-integration
|
|
|
|
(string-match "^[^ \t]*gvd" cmd))
|
|
|
|
;; Start a new frame, so that when gvd exists we do not kill Emacs
|
|
|
|
;; We make sure that gvd swallows the new frame, not the one the
|
|
|
|
;; user has been using until now
|
|
|
|
;; The frame is made invisible initially, so that GtkPlug gets a
|
2004-08-22 17:14:02 +00:00
|
|
|
;; chance to fully manage it. Then it works fine with Enlightenment
|
2002-04-09 18:54:20 +00:00
|
|
|
;; as well
|
|
|
|
(let ((frame (make-frame '((visibility . nil)))))
|
|
|
|
(set 'cmd (concat
|
|
|
|
cmd " --editor-window="
|
|
|
|
(cdr (assoc 'outer-window-id (frame-parameters frame)))))
|
|
|
|
(select-frame frame)))
|
|
|
|
|
|
|
|
;; Add a -fullname switch
|
|
|
|
;; Use the remote machine
|
|
|
|
(set 'cmd (ada-remote (concat cmd " -fullname ")))
|
|
|
|
|
|
|
|
;; Ask for confirmation if required
|
Got rid of all byte-compiler warnings on Emacs.
Add to the menu when the file is loaded, not in ada-mode-hook.
Add -toolbar to the default ddd command Switches moved from
ada-prj-default-comp-cmd and ada-prj-default-make-cmd to
ada-prj-default-comp-opt
(ada-add-ada-menu): Remove the map and name parameters Add the Ada
Reference Manual to the menu
(ada-check-current): rewritten as a call to ada-compile-current
(ada-compile): Removed.
(ada-compile-application, ada-compile-current, ada-check-current):
Set the compilation-search-path so that compile.el automatically
finds the sources in src_dir. Automatic scrollong of the
compilation buffer. C-uC-cC-c asks for confirmation before
compiling
(ada-compile-current): New parameter, prj-field
(ada-complete-identifier): Load the .ali file before doing
processing
(ada-find-ali-file-in-dir): prepend build_dir to obj_dir to
conform to gnatmake's behavior.
(ada-find-file-in-dir): New function
(ada-find-references): Set the environment variables for gnatfind
(ada-find-src-file-in-dir): New function.
(ada-first-non-nil): Removed
(ada-gdb-application): Add support for jdb, the java debugger.
(ada-get-ada-file-name): Load the original-file first if not done
yet.
(ada-get-all-references): Handles the new ali syntax (parent types
are found between <>).
(ada-initialize-runtime-library): New function
(ada-mode-hook): Always load a project file when a file is opened,
so that the casing exceptions are correctly read.
(ada-operator-re): Add all missing operators ("abs", "rem", "**").
(ada-parse-prj-file): Use find-file-noselect instead of find-file
to open the project file, since the latter does not work with
speedbar Get default values before loading the prj file, or the
default executable file name is wrong. Use the absolute value of
src_dir to initialize ada-search-directories and
compilation-search-path,... Add the standard runtime library to
the search path for find-file.
(ada-prj-default-debugger): Was missing an opening '{'
(ada-prj-default-bind-opt, ada-prj-default-link-opt): New
variables.
(ada-prj-default-gnatmake-opt): New variable
(ada-prj-find-prj-file): Handles non-file buffers For non-Ada
buffers, the project file is the default one Save the windows
configuration before displaying the menu.
(ada-prj-src-dir, ada-prj-obj-dir, ada-prj-comp-opt,...): Removed
(ada-read-identifier): Fix xrefs on operators (for "mod", "and",
...) regexp-quote identifiers names to support operators +,
-,... in regexps.
(ada-remote): New function.
(ada-run-application): Erase the output buffer before starting the
run Support remote execution of the application. Use
call-process, or the arguments are incorrectly parsed
(ada-set-default-project-file): Reread the content of the active
project file, not the one from the current buffer When a project
file is set as the default project, all directories are
automatically associated with it.
(ada-set-environment): New function
(ada-treat-cmd-string): New special variable ${current}
(ada-treat-cmd-string): Revised. The substitution is now done for
any ${...} substring
(ada-xref-current): If no body was found, compiles the spec
instead. Setup ADA_{SOURCE,OBJECTS}_PATH before running the
compiler to get rid of command line length limitations.
(ada-xref-get-project-field): New function
(ada-xref-project-files): New variable
(ada-xref-runtime-library-specs-path)
(ada-xref-runtime-library-ali-path): New variables
(ada-xref-set-default-prj-values): Default run command now does a
cd to the build directory. New field: main_unit Provide a default
file name even if the current buffer has no prj file.
2000-07-24 11:13:11 +00:00
|
|
|
(if (or arg ada-xref-confirm-compile)
|
|
|
|
(set 'cmd (read-from-minibuffer "enter command to debug: " cmd)))
|
|
|
|
|
2003-05-13 21:15:44 +00:00
|
|
|
(let ((old-comint-exec (symbol-function 'comint-exec)))
|
2002-04-09 18:54:20 +00:00
|
|
|
|
|
|
|
;; Do not add -fullname, since we can have a 'rsh' command in front.
|
2003-05-13 21:15:44 +00:00
|
|
|
;; FIXME: This is evil but luckily a nop under Emacs-21.3.50 ! -stef
|
2002-04-09 18:54:20 +00:00
|
|
|
(fset 'gud-gdb-massage-args (lambda (file args) args))
|
|
|
|
|
|
|
|
(set 'pre-cmd (mapconcat 'identity pre-cmd ada-command-separator))
|
|
|
|
(if (not (equal pre-cmd ""))
|
|
|
|
(setq pre-cmd (concat pre-cmd ada-command-separator)))
|
|
|
|
|
|
|
|
(set 'post-cmd (mapconcat 'identity post-cmd "\n"))
|
|
|
|
(if post-cmd
|
2003-05-13 21:15:44 +00:00
|
|
|
(set 'post-cmd (concat post-cmd "\n")))
|
2002-04-09 18:54:20 +00:00
|
|
|
|
2003-04-29 23:40:08 +00:00
|
|
|
|
2002-04-09 18:54:20 +00:00
|
|
|
;; Temporarily replaces the definition of `comint-exec' so that we
|
|
|
|
;; can execute commands before running gdb.
|
2003-05-13 21:15:44 +00:00
|
|
|
;; FIXME: This is evil and not temporary !!! -stef
|
2003-02-04 13:24:35 +00:00
|
|
|
(fset 'comint-exec
|
2002-04-09 18:54:20 +00:00
|
|
|
`(lambda (buffer name command startfile switches)
|
|
|
|
(let (compilation-buffer-name-function)
|
|
|
|
(save-excursion
|
|
|
|
(set 'compilation-buffer-name-function
|
|
|
|
(lambda(x) (buffer-name buffer)))
|
|
|
|
(compile (ada-quote-cmd
|
|
|
|
(concat ,pre-cmd
|
|
|
|
command " "
|
|
|
|
(mapconcat 'identity switches " "))))))
|
|
|
|
))
|
|
|
|
|
|
|
|
;; Tight integration should force the tty mode
|
|
|
|
(if (and (string-match "gvd" (comint-arguments cmd 0 0))
|
|
|
|
ada-tight-gvd-integration
|
|
|
|
(not (string-match "--tty" cmd)))
|
|
|
|
(setq cmd (concat cmd "--tty")))
|
2003-02-04 13:24:35 +00:00
|
|
|
|
2002-04-09 18:54:20 +00:00
|
|
|
(if (and (string-match "jdb" (comint-arguments cmd 0 0))
|
|
|
|
(boundp 'jdb))
|
|
|
|
(funcall (symbol-function 'jdb) cmd)
|
|
|
|
(gdb cmd))
|
|
|
|
|
2003-04-29 23:40:08 +00:00
|
|
|
;; Restore the standard fset command (or for instance C-U M-x shell
|
|
|
|
;; wouldn't work anymore
|
|
|
|
|
|
|
|
(fset 'comint-exec old-comint-exec)
|
|
|
|
|
2002-04-09 18:54:20 +00:00
|
|
|
;; Send post-commands to the debugger
|
|
|
|
(process-send-string (get-buffer-process (current-buffer)) post-cmd)
|
|
|
|
|
|
|
|
;; Move to the end of the debugger buffer, so that it is automatically
|
|
|
|
;; scrolled from then on.
|
2004-11-07 03:58:37 +00:00
|
|
|
(goto-char (point-max))
|
2002-04-09 18:54:20 +00:00
|
|
|
|
|
|
|
;; Display both the source window and the debugger window (the former
|
2004-08-22 17:14:02 +00:00
|
|
|
;; above the latter). No need to show the debugger window unless it
|
2002-04-09 18:54:20 +00:00
|
|
|
;; is going to have some relevant information.
|
|
|
|
(if (or (not (string-match "gvd" (comint-arguments cmd 0 0)))
|
|
|
|
(string-match "--tty" cmd))
|
|
|
|
(split-window-vertically))
|
|
|
|
(switch-to-buffer buffer)
|
|
|
|
)))
|
1999-10-07 14:25:59 +00:00
|
|
|
|
Got rid of all byte-compiler warnings on Emacs.
Add to the menu when the file is loaded, not in ada-mode-hook.
Add -toolbar to the default ddd command Switches moved from
ada-prj-default-comp-cmd and ada-prj-default-make-cmd to
ada-prj-default-comp-opt
(ada-add-ada-menu): Remove the map and name parameters Add the Ada
Reference Manual to the menu
(ada-check-current): rewritten as a call to ada-compile-current
(ada-compile): Removed.
(ada-compile-application, ada-compile-current, ada-check-current):
Set the compilation-search-path so that compile.el automatically
finds the sources in src_dir. Automatic scrollong of the
compilation buffer. C-uC-cC-c asks for confirmation before
compiling
(ada-compile-current): New parameter, prj-field
(ada-complete-identifier): Load the .ali file before doing
processing
(ada-find-ali-file-in-dir): prepend build_dir to obj_dir to
conform to gnatmake's behavior.
(ada-find-file-in-dir): New function
(ada-find-references): Set the environment variables for gnatfind
(ada-find-src-file-in-dir): New function.
(ada-first-non-nil): Removed
(ada-gdb-application): Add support for jdb, the java debugger.
(ada-get-ada-file-name): Load the original-file first if not done
yet.
(ada-get-all-references): Handles the new ali syntax (parent types
are found between <>).
(ada-initialize-runtime-library): New function
(ada-mode-hook): Always load a project file when a file is opened,
so that the casing exceptions are correctly read.
(ada-operator-re): Add all missing operators ("abs", "rem", "**").
(ada-parse-prj-file): Use find-file-noselect instead of find-file
to open the project file, since the latter does not work with
speedbar Get default values before loading the prj file, or the
default executable file name is wrong. Use the absolute value of
src_dir to initialize ada-search-directories and
compilation-search-path,... Add the standard runtime library to
the search path for find-file.
(ada-prj-default-debugger): Was missing an opening '{'
(ada-prj-default-bind-opt, ada-prj-default-link-opt): New
variables.
(ada-prj-default-gnatmake-opt): New variable
(ada-prj-find-prj-file): Handles non-file buffers For non-Ada
buffers, the project file is the default one Save the windows
configuration before displaying the menu.
(ada-prj-src-dir, ada-prj-obj-dir, ada-prj-comp-opt,...): Removed
(ada-read-identifier): Fix xrefs on operators (for "mod", "and",
...) regexp-quote identifiers names to support operators +,
-,... in regexps.
(ada-remote): New function.
(ada-run-application): Erase the output buffer before starting the
run Support remote execution of the application. Use
call-process, or the arguments are incorrectly parsed
(ada-set-default-project-file): Reread the content of the active
project file, not the one from the current buffer When a project
file is set as the default project, all directories are
automatically associated with it.
(ada-set-environment): New function
(ada-treat-cmd-string): New special variable ${current}
(ada-treat-cmd-string): Revised. The substitution is now done for
any ${...} substring
(ada-xref-current): If no body was found, compiles the spec
instead. Setup ADA_{SOURCE,OBJECTS}_PATH before running the
compiler to get rid of command line length limitations.
(ada-xref-get-project-field): New function
(ada-xref-project-files): New variable
(ada-xref-runtime-library-specs-path)
(ada-xref-runtime-library-ali-path): New variables
(ada-xref-set-default-prj-values): Default run command now does a
cd to the build directory. New field: main_unit Provide a default
file name even if the current buffer has no prj file.
2000-07-24 11:13:11 +00:00
|
|
|
(defun ada-reread-prj-file (&optional filename)
|
2006-10-31 00:57:56 +00:00
|
|
|
"Reread either the current project, or FILENAME if non-nil."
|
1999-10-07 14:25:59 +00:00
|
|
|
(interactive "P")
|
Got rid of all byte-compiler warnings on Emacs.
Add to the menu when the file is loaded, not in ada-mode-hook.
Add -toolbar to the default ddd command Switches moved from
ada-prj-default-comp-cmd and ada-prj-default-make-cmd to
ada-prj-default-comp-opt
(ada-add-ada-menu): Remove the map and name parameters Add the Ada
Reference Manual to the menu
(ada-check-current): rewritten as a call to ada-compile-current
(ada-compile): Removed.
(ada-compile-application, ada-compile-current, ada-check-current):
Set the compilation-search-path so that compile.el automatically
finds the sources in src_dir. Automatic scrollong of the
compilation buffer. C-uC-cC-c asks for confirmation before
compiling
(ada-compile-current): New parameter, prj-field
(ada-complete-identifier): Load the .ali file before doing
processing
(ada-find-ali-file-in-dir): prepend build_dir to obj_dir to
conform to gnatmake's behavior.
(ada-find-file-in-dir): New function
(ada-find-references): Set the environment variables for gnatfind
(ada-find-src-file-in-dir): New function.
(ada-first-non-nil): Removed
(ada-gdb-application): Add support for jdb, the java debugger.
(ada-get-ada-file-name): Load the original-file first if not done
yet.
(ada-get-all-references): Handles the new ali syntax (parent types
are found between <>).
(ada-initialize-runtime-library): New function
(ada-mode-hook): Always load a project file when a file is opened,
so that the casing exceptions are correctly read.
(ada-operator-re): Add all missing operators ("abs", "rem", "**").
(ada-parse-prj-file): Use find-file-noselect instead of find-file
to open the project file, since the latter does not work with
speedbar Get default values before loading the prj file, or the
default executable file name is wrong. Use the absolute value of
src_dir to initialize ada-search-directories and
compilation-search-path,... Add the standard runtime library to
the search path for find-file.
(ada-prj-default-debugger): Was missing an opening '{'
(ada-prj-default-bind-opt, ada-prj-default-link-opt): New
variables.
(ada-prj-default-gnatmake-opt): New variable
(ada-prj-find-prj-file): Handles non-file buffers For non-Ada
buffers, the project file is the default one Save the windows
configuration before displaying the menu.
(ada-prj-src-dir, ada-prj-obj-dir, ada-prj-comp-opt,...): Removed
(ada-read-identifier): Fix xrefs on operators (for "mod", "and",
...) regexp-quote identifiers names to support operators +,
-,... in regexps.
(ada-remote): New function.
(ada-run-application): Erase the output buffer before starting the
run Support remote execution of the application. Use
call-process, or the arguments are incorrectly parsed
(ada-set-default-project-file): Reread the content of the active
project file, not the one from the current buffer When a project
file is set as the default project, all directories are
automatically associated with it.
(ada-set-environment): New function
(ada-treat-cmd-string): New special variable ${current}
(ada-treat-cmd-string): Revised. The substitution is now done for
any ${...} substring
(ada-xref-current): If no body was found, compiles the spec
instead. Setup ADA_{SOURCE,OBJECTS}_PATH before running the
compiler to get rid of command line length limitations.
(ada-xref-get-project-field): New function
(ada-xref-project-files): New variable
(ada-xref-runtime-library-specs-path)
(ada-xref-runtime-library-ali-path): New variables
(ada-xref-set-default-prj-values): Default run command now does a
cd to the build directory. New field: main_unit Provide a default
file name even if the current buffer has no prj file.
2000-07-24 11:13:11 +00:00
|
|
|
(if filename
|
|
|
|
(ada-parse-prj-file filename)
|
1999-10-07 14:25:59 +00:00
|
|
|
(ada-parse-prj-file (ada-prj-find-prj-file)))
|
|
|
|
|
2002-04-09 18:54:20 +00:00
|
|
|
;; Reread the location of the standard runtime library
|
|
|
|
(ada-initialize-runtime-library
|
2003-04-29 23:40:08 +00:00
|
|
|
(or (ada-xref-get-project-field 'cross_prefix) ""))
|
2002-04-09 18:54:20 +00:00
|
|
|
)
|
Got rid of all byte-compiler warnings on Emacs.
Add to the menu when the file is loaded, not in ada-mode-hook.
Add -toolbar to the default ddd command Switches moved from
ada-prj-default-comp-cmd and ada-prj-default-make-cmd to
ada-prj-default-comp-opt
(ada-add-ada-menu): Remove the map and name parameters Add the Ada
Reference Manual to the menu
(ada-check-current): rewritten as a call to ada-compile-current
(ada-compile): Removed.
(ada-compile-application, ada-compile-current, ada-check-current):
Set the compilation-search-path so that compile.el automatically
finds the sources in src_dir. Automatic scrollong of the
compilation buffer. C-uC-cC-c asks for confirmation before
compiling
(ada-compile-current): New parameter, prj-field
(ada-complete-identifier): Load the .ali file before doing
processing
(ada-find-ali-file-in-dir): prepend build_dir to obj_dir to
conform to gnatmake's behavior.
(ada-find-file-in-dir): New function
(ada-find-references): Set the environment variables for gnatfind
(ada-find-src-file-in-dir): New function.
(ada-first-non-nil): Removed
(ada-gdb-application): Add support for jdb, the java debugger.
(ada-get-ada-file-name): Load the original-file first if not done
yet.
(ada-get-all-references): Handles the new ali syntax (parent types
are found between <>).
(ada-initialize-runtime-library): New function
(ada-mode-hook): Always load a project file when a file is opened,
so that the casing exceptions are correctly read.
(ada-operator-re): Add all missing operators ("abs", "rem", "**").
(ada-parse-prj-file): Use find-file-noselect instead of find-file
to open the project file, since the latter does not work with
speedbar Get default values before loading the prj file, or the
default executable file name is wrong. Use the absolute value of
src_dir to initialize ada-search-directories and
compilation-search-path,... Add the standard runtime library to
the search path for find-file.
(ada-prj-default-debugger): Was missing an opening '{'
(ada-prj-default-bind-opt, ada-prj-default-link-opt): New
variables.
(ada-prj-default-gnatmake-opt): New variable
(ada-prj-find-prj-file): Handles non-file buffers For non-Ada
buffers, the project file is the default one Save the windows
configuration before displaying the menu.
(ada-prj-src-dir, ada-prj-obj-dir, ada-prj-comp-opt,...): Removed
(ada-read-identifier): Fix xrefs on operators (for "mod", "and",
...) regexp-quote identifiers names to support operators +,
-,... in regexps.
(ada-remote): New function.
(ada-run-application): Erase the output buffer before starting the
run Support remote execution of the application. Use
call-process, or the arguments are incorrectly parsed
(ada-set-default-project-file): Reread the content of the active
project file, not the one from the current buffer When a project
file is set as the default project, all directories are
automatically associated with it.
(ada-set-environment): New function
(ada-treat-cmd-string): New special variable ${current}
(ada-treat-cmd-string): Revised. The substitution is now done for
any ${...} substring
(ada-xref-current): If no body was found, compiles the spec
instead. Setup ADA_{SOURCE,OBJECTS}_PATH before running the
compiler to get rid of command line length limitations.
(ada-xref-get-project-field): New function
(ada-xref-project-files): New variable
(ada-xref-runtime-library-specs-path)
(ada-xref-runtime-library-ali-path): New variables
(ada-xref-set-default-prj-values): Default run command now does a
cd to the build directory. New field: main_unit Provide a default
file name even if the current buffer has no prj file.
2000-07-24 11:13:11 +00:00
|
|
|
|
1999-10-07 14:25:59 +00:00
|
|
|
;; ------ Private routines
|
|
|
|
|
|
|
|
(defun ada-xref-current (file &optional ali-file-name)
|
1999-10-28 11:12:54 +00:00
|
|
|
"Update the cross-references for FILE.
|
2002-04-09 18:54:20 +00:00
|
|
|
This in fact recompiles FILE to create ALI-FILE-NAME.
|
|
|
|
This function returns the name of the file that was recompiled to generate
|
2004-08-22 17:14:02 +00:00
|
|
|
the cross-reference information. Note that the ali file can then be deduced by
|
|
|
|
replacing the file extension with `.ali'."
|
1999-10-07 14:25:59 +00:00
|
|
|
;; kill old buffer
|
|
|
|
(if (and ali-file-name
|
2006-10-31 00:57:56 +00:00
|
|
|
(get-file-buffer ali-file-name))
|
1999-10-07 14:25:59 +00:00
|
|
|
(kill-buffer (get-file-buffer ali-file-name)))
|
2003-02-04 13:24:35 +00:00
|
|
|
|
2002-04-09 18:54:20 +00:00
|
|
|
(let* ((name (ada-convert-file-name file))
|
|
|
|
(body-name (or (ada-get-body-name name) name)))
|
Got rid of all byte-compiler warnings on Emacs.
Add to the menu when the file is loaded, not in ada-mode-hook.
Add -toolbar to the default ddd command Switches moved from
ada-prj-default-comp-cmd and ada-prj-default-make-cmd to
ada-prj-default-comp-opt
(ada-add-ada-menu): Remove the map and name parameters Add the Ada
Reference Manual to the menu
(ada-check-current): rewritten as a call to ada-compile-current
(ada-compile): Removed.
(ada-compile-application, ada-compile-current, ada-check-current):
Set the compilation-search-path so that compile.el automatically
finds the sources in src_dir. Automatic scrollong of the
compilation buffer. C-uC-cC-c asks for confirmation before
compiling
(ada-compile-current): New parameter, prj-field
(ada-complete-identifier): Load the .ali file before doing
processing
(ada-find-ali-file-in-dir): prepend build_dir to obj_dir to
conform to gnatmake's behavior.
(ada-find-file-in-dir): New function
(ada-find-references): Set the environment variables for gnatfind
(ada-find-src-file-in-dir): New function.
(ada-first-non-nil): Removed
(ada-gdb-application): Add support for jdb, the java debugger.
(ada-get-ada-file-name): Load the original-file first if not done
yet.
(ada-get-all-references): Handles the new ali syntax (parent types
are found between <>).
(ada-initialize-runtime-library): New function
(ada-mode-hook): Always load a project file when a file is opened,
so that the casing exceptions are correctly read.
(ada-operator-re): Add all missing operators ("abs", "rem", "**").
(ada-parse-prj-file): Use find-file-noselect instead of find-file
to open the project file, since the latter does not work with
speedbar Get default values before loading the prj file, or the
default executable file name is wrong. Use the absolute value of
src_dir to initialize ada-search-directories and
compilation-search-path,... Add the standard runtime library to
the search path for find-file.
(ada-prj-default-debugger): Was missing an opening '{'
(ada-prj-default-bind-opt, ada-prj-default-link-opt): New
variables.
(ada-prj-default-gnatmake-opt): New variable
(ada-prj-find-prj-file): Handles non-file buffers For non-Ada
buffers, the project file is the default one Save the windows
configuration before displaying the menu.
(ada-prj-src-dir, ada-prj-obj-dir, ada-prj-comp-opt,...): Removed
(ada-read-identifier): Fix xrefs on operators (for "mod", "and",
...) regexp-quote identifiers names to support operators +,
-,... in regexps.
(ada-remote): New function.
(ada-run-application): Erase the output buffer before starting the
run Support remote execution of the application. Use
call-process, or the arguments are incorrectly parsed
(ada-set-default-project-file): Reread the content of the active
project file, not the one from the current buffer When a project
file is set as the default project, all directories are
automatically associated with it.
(ada-set-environment): New function
(ada-treat-cmd-string): New special variable ${current}
(ada-treat-cmd-string): Revised. The substitution is now done for
any ${...} substring
(ada-xref-current): If no body was found, compiles the spec
instead. Setup ADA_{SOURCE,OBJECTS}_PATH before running the
compiler to get rid of command line length limitations.
(ada-xref-get-project-field): New function
(ada-xref-project-files): New variable
(ada-xref-runtime-library-specs-path)
(ada-xref-runtime-library-ali-path): New variables
(ada-xref-set-default-prj-values): Default run command now does a
cd to the build directory. New field: main_unit Provide a default
file name even if the current buffer has no prj file.
2000-07-24 11:13:11 +00:00
|
|
|
|
2004-08-22 17:14:02 +00:00
|
|
|
;; Always recompile the body when we can. We thus temporarily switch to a
|
2002-04-09 18:54:20 +00:00
|
|
|
;; buffer than contains the body of the unit
|
|
|
|
(save-excursion
|
|
|
|
(let ((body-visible (find-buffer-visiting body-name))
|
|
|
|
process)
|
|
|
|
(if body-visible
|
|
|
|
(set-buffer body-visible)
|
|
|
|
(find-file body-name))
|
|
|
|
|
2004-08-22 17:14:02 +00:00
|
|
|
;; Execute the compilation. Note that we must wait for the end of the
|
2002-04-09 18:54:20 +00:00
|
|
|
;; process, or the ALI file would still not be available.
|
|
|
|
;; Unfortunately, the underlying `compile' command that we use is
|
|
|
|
;; asynchronous.
|
|
|
|
(ada-compile-current)
|
|
|
|
(setq process (get-buffer-process "*compilation*"))
|
|
|
|
|
|
|
|
(while (and process
|
|
|
|
(not (equal (process-status process) 'exit)))
|
|
|
|
(sit-for 1))
|
|
|
|
|
|
|
|
;; remove the buffer for the body if it wasn't there before
|
|
|
|
(unless body-visible
|
|
|
|
(kill-buffer (find-buffer-visiting body-name)))
|
|
|
|
))
|
|
|
|
body-name))
|
Got rid of all byte-compiler warnings on Emacs.
Add to the menu when the file is loaded, not in ada-mode-hook.
Add -toolbar to the default ddd command Switches moved from
ada-prj-default-comp-cmd and ada-prj-default-make-cmd to
ada-prj-default-comp-opt
(ada-add-ada-menu): Remove the map and name parameters Add the Ada
Reference Manual to the menu
(ada-check-current): rewritten as a call to ada-compile-current
(ada-compile): Removed.
(ada-compile-application, ada-compile-current, ada-check-current):
Set the compilation-search-path so that compile.el automatically
finds the sources in src_dir. Automatic scrollong of the
compilation buffer. C-uC-cC-c asks for confirmation before
compiling
(ada-compile-current): New parameter, prj-field
(ada-complete-identifier): Load the .ali file before doing
processing
(ada-find-ali-file-in-dir): prepend build_dir to obj_dir to
conform to gnatmake's behavior.
(ada-find-file-in-dir): New function
(ada-find-references): Set the environment variables for gnatfind
(ada-find-src-file-in-dir): New function.
(ada-first-non-nil): Removed
(ada-gdb-application): Add support for jdb, the java debugger.
(ada-get-ada-file-name): Load the original-file first if not done
yet.
(ada-get-all-references): Handles the new ali syntax (parent types
are found between <>).
(ada-initialize-runtime-library): New function
(ada-mode-hook): Always load a project file when a file is opened,
so that the casing exceptions are correctly read.
(ada-operator-re): Add all missing operators ("abs", "rem", "**").
(ada-parse-prj-file): Use find-file-noselect instead of find-file
to open the project file, since the latter does not work with
speedbar Get default values before loading the prj file, or the
default executable file name is wrong. Use the absolute value of
src_dir to initialize ada-search-directories and
compilation-search-path,... Add the standard runtime library to
the search path for find-file.
(ada-prj-default-debugger): Was missing an opening '{'
(ada-prj-default-bind-opt, ada-prj-default-link-opt): New
variables.
(ada-prj-default-gnatmake-opt): New variable
(ada-prj-find-prj-file): Handles non-file buffers For non-Ada
buffers, the project file is the default one Save the windows
configuration before displaying the menu.
(ada-prj-src-dir, ada-prj-obj-dir, ada-prj-comp-opt,...): Removed
(ada-read-identifier): Fix xrefs on operators (for "mod", "and",
...) regexp-quote identifiers names to support operators +,
-,... in regexps.
(ada-remote): New function.
(ada-run-application): Erase the output buffer before starting the
run Support remote execution of the application. Use
call-process, or the arguments are incorrectly parsed
(ada-set-default-project-file): Reread the content of the active
project file, not the one from the current buffer When a project
file is set as the default project, all directories are
automatically associated with it.
(ada-set-environment): New function
(ada-treat-cmd-string): New special variable ${current}
(ada-treat-cmd-string): Revised. The substitution is now done for
any ${...} substring
(ada-xref-current): If no body was found, compiles the spec
instead. Setup ADA_{SOURCE,OBJECTS}_PATH before running the
compiler to get rid of command line length limitations.
(ada-xref-get-project-field): New function
(ada-xref-project-files): New variable
(ada-xref-runtime-library-specs-path)
(ada-xref-runtime-library-ali-path): New variables
(ada-xref-set-default-prj-values): Default run command now does a
cd to the build directory. New field: main_unit Provide a default
file name even if the current buffer has no prj file.
2000-07-24 11:13:11 +00:00
|
|
|
|
|
|
|
(defun ada-find-file-in-dir (file dir-list)
|
|
|
|
"Search for FILE in DIR-LIST."
|
|
|
|
(let (found)
|
|
|
|
(while (and (not found) dir-list)
|
|
|
|
(set 'found (concat (file-name-as-directory (car dir-list))
|
|
|
|
(file-name-nondirectory file)))
|
2003-02-04 13:24:35 +00:00
|
|
|
|
Got rid of all byte-compiler warnings on Emacs.
Add to the menu when the file is loaded, not in ada-mode-hook.
Add -toolbar to the default ddd command Switches moved from
ada-prj-default-comp-cmd and ada-prj-default-make-cmd to
ada-prj-default-comp-opt
(ada-add-ada-menu): Remove the map and name parameters Add the Ada
Reference Manual to the menu
(ada-check-current): rewritten as a call to ada-compile-current
(ada-compile): Removed.
(ada-compile-application, ada-compile-current, ada-check-current):
Set the compilation-search-path so that compile.el automatically
finds the sources in src_dir. Automatic scrollong of the
compilation buffer. C-uC-cC-c asks for confirmation before
compiling
(ada-compile-current): New parameter, prj-field
(ada-complete-identifier): Load the .ali file before doing
processing
(ada-find-ali-file-in-dir): prepend build_dir to obj_dir to
conform to gnatmake's behavior.
(ada-find-file-in-dir): New function
(ada-find-references): Set the environment variables for gnatfind
(ada-find-src-file-in-dir): New function.
(ada-first-non-nil): Removed
(ada-gdb-application): Add support for jdb, the java debugger.
(ada-get-ada-file-name): Load the original-file first if not done
yet.
(ada-get-all-references): Handles the new ali syntax (parent types
are found between <>).
(ada-initialize-runtime-library): New function
(ada-mode-hook): Always load a project file when a file is opened,
so that the casing exceptions are correctly read.
(ada-operator-re): Add all missing operators ("abs", "rem", "**").
(ada-parse-prj-file): Use find-file-noselect instead of find-file
to open the project file, since the latter does not work with
speedbar Get default values before loading the prj file, or the
default executable file name is wrong. Use the absolute value of
src_dir to initialize ada-search-directories and
compilation-search-path,... Add the standard runtime library to
the search path for find-file.
(ada-prj-default-debugger): Was missing an opening '{'
(ada-prj-default-bind-opt, ada-prj-default-link-opt): New
variables.
(ada-prj-default-gnatmake-opt): New variable
(ada-prj-find-prj-file): Handles non-file buffers For non-Ada
buffers, the project file is the default one Save the windows
configuration before displaying the menu.
(ada-prj-src-dir, ada-prj-obj-dir, ada-prj-comp-opt,...): Removed
(ada-read-identifier): Fix xrefs on operators (for "mod", "and",
...) regexp-quote identifiers names to support operators +,
-,... in regexps.
(ada-remote): New function.
(ada-run-application): Erase the output buffer before starting the
run Support remote execution of the application. Use
call-process, or the arguments are incorrectly parsed
(ada-set-default-project-file): Reread the content of the active
project file, not the one from the current buffer When a project
file is set as the default project, all directories are
automatically associated with it.
(ada-set-environment): New function
(ada-treat-cmd-string): New special variable ${current}
(ada-treat-cmd-string): Revised. The substitution is now done for
any ${...} substring
(ada-xref-current): If no body was found, compiles the spec
instead. Setup ADA_{SOURCE,OBJECTS}_PATH before running the
compiler to get rid of command line length limitations.
(ada-xref-get-project-field): New function
(ada-xref-project-files): New variable
(ada-xref-runtime-library-specs-path)
(ada-xref-runtime-library-ali-path): New variables
(ada-xref-set-default-prj-values): Default run command now does a
cd to the build directory. New field: main_unit Provide a default
file name even if the current buffer has no prj file.
2000-07-24 11:13:11 +00:00
|
|
|
(unless (file-exists-p found)
|
|
|
|
(set 'found nil))
|
|
|
|
(set 'dir-list (cdr dir-list)))
|
|
|
|
found))
|
1999-10-07 14:25:59 +00:00
|
|
|
|
|
|
|
(defun ada-find-ali-file-in-dir (file)
|
2006-10-31 00:57:56 +00:00
|
|
|
"Find the ali file FILE, searching obj_dir for the current project.
|
Got rid of all byte-compiler warnings on Emacs.
Add to the menu when the file is loaded, not in ada-mode-hook.
Add -toolbar to the default ddd command Switches moved from
ada-prj-default-comp-cmd and ada-prj-default-make-cmd to
ada-prj-default-comp-opt
(ada-add-ada-menu): Remove the map and name parameters Add the Ada
Reference Manual to the menu
(ada-check-current): rewritten as a call to ada-compile-current
(ada-compile): Removed.
(ada-compile-application, ada-compile-current, ada-check-current):
Set the compilation-search-path so that compile.el automatically
finds the sources in src_dir. Automatic scrollong of the
compilation buffer. C-uC-cC-c asks for confirmation before
compiling
(ada-compile-current): New parameter, prj-field
(ada-complete-identifier): Load the .ali file before doing
processing
(ada-find-ali-file-in-dir): prepend build_dir to obj_dir to
conform to gnatmake's behavior.
(ada-find-file-in-dir): New function
(ada-find-references): Set the environment variables for gnatfind
(ada-find-src-file-in-dir): New function.
(ada-first-non-nil): Removed
(ada-gdb-application): Add support for jdb, the java debugger.
(ada-get-ada-file-name): Load the original-file first if not done
yet.
(ada-get-all-references): Handles the new ali syntax (parent types
are found between <>).
(ada-initialize-runtime-library): New function
(ada-mode-hook): Always load a project file when a file is opened,
so that the casing exceptions are correctly read.
(ada-operator-re): Add all missing operators ("abs", "rem", "**").
(ada-parse-prj-file): Use find-file-noselect instead of find-file
to open the project file, since the latter does not work with
speedbar Get default values before loading the prj file, or the
default executable file name is wrong. Use the absolute value of
src_dir to initialize ada-search-directories and
compilation-search-path,... Add the standard runtime library to
the search path for find-file.
(ada-prj-default-debugger): Was missing an opening '{'
(ada-prj-default-bind-opt, ada-prj-default-link-opt): New
variables.
(ada-prj-default-gnatmake-opt): New variable
(ada-prj-find-prj-file): Handles non-file buffers For non-Ada
buffers, the project file is the default one Save the windows
configuration before displaying the menu.
(ada-prj-src-dir, ada-prj-obj-dir, ada-prj-comp-opt,...): Removed
(ada-read-identifier): Fix xrefs on operators (for "mod", "and",
...) regexp-quote identifiers names to support operators +,
-,... in regexps.
(ada-remote): New function.
(ada-run-application): Erase the output buffer before starting the
run Support remote execution of the application. Use
call-process, or the arguments are incorrectly parsed
(ada-set-default-project-file): Reread the content of the active
project file, not the one from the current buffer When a project
file is set as the default project, all directories are
automatically associated with it.
(ada-set-environment): New function
(ada-treat-cmd-string): New special variable ${current}
(ada-treat-cmd-string): Revised. The substitution is now done for
any ${...} substring
(ada-xref-current): If no body was found, compiles the spec
instead. Setup ADA_{SOURCE,OBJECTS}_PATH before running the
compiler to get rid of command line length limitations.
(ada-xref-get-project-field): New function
(ada-xref-project-files): New variable
(ada-xref-runtime-library-specs-path)
(ada-xref-runtime-library-ali-path): New variables
(ada-xref-set-default-prj-values): Default run command now does a
cd to the build directory. New field: main_unit Provide a default
file name even if the current buffer has no prj file.
2000-07-24 11:13:11 +00:00
|
|
|
Adds build_dir in front of the search path to conform to gnatmake's behavior,
|
|
|
|
and the standard runtime location at the end."
|
2002-04-09 18:54:20 +00:00
|
|
|
(ada-find-file-in-dir file (ada-xref-get-obj-dir-field)))
|
Got rid of all byte-compiler warnings on Emacs.
Add to the menu when the file is loaded, not in ada-mode-hook.
Add -toolbar to the default ddd command Switches moved from
ada-prj-default-comp-cmd and ada-prj-default-make-cmd to
ada-prj-default-comp-opt
(ada-add-ada-menu): Remove the map and name parameters Add the Ada
Reference Manual to the menu
(ada-check-current): rewritten as a call to ada-compile-current
(ada-compile): Removed.
(ada-compile-application, ada-compile-current, ada-check-current):
Set the compilation-search-path so that compile.el automatically
finds the sources in src_dir. Automatic scrollong of the
compilation buffer. C-uC-cC-c asks for confirmation before
compiling
(ada-compile-current): New parameter, prj-field
(ada-complete-identifier): Load the .ali file before doing
processing
(ada-find-ali-file-in-dir): prepend build_dir to obj_dir to
conform to gnatmake's behavior.
(ada-find-file-in-dir): New function
(ada-find-references): Set the environment variables for gnatfind
(ada-find-src-file-in-dir): New function.
(ada-first-non-nil): Removed
(ada-gdb-application): Add support for jdb, the java debugger.
(ada-get-ada-file-name): Load the original-file first if not done
yet.
(ada-get-all-references): Handles the new ali syntax (parent types
are found between <>).
(ada-initialize-runtime-library): New function
(ada-mode-hook): Always load a project file when a file is opened,
so that the casing exceptions are correctly read.
(ada-operator-re): Add all missing operators ("abs", "rem", "**").
(ada-parse-prj-file): Use find-file-noselect instead of find-file
to open the project file, since the latter does not work with
speedbar Get default values before loading the prj file, or the
default executable file name is wrong. Use the absolute value of
src_dir to initialize ada-search-directories and
compilation-search-path,... Add the standard runtime library to
the search path for find-file.
(ada-prj-default-debugger): Was missing an opening '{'
(ada-prj-default-bind-opt, ada-prj-default-link-opt): New
variables.
(ada-prj-default-gnatmake-opt): New variable
(ada-prj-find-prj-file): Handles non-file buffers For non-Ada
buffers, the project file is the default one Save the windows
configuration before displaying the menu.
(ada-prj-src-dir, ada-prj-obj-dir, ada-prj-comp-opt,...): Removed
(ada-read-identifier): Fix xrefs on operators (for "mod", "and",
...) regexp-quote identifiers names to support operators +,
-,... in regexps.
(ada-remote): New function.
(ada-run-application): Erase the output buffer before starting the
run Support remote execution of the application. Use
call-process, or the arguments are incorrectly parsed
(ada-set-default-project-file): Reread the content of the active
project file, not the one from the current buffer When a project
file is set as the default project, all directories are
automatically associated with it.
(ada-set-environment): New function
(ada-treat-cmd-string): New special variable ${current}
(ada-treat-cmd-string): Revised. The substitution is now done for
any ${...} substring
(ada-xref-current): If no body was found, compiles the spec
instead. Setup ADA_{SOURCE,OBJECTS}_PATH before running the
compiler to get rid of command line length limitations.
(ada-xref-get-project-field): New function
(ada-xref-project-files): New variable
(ada-xref-runtime-library-specs-path)
(ada-xref-runtime-library-ali-path): New variables
(ada-xref-set-default-prj-values): Default run command now does a
cd to the build directory. New field: main_unit Provide a default
file name even if the current buffer has no prj file.
2000-07-24 11:13:11 +00:00
|
|
|
|
|
|
|
(defun ada-find-src-file-in-dir (file)
|
2006-10-31 00:57:56 +00:00
|
|
|
"Find the source file FILE, searching src_dir for the current project.
|
|
|
|
Adds the standard runtime location at the end of the search path to conform
|
|
|
|
to gnatmake's behavior."
|
2002-04-09 18:54:20 +00:00
|
|
|
(ada-find-file-in-dir file (ada-xref-get-src-dir-field)))
|
1999-10-07 14:25:59 +00:00
|
|
|
|
|
|
|
(defun ada-get-ali-file-name (file)
|
1999-10-28 11:12:54 +00:00
|
|
|
"Create the ali file name for the ada-file FILE.
|
|
|
|
The file is searched for in every directory shown in the obj_dir lines of
|
|
|
|
the project file."
|
1999-10-07 14:25:59 +00:00
|
|
|
|
|
|
|
;; This function has to handle the special case of non-standard
|
|
|
|
;; file names (i.e. not .adb or .ads)
|
|
|
|
;; The trick is the following:
|
|
|
|
;; 1- replace the extension of the current file with .ali,
|
|
|
|
;; and look for this file
|
|
|
|
;; 2- If this file is found:
|
|
|
|
;; grep the "^U" lines, and make sure we are not reading the
|
2004-08-22 17:14:02 +00:00
|
|
|
;; .ali file for a spec file. If we are, go to step 3.
|
1999-10-07 14:25:59 +00:00
|
|
|
;; 3- If the file is not found or step 2 failed:
|
|
|
|
;; find the name of the "other file", ie the body, and look
|
|
|
|
;; for its associated .ali file by subtituing the extension
|
2002-04-09 18:54:20 +00:00
|
|
|
;;
|
|
|
|
;; We must also handle the case of separate packages and subprograms:
|
|
|
|
;; 4- If no ali file was found, we try to modify the file name by removing
|
|
|
|
;; everything after the last '-' or '.' character, so as to get the
|
2004-08-22 17:14:02 +00:00
|
|
|
;; ali file for the parent unit. If we found an ali file, we check that
|
2002-04-09 18:54:20 +00:00
|
|
|
;; it indeed contains the definition for the separate entity by checking
|
2004-08-22 17:14:02 +00:00
|
|
|
;; the 'D' lines. This is done repeatedly, in case the direct parent is
|
2002-04-09 18:54:20 +00:00
|
|
|
;; also a separate.
|
1999-10-07 14:25:59 +00:00
|
|
|
|
|
|
|
(save-excursion
|
|
|
|
(set-buffer (get-file-buffer file))
|
|
|
|
(let ((short-ali-file-name
|
2006-10-31 00:57:56 +00:00
|
|
|
(concat (file-name-sans-extension (file-name-nondirectory file))
|
|
|
|
".ali"))
|
|
|
|
ali-file-name
|
2002-04-09 18:54:20 +00:00
|
|
|
is-spec)
|
|
|
|
|
|
|
|
;; If we have a non-standard file name, and this is a spec, we first
|
|
|
|
;; look for the .ali file of the body, since this is the one that
|
2004-08-22 17:14:02 +00:00
|
|
|
;; contains the most complete information. If not found, we will do what
|
2002-04-09 18:54:20 +00:00
|
|
|
;; we can with the .ali file for the spec...
|
|
|
|
|
|
|
|
(if (not (string= (file-name-extension file) "ads"))
|
|
|
|
(let ((specs ada-spec-suffixes))
|
|
|
|
(while specs
|
|
|
|
(if (string-match (concat (regexp-quote (car specs)) "$")
|
|
|
|
file)
|
|
|
|
(set 'is-spec t))
|
|
|
|
(set 'specs (cdr specs)))))
|
|
|
|
|
|
|
|
(if is-spec
|
|
|
|
(set 'ali-file-name
|
|
|
|
(ada-find-ali-file-in-dir
|
|
|
|
(concat (file-name-sans-extension
|
|
|
|
(file-name-nondirectory
|
|
|
|
(ada-other-file-name)))
|
|
|
|
".ali"))))
|
2003-02-04 13:24:35 +00:00
|
|
|
|
2002-04-09 18:54:20 +00:00
|
|
|
|
|
|
|
(setq ali-file-name
|
|
|
|
(or ali-file-name
|
2003-02-04 13:24:35 +00:00
|
|
|
|
2002-04-09 18:54:20 +00:00
|
|
|
;; Else we take the .ali file associated with the unit
|
|
|
|
(ada-find-ali-file-in-dir short-ali-file-name)
|
2003-02-04 13:24:35 +00:00
|
|
|
|
2002-04-09 18:54:20 +00:00
|
|
|
|
|
|
|
;; else we did not find the .ali file Second chance: in case
|
|
|
|
;; the files do not have standard names (such as for instance
|
|
|
|
;; file_s.ada and file_b.ada), try to go to the other file
|
|
|
|
;; and look for its ali file
|
|
|
|
(ada-find-ali-file-in-dir
|
|
|
|
(concat (file-name-sans-extension
|
|
|
|
(file-name-nondirectory (ada-other-file-name)))
|
|
|
|
".ali"))
|
|
|
|
|
2003-02-04 13:24:35 +00:00
|
|
|
|
2002-04-09 18:54:20 +00:00
|
|
|
;; If we still don't have an ali file, try to get the one
|
|
|
|
;; from the parent unit, in case we have a separate entity.
|
|
|
|
(let ((parent-name (file-name-sans-extension
|
|
|
|
(file-name-nondirectory file))))
|
2003-02-04 13:24:35 +00:00
|
|
|
|
2002-04-09 18:54:20 +00:00
|
|
|
(while (and (not ali-file-name)
|
|
|
|
(string-match "^\\(.*\\)[.-][^.-]*" parent-name))
|
2003-02-04 13:24:35 +00:00
|
|
|
|
2002-04-09 18:54:20 +00:00
|
|
|
(set 'parent-name (match-string 1 parent-name))
|
|
|
|
(set 'ali-file-name (ada-find-ali-file-in-dir
|
|
|
|
(concat parent-name ".ali")))
|
|
|
|
)
|
|
|
|
ali-file-name)))
|
2003-02-04 13:24:35 +00:00
|
|
|
|
2002-04-09 18:54:20 +00:00
|
|
|
;; If still not found, try to recompile the file
|
|
|
|
(if (not ali-file-name)
|
2004-08-22 17:14:02 +00:00
|
|
|
;; Recompile only if the user asked for this, and search the ali
|
|
|
|
;; filename again. We avoid a possible infinite recursion by
|
2002-04-09 18:54:20 +00:00
|
|
|
;; temporarily disabling the automatic compilation.
|
2003-02-04 13:24:35 +00:00
|
|
|
|
2002-04-09 18:54:20 +00:00
|
|
|
(if ada-xref-create-ali
|
|
|
|
(setq ali-file-name
|
|
|
|
(concat (file-name-sans-extension (ada-xref-current file))
|
|
|
|
".ali"))
|
1999-10-07 14:25:59 +00:00
|
|
|
|
2004-08-22 17:14:02 +00:00
|
|
|
(error "`.ali' file not found; recompile your source file"))
|
2003-02-04 13:24:35 +00:00
|
|
|
|
|
|
|
|
2002-04-09 18:54:20 +00:00
|
|
|
;; same if the .ali file is too old and we must recompile it
|
|
|
|
(if (and (file-newer-than-file-p file ali-file-name)
|
|
|
|
ada-xref-create-ali)
|
|
|
|
(ada-xref-current file ali-file-name)))
|
1999-10-07 14:25:59 +00:00
|
|
|
|
2002-04-09 18:54:20 +00:00
|
|
|
;; Always return the correct absolute file name
|
1999-10-07 14:25:59 +00:00
|
|
|
(expand-file-name ali-file-name))
|
2002-04-09 18:54:20 +00:00
|
|
|
))
|
1999-10-07 14:25:59 +00:00
|
|
|
|
|
|
|
(defun ada-get-ada-file-name (file original-file)
|
1999-10-28 11:12:54 +00:00
|
|
|
"Create the complete file name (+directory) for FILE.
|
2004-08-22 17:14:02 +00:00
|
|
|
The original file (where the user was) is ORIGINAL-FILE. Search in project
|
1999-10-28 11:12:54 +00:00
|
|
|
file for possible paths."
|
1999-10-07 14:25:59 +00:00
|
|
|
|
|
|
|
(save-excursion
|
Got rid of all byte-compiler warnings on Emacs.
Add to the menu when the file is loaded, not in ada-mode-hook.
Add -toolbar to the default ddd command Switches moved from
ada-prj-default-comp-cmd and ada-prj-default-make-cmd to
ada-prj-default-comp-opt
(ada-add-ada-menu): Remove the map and name parameters Add the Ada
Reference Manual to the menu
(ada-check-current): rewritten as a call to ada-compile-current
(ada-compile): Removed.
(ada-compile-application, ada-compile-current, ada-check-current):
Set the compilation-search-path so that compile.el automatically
finds the sources in src_dir. Automatic scrollong of the
compilation buffer. C-uC-cC-c asks for confirmation before
compiling
(ada-compile-current): New parameter, prj-field
(ada-complete-identifier): Load the .ali file before doing
processing
(ada-find-ali-file-in-dir): prepend build_dir to obj_dir to
conform to gnatmake's behavior.
(ada-find-file-in-dir): New function
(ada-find-references): Set the environment variables for gnatfind
(ada-find-src-file-in-dir): New function.
(ada-first-non-nil): Removed
(ada-gdb-application): Add support for jdb, the java debugger.
(ada-get-ada-file-name): Load the original-file first if not done
yet.
(ada-get-all-references): Handles the new ali syntax (parent types
are found between <>).
(ada-initialize-runtime-library): New function
(ada-mode-hook): Always load a project file when a file is opened,
so that the casing exceptions are correctly read.
(ada-operator-re): Add all missing operators ("abs", "rem", "**").
(ada-parse-prj-file): Use find-file-noselect instead of find-file
to open the project file, since the latter does not work with
speedbar Get default values before loading the prj file, or the
default executable file name is wrong. Use the absolute value of
src_dir to initialize ada-search-directories and
compilation-search-path,... Add the standard runtime library to
the search path for find-file.
(ada-prj-default-debugger): Was missing an opening '{'
(ada-prj-default-bind-opt, ada-prj-default-link-opt): New
variables.
(ada-prj-default-gnatmake-opt): New variable
(ada-prj-find-prj-file): Handles non-file buffers For non-Ada
buffers, the project file is the default one Save the windows
configuration before displaying the menu.
(ada-prj-src-dir, ada-prj-obj-dir, ada-prj-comp-opt,...): Removed
(ada-read-identifier): Fix xrefs on operators (for "mod", "and",
...) regexp-quote identifiers names to support operators +,
-,... in regexps.
(ada-remote): New function.
(ada-run-application): Erase the output buffer before starting the
run Support remote execution of the application. Use
call-process, or the arguments are incorrectly parsed
(ada-set-default-project-file): Reread the content of the active
project file, not the one from the current buffer When a project
file is set as the default project, all directories are
automatically associated with it.
(ada-set-environment): New function
(ada-treat-cmd-string): New special variable ${current}
(ada-treat-cmd-string): Revised. The substitution is now done for
any ${...} substring
(ada-xref-current): If no body was found, compiles the spec
instead. Setup ADA_{SOURCE,OBJECTS}_PATH before running the
compiler to get rid of command line length limitations.
(ada-xref-get-project-field): New function
(ada-xref-project-files): New variable
(ada-xref-runtime-library-specs-path)
(ada-xref-runtime-library-ali-path): New variables
(ada-xref-set-default-prj-values): Default run command now does a
cd to the build directory. New field: main_unit Provide a default
file name even if the current buffer has no prj file.
2000-07-24 11:13:11 +00:00
|
|
|
|
|
|
|
;; If the buffer for original-file, use it to get the values from the
|
|
|
|
;; project file, otherwise load the file and its project file
|
|
|
|
(let ((buffer (get-file-buffer original-file)))
|
|
|
|
(if buffer
|
|
|
|
(set-buffer buffer)
|
|
|
|
(find-file original-file)
|
|
|
|
(ada-require-project-file)))
|
2003-02-04 13:24:35 +00:00
|
|
|
|
1999-10-07 14:25:59 +00:00
|
|
|
;; we choose the first possible completion and we
|
|
|
|
;; return the absolute file name
|
Got rid of all byte-compiler warnings on Emacs.
Add to the menu when the file is loaded, not in ada-mode-hook.
Add -toolbar to the default ddd command Switches moved from
ada-prj-default-comp-cmd and ada-prj-default-make-cmd to
ada-prj-default-comp-opt
(ada-add-ada-menu): Remove the map and name parameters Add the Ada
Reference Manual to the menu
(ada-check-current): rewritten as a call to ada-compile-current
(ada-compile): Removed.
(ada-compile-application, ada-compile-current, ada-check-current):
Set the compilation-search-path so that compile.el automatically
finds the sources in src_dir. Automatic scrollong of the
compilation buffer. C-uC-cC-c asks for confirmation before
compiling
(ada-compile-current): New parameter, prj-field
(ada-complete-identifier): Load the .ali file before doing
processing
(ada-find-ali-file-in-dir): prepend build_dir to obj_dir to
conform to gnatmake's behavior.
(ada-find-file-in-dir): New function
(ada-find-references): Set the environment variables for gnatfind
(ada-find-src-file-in-dir): New function.
(ada-first-non-nil): Removed
(ada-gdb-application): Add support for jdb, the java debugger.
(ada-get-ada-file-name): Load the original-file first if not done
yet.
(ada-get-all-references): Handles the new ali syntax (parent types
are found between <>).
(ada-initialize-runtime-library): New function
(ada-mode-hook): Always load a project file when a file is opened,
so that the casing exceptions are correctly read.
(ada-operator-re): Add all missing operators ("abs", "rem", "**").
(ada-parse-prj-file): Use find-file-noselect instead of find-file
to open the project file, since the latter does not work with
speedbar Get default values before loading the prj file, or the
default executable file name is wrong. Use the absolute value of
src_dir to initialize ada-search-directories and
compilation-search-path,... Add the standard runtime library to
the search path for find-file.
(ada-prj-default-debugger): Was missing an opening '{'
(ada-prj-default-bind-opt, ada-prj-default-link-opt): New
variables.
(ada-prj-default-gnatmake-opt): New variable
(ada-prj-find-prj-file): Handles non-file buffers For non-Ada
buffers, the project file is the default one Save the windows
configuration before displaying the menu.
(ada-prj-src-dir, ada-prj-obj-dir, ada-prj-comp-opt,...): Removed
(ada-read-identifier): Fix xrefs on operators (for "mod", "and",
...) regexp-quote identifiers names to support operators +,
-,... in regexps.
(ada-remote): New function.
(ada-run-application): Erase the output buffer before starting the
run Support remote execution of the application. Use
call-process, or the arguments are incorrectly parsed
(ada-set-default-project-file): Reread the content of the active
project file, not the one from the current buffer When a project
file is set as the default project, all directories are
automatically associated with it.
(ada-set-environment): New function
(ada-treat-cmd-string): New special variable ${current}
(ada-treat-cmd-string): Revised. The substitution is now done for
any ${...} substring
(ada-xref-current): If no body was found, compiles the spec
instead. Setup ADA_{SOURCE,OBJECTS}_PATH before running the
compiler to get rid of command line length limitations.
(ada-xref-get-project-field): New function
(ada-xref-project-files): New variable
(ada-xref-runtime-library-specs-path)
(ada-xref-runtime-library-ali-path): New variables
(ada-xref-set-default-prj-values): Default run command now does a
cd to the build directory. New field: main_unit Provide a default
file name even if the current buffer has no prj file.
2000-07-24 11:13:11 +00:00
|
|
|
(let ((filename (ada-find-src-file-in-dir file)))
|
1999-10-07 14:25:59 +00:00
|
|
|
(if filename
|
2006-10-31 00:57:56 +00:00
|
|
|
(expand-file-name filename)
|
|
|
|
(error (concat
|
|
|
|
(file-name-nondirectory file)
|
|
|
|
" not found in src_dir; please check your project file")))
|
1999-10-07 14:25:59 +00:00
|
|
|
|
|
|
|
)))
|
|
|
|
|
|
|
|
(defun ada-find-file-number-in-ali (file)
|
2006-10-31 00:57:56 +00:00
|
|
|
"Return the file number for FILE in the associated ali file."
|
1999-10-07 14:25:59 +00:00
|
|
|
(set-buffer (ada-get-ali-buffer file))
|
|
|
|
(goto-char (point-min))
|
|
|
|
|
|
|
|
(let ((begin (re-search-forward "^D")))
|
|
|
|
(beginning-of-line)
|
|
|
|
(re-search-forward (concat "^D " (file-name-nondirectory file)))
|
|
|
|
(count-lines begin (point))))
|
|
|
|
|
|
|
|
(defun ada-read-identifier (pos)
|
2006-10-31 00:57:56 +00:00
|
|
|
"Return the identlist around POS and switch to the .ali buffer.
|
2002-04-09 18:54:20 +00:00
|
|
|
The returned list represents the entity, and can be manipulated through the
|
|
|
|
macros `ada-name-of', `ada-line-of', `ada-column-of', `ada-file-of',..."
|
1999-10-07 14:25:59 +00:00
|
|
|
|
|
|
|
;; If at end of buffer (e.g the buffer is empty), error
|
|
|
|
(if (>= (point) (point-max))
|
|
|
|
(error "No identifier on point"))
|
2003-02-04 13:24:35 +00:00
|
|
|
|
1999-10-07 14:25:59 +00:00
|
|
|
;; goto first character of the identifier/operator (skip backward < and >
|
|
|
|
;; since they are part of multiple character operators
|
|
|
|
(goto-char pos)
|
|
|
|
(skip-chars-backward "a-zA-Z0-9_<>")
|
|
|
|
|
|
|
|
;; check if it really is an identifier
|
|
|
|
(if (ada-in-comment-p)
|
|
|
|
(error "Inside comment"))
|
|
|
|
|
|
|
|
(let (identifier identlist)
|
|
|
|
;; Just in front of a string => we could have an operator declaration,
|
|
|
|
;; as in "+", "-", ..
|
|
|
|
(if (= (char-after) ?\")
|
2006-10-31 00:57:56 +00:00
|
|
|
(forward-char 1))
|
1999-10-07 14:25:59 +00:00
|
|
|
|
|
|
|
;; if looking at an operator
|
Got rid of all byte-compiler warnings on Emacs.
Add to the menu when the file is loaded, not in ada-mode-hook.
Add -toolbar to the default ddd command Switches moved from
ada-prj-default-comp-cmd and ada-prj-default-make-cmd to
ada-prj-default-comp-opt
(ada-add-ada-menu): Remove the map and name parameters Add the Ada
Reference Manual to the menu
(ada-check-current): rewritten as a call to ada-compile-current
(ada-compile): Removed.
(ada-compile-application, ada-compile-current, ada-check-current):
Set the compilation-search-path so that compile.el automatically
finds the sources in src_dir. Automatic scrollong of the
compilation buffer. C-uC-cC-c asks for confirmation before
compiling
(ada-compile-current): New parameter, prj-field
(ada-complete-identifier): Load the .ali file before doing
processing
(ada-find-ali-file-in-dir): prepend build_dir to obj_dir to
conform to gnatmake's behavior.
(ada-find-file-in-dir): New function
(ada-find-references): Set the environment variables for gnatfind
(ada-find-src-file-in-dir): New function.
(ada-first-non-nil): Removed
(ada-gdb-application): Add support for jdb, the java debugger.
(ada-get-ada-file-name): Load the original-file first if not done
yet.
(ada-get-all-references): Handles the new ali syntax (parent types
are found between <>).
(ada-initialize-runtime-library): New function
(ada-mode-hook): Always load a project file when a file is opened,
so that the casing exceptions are correctly read.
(ada-operator-re): Add all missing operators ("abs", "rem", "**").
(ada-parse-prj-file): Use find-file-noselect instead of find-file
to open the project file, since the latter does not work with
speedbar Get default values before loading the prj file, or the
default executable file name is wrong. Use the absolute value of
src_dir to initialize ada-search-directories and
compilation-search-path,... Add the standard runtime library to
the search path for find-file.
(ada-prj-default-debugger): Was missing an opening '{'
(ada-prj-default-bind-opt, ada-prj-default-link-opt): New
variables.
(ada-prj-default-gnatmake-opt): New variable
(ada-prj-find-prj-file): Handles non-file buffers For non-Ada
buffers, the project file is the default one Save the windows
configuration before displaying the menu.
(ada-prj-src-dir, ada-prj-obj-dir, ada-prj-comp-opt,...): Removed
(ada-read-identifier): Fix xrefs on operators (for "mod", "and",
...) regexp-quote identifiers names to support operators +,
-,... in regexps.
(ada-remote): New function.
(ada-run-application): Erase the output buffer before starting the
run Support remote execution of the application. Use
call-process, or the arguments are incorrectly parsed
(ada-set-default-project-file): Reread the content of the active
project file, not the one from the current buffer When a project
file is set as the default project, all directories are
automatically associated with it.
(ada-set-environment): New function
(ada-treat-cmd-string): New special variable ${current}
(ada-treat-cmd-string): Revised. The substitution is now done for
any ${...} substring
(ada-xref-current): If no body was found, compiles the spec
instead. Setup ADA_{SOURCE,OBJECTS}_PATH before running the
compiler to get rid of command line length limitations.
(ada-xref-get-project-field): New function
(ada-xref-project-files): New variable
(ada-xref-runtime-library-specs-path)
(ada-xref-runtime-library-ali-path): New variables
(ada-xref-set-default-prj-values): Default run command now does a
cd to the build directory. New field: main_unit Provide a default
file name even if the current buffer has no prj file.
2000-07-24 11:13:11 +00:00
|
|
|
;; This is only true if:
|
|
|
|
;; - the symbol is +, -, ...
|
|
|
|
;; - the symbol is made of letters, and not followed by _ or a letter
|
|
|
|
(if (and (looking-at ada-operator-re)
|
|
|
|
(or (not (= (char-syntax (char-after)) ?w))
|
|
|
|
(not (or (= (char-syntax (char-after (match-end 0))) ?w)
|
|
|
|
(= (char-after (match-end 0)) ?_)))))
|
2006-10-31 00:57:56 +00:00
|
|
|
(progn
|
|
|
|
(if (and (= (char-before) ?\")
|
|
|
|
(= (char-after (+ (length (match-string 0)) (point))) ?\"))
|
|
|
|
(forward-char -1))
|
|
|
|
(set 'identifier (regexp-quote (concat "\"" (match-string 0) "\""))))
|
1999-10-07 14:25:59 +00:00
|
|
|
|
|
|
|
(if (ada-in-string-p)
|
2006-10-31 00:57:56 +00:00
|
|
|
(error "Inside string or character constant"))
|
1999-10-07 14:25:59 +00:00
|
|
|
(if (looking-at (concat ada-keywords "[^a-zA-Z_]"))
|
2006-10-31 00:57:56 +00:00
|
|
|
(error "No cross-reference available for reserved keyword"))
|
1999-10-07 14:25:59 +00:00
|
|
|
(if (looking-at "[a-zA-Z0-9_]+")
|
2006-10-31 00:57:56 +00:00
|
|
|
(set 'identifier (match-string 0))
|
|
|
|
(error "No identifier around")))
|
2003-02-04 13:24:35 +00:00
|
|
|
|
1999-10-07 14:25:59 +00:00
|
|
|
;; Build the identlist
|
|
|
|
(set 'identlist (ada-make-identlist))
|
|
|
|
(ada-set-name identlist (downcase identifier))
|
|
|
|
(ada-set-line identlist
|
Update copyright notice.
(ada-xref-create-ali): The default is now not to create automatically the
ALI files by compiling the unit, since this isn't always reliable and
requires an up-to-date project file.
(ada-prj-default-comp-cmd): No longer use gcc directly to compile
a file, but use gnatmake instead, since this gives access to the GNAT
project files.
(ada-xref-search-with-egrep): New variable, suggested by P. Waroquiers.
(ada-load-project-hook): New variable, for support of GNAT project files.
(ada-update-project-menu): Fix the detection of the project file name.
(ada-add-keymap): Change key binding for ada-find-file, that conflicted
with another binding in ada-mode.el.
(ada-add-menu): New menu "List Local References", to list the reference
to the entity only in the current file, instead of looking in the whole
project. Much faster.
(ada-find-references): New parameters arg and local-only.
(ada-find-any-references): New parameters local-only and append.
(ada-goto-declaration): Fix handling of predefined entities in xref.
(ada-get-all-references): Updated to the new xref format in GNAT 3.15,
still compatible with GNAT 3.14 of course. Fix various calls to
count-lines, that didn't work correctly when the buffer was narrowed.
2002-06-20 17:31:56 +00:00
|
|
|
(number-to-string (count-lines 1 (point))))
|
1999-10-07 14:25:59 +00:00
|
|
|
(ada-set-column identlist
|
|
|
|
(number-to-string (1+ (current-column))))
|
|
|
|
(ada-set-file identlist (buffer-file-name))
|
|
|
|
identlist
|
|
|
|
))
|
|
|
|
|
|
|
|
(defun ada-get-all-references (identlist)
|
2006-10-31 00:57:56 +00:00
|
|
|
"Complete IDENTLIST with definition file and places where it is referenced.
|
|
|
|
Information is extracted from the ali file."
|
2003-02-04 13:24:35 +00:00
|
|
|
|
1999-10-07 14:25:59 +00:00
|
|
|
(let ((ali-buffer (ada-get-ali-buffer (ada-file-of identlist)))
|
|
|
|
declaration-found)
|
|
|
|
(set-buffer ali-buffer)
|
|
|
|
(goto-char (point-min))
|
|
|
|
(ada-set-on-declaration identlist nil)
|
|
|
|
|
|
|
|
;; First attempt: we might already be on the declaration of the identifier
|
|
|
|
;; We want to look for the declaration only in a definite interval (after
|
|
|
|
;; the "^X ..." line for the current file, and before the next "^X" line
|
2003-02-04 13:24:35 +00:00
|
|
|
|
1999-10-07 14:25:59 +00:00
|
|
|
(if (re-search-forward
|
|
|
|
(concat "^X [0-9]+ " (file-name-nondirectory (ada-file-of identlist)))
|
|
|
|
nil t)
|
2006-10-31 00:57:56 +00:00
|
|
|
(let ((bound (save-excursion (re-search-forward "^X " nil t))))
|
|
|
|
(set 'declaration-found
|
1999-10-07 14:25:59 +00:00
|
|
|
(re-search-forward
|
|
|
|
(concat "^" (ada-line-of identlist)
|
|
|
|
"." (ada-column-of identlist)
|
Got rid of all byte-compiler warnings on Emacs.
Add to the menu when the file is loaded, not in ada-mode-hook.
Add -toolbar to the default ddd command Switches moved from
ada-prj-default-comp-cmd and ada-prj-default-make-cmd to
ada-prj-default-comp-opt
(ada-add-ada-menu): Remove the map and name parameters Add the Ada
Reference Manual to the menu
(ada-check-current): rewritten as a call to ada-compile-current
(ada-compile): Removed.
(ada-compile-application, ada-compile-current, ada-check-current):
Set the compilation-search-path so that compile.el automatically
finds the sources in src_dir. Automatic scrollong of the
compilation buffer. C-uC-cC-c asks for confirmation before
compiling
(ada-compile-current): New parameter, prj-field
(ada-complete-identifier): Load the .ali file before doing
processing
(ada-find-ali-file-in-dir): prepend build_dir to obj_dir to
conform to gnatmake's behavior.
(ada-find-file-in-dir): New function
(ada-find-references): Set the environment variables for gnatfind
(ada-find-src-file-in-dir): New function.
(ada-first-non-nil): Removed
(ada-gdb-application): Add support for jdb, the java debugger.
(ada-get-ada-file-name): Load the original-file first if not done
yet.
(ada-get-all-references): Handles the new ali syntax (parent types
are found between <>).
(ada-initialize-runtime-library): New function
(ada-mode-hook): Always load a project file when a file is opened,
so that the casing exceptions are correctly read.
(ada-operator-re): Add all missing operators ("abs", "rem", "**").
(ada-parse-prj-file): Use find-file-noselect instead of find-file
to open the project file, since the latter does not work with
speedbar Get default values before loading the prj file, or the
default executable file name is wrong. Use the absolute value of
src_dir to initialize ada-search-directories and
compilation-search-path,... Add the standard runtime library to
the search path for find-file.
(ada-prj-default-debugger): Was missing an opening '{'
(ada-prj-default-bind-opt, ada-prj-default-link-opt): New
variables.
(ada-prj-default-gnatmake-opt): New variable
(ada-prj-find-prj-file): Handles non-file buffers For non-Ada
buffers, the project file is the default one Save the windows
configuration before displaying the menu.
(ada-prj-src-dir, ada-prj-obj-dir, ada-prj-comp-opt,...): Removed
(ada-read-identifier): Fix xrefs on operators (for "mod", "and",
...) regexp-quote identifiers names to support operators +,
-,... in regexps.
(ada-remote): New function.
(ada-run-application): Erase the output buffer before starting the
run Support remote execution of the application. Use
call-process, or the arguments are incorrectly parsed
(ada-set-default-project-file): Reread the content of the active
project file, not the one from the current buffer When a project
file is set as the default project, all directories are
automatically associated with it.
(ada-set-environment): New function
(ada-treat-cmd-string): New special variable ${current}
(ada-treat-cmd-string): Revised. The substitution is now done for
any ${...} substring
(ada-xref-current): If no body was found, compiles the spec
instead. Setup ADA_{SOURCE,OBJECTS}_PATH before running the
compiler to get rid of command line length limitations.
(ada-xref-get-project-field): New function
(ada-xref-project-files): New variable
(ada-xref-runtime-library-specs-path)
(ada-xref-runtime-library-ali-path): New variables
(ada-xref-set-default-prj-values): Default run command now does a
cd to the build directory. New field: main_unit Provide a default
file name even if the current buffer has no prj file.
2000-07-24 11:13:11 +00:00
|
|
|
"[ *]" (ada-name-of identlist)
|
Update copyright notice.
(ada-xref-create-ali): The default is now not to create automatically the
ALI files by compiling the unit, since this isn't always reliable and
requires an up-to-date project file.
(ada-prj-default-comp-cmd): No longer use gcc directly to compile
a file, but use gnatmake instead, since this gives access to the GNAT
project files.
(ada-xref-search-with-egrep): New variable, suggested by P. Waroquiers.
(ada-load-project-hook): New variable, for support of GNAT project files.
(ada-update-project-menu): Fix the detection of the project file name.
(ada-add-keymap): Change key binding for ada-find-file, that conflicted
with another binding in ada-mode.el.
(ada-add-menu): New menu "List Local References", to list the reference
to the entity only in the current file, instead of looking in the whole
project. Much faster.
(ada-find-references): New parameters arg and local-only.
(ada-find-any-references): New parameters local-only and append.
(ada-goto-declaration): Fix handling of predefined entities in xref.
(ada-get-all-references): Updated to the new xref format in GNAT 3.15,
still compatible with GNAT 3.14 of course. Fix various calls to
count-lines, that didn't work correctly when the buffer was narrowed.
2002-06-20 17:31:56 +00:00
|
|
|
"[{\(<= ]?\\(.*\\)$") bound t))
|
1999-10-07 14:25:59 +00:00
|
|
|
(if declaration-found
|
|
|
|
(ada-set-on-declaration identlist t))
|
|
|
|
))
|
|
|
|
|
|
|
|
;; If declaration is still nil, then we were not on a declaration, and
|
|
|
|
;; have to fall back on other algorithms
|
|
|
|
|
|
|
|
(unless declaration-found
|
2003-02-04 13:24:35 +00:00
|
|
|
|
1999-10-07 14:25:59 +00:00
|
|
|
;; Since we alread know the number of the file, search for a direct
|
|
|
|
;; reference to it
|
|
|
|
(goto-char (point-min))
|
|
|
|
(set 'declaration-found t)
|
|
|
|
(ada-set-ali-index
|
|
|
|
identlist
|
|
|
|
(number-to-string (ada-find-file-number-in-ali
|
|
|
|
(ada-file-of identlist))))
|
|
|
|
(unless (re-search-forward (concat (ada-ali-index-of identlist)
|
Update copyright notice.
(ada-xref-create-ali): The default is now not to create automatically the
ALI files by compiling the unit, since this isn't always reliable and
requires an up-to-date project file.
(ada-prj-default-comp-cmd): No longer use gcc directly to compile
a file, but use gnatmake instead, since this gives access to the GNAT
project files.
(ada-xref-search-with-egrep): New variable, suggested by P. Waroquiers.
(ada-load-project-hook): New variable, for support of GNAT project files.
(ada-update-project-menu): Fix the detection of the project file name.
(ada-add-keymap): Change key binding for ada-find-file, that conflicted
with another binding in ada-mode.el.
(ada-add-menu): New menu "List Local References", to list the reference
to the entity only in the current file, instead of looking in the whole
project. Much faster.
(ada-find-references): New parameters arg and local-only.
(ada-find-any-references): New parameters local-only and append.
(ada-goto-declaration): Fix handling of predefined entities in xref.
(ada-get-all-references): Updated to the new xref format in GNAT 3.15,
still compatible with GNAT 3.14 of course. Fix various calls to
count-lines, that didn't work correctly when the buffer was narrowed.
2002-06-20 17:31:56 +00:00
|
|
|
"|\\([0-9]+[^0-9][0-9]+\\(\n\\.\\)? \\)*"
|
1999-10-07 14:25:59 +00:00
|
|
|
(ada-line-of identlist)
|
2003-04-29 23:40:08 +00:00
|
|
|
"[^etpzkd<>=^]"
|
Update copyright notice.
(ada-xref-create-ali): The default is now not to create automatically the
ALI files by compiling the unit, since this isn't always reliable and
requires an up-to-date project file.
(ada-prj-default-comp-cmd): No longer use gcc directly to compile
a file, but use gnatmake instead, since this gives access to the GNAT
project files.
(ada-xref-search-with-egrep): New variable, suggested by P. Waroquiers.
(ada-load-project-hook): New variable, for support of GNAT project files.
(ada-update-project-menu): Fix the detection of the project file name.
(ada-add-keymap): Change key binding for ada-find-file, that conflicted
with another binding in ada-mode.el.
(ada-add-menu): New menu "List Local References", to list the reference
to the entity only in the current file, instead of looking in the whole
project. Much faster.
(ada-find-references): New parameters arg and local-only.
(ada-find-any-references): New parameters local-only and append.
(ada-goto-declaration): Fix handling of predefined entities in xref.
(ada-get-all-references): Updated to the new xref format in GNAT 3.15,
still compatible with GNAT 3.14 of course. Fix various calls to
count-lines, that didn't work correctly when the buffer was narrowed.
2002-06-20 17:31:56 +00:00
|
|
|
(ada-column-of identlist) "\\>")
|
1999-10-07 14:25:59 +00:00
|
|
|
nil t)
|
|
|
|
|
2006-10-31 00:57:56 +00:00
|
|
|
;; if we did not find it, it may be because the first reference
|
|
|
|
;; is not required to have a 'unit_number|' item included.
|
|
|
|
;; Or maybe we are already on the declaration...
|
|
|
|
(unless (re-search-forward
|
2002-04-09 18:54:20 +00:00
|
|
|
(concat
|
Update copyright notice.
(ada-xref-create-ali): The default is now not to create automatically the
ALI files by compiling the unit, since this isn't always reliable and
requires an up-to-date project file.
(ada-prj-default-comp-cmd): No longer use gcc directly to compile
a file, but use gnatmake instead, since this gives access to the GNAT
project files.
(ada-xref-search-with-egrep): New variable, suggested by P. Waroquiers.
(ada-load-project-hook): New variable, for support of GNAT project files.
(ada-update-project-menu): Fix the detection of the project file name.
(ada-add-keymap): Change key binding for ada-find-file, that conflicted
with another binding in ada-mode.el.
(ada-add-menu): New menu "List Local References", to list the reference
to the entity only in the current file, instead of looking in the whole
project. Much faster.
(ada-find-references): New parameters arg and local-only.
(ada-find-any-references): New parameters local-only and append.
(ada-goto-declaration): Fix handling of predefined entities in xref.
(ada-get-all-references): Updated to the new xref format in GNAT 3.15,
still compatible with GNAT 3.14 of course. Fix various calls to
count-lines, that didn't work correctly when the buffer was narrowed.
2002-06-20 17:31:56 +00:00
|
|
|
"^[0-9]+.[0-9]+[ *]"
|
|
|
|
(ada-name-of identlist)
|
|
|
|
"[ <{=\(]\\(.\\|\n\\.\\)*\\<"
|
2002-04-09 18:54:20 +00:00
|
|
|
(ada-line-of identlist)
|
|
|
|
"[^0-9]"
|
Update copyright notice.
(ada-xref-create-ali): The default is now not to create automatically the
ALI files by compiling the unit, since this isn't always reliable and
requires an up-to-date project file.
(ada-prj-default-comp-cmd): No longer use gcc directly to compile
a file, but use gnatmake instead, since this gives access to the GNAT
project files.
(ada-xref-search-with-egrep): New variable, suggested by P. Waroquiers.
(ada-load-project-hook): New variable, for support of GNAT project files.
(ada-update-project-menu): Fix the detection of the project file name.
(ada-add-keymap): Change key binding for ada-find-file, that conflicted
with another binding in ada-mode.el.
(ada-add-menu): New menu "List Local References", to list the reference
to the entity only in the current file, instead of looking in the whole
project. Much faster.
(ada-find-references): New parameters arg and local-only.
(ada-find-any-references): New parameters local-only and append.
(ada-goto-declaration): Fix handling of predefined entities in xref.
(ada-get-all-references): Updated to the new xref format in GNAT 3.15,
still compatible with GNAT 3.14 of course. Fix various calls to
count-lines, that didn't work correctly when the buffer was narrowed.
2002-06-20 17:31:56 +00:00
|
|
|
(ada-column-of identlist) "\\>")
|
2002-04-09 18:54:20 +00:00
|
|
|
nil t)
|
2003-02-04 13:24:35 +00:00
|
|
|
|
1999-10-07 14:25:59 +00:00
|
|
|
;; If still not found, then either the declaration is unknown
|
|
|
|
;; or the source file has been modified since the ali file was
|
|
|
|
;; created
|
|
|
|
(set 'declaration-found nil)
|
2006-10-31 00:57:56 +00:00
|
|
|
)
|
1999-10-07 14:25:59 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
;; Last check to be completly sure we have found the correct line (the
|
|
|
|
;; ali might not be up to date for instance)
|
|
|
|
(if declaration-found
|
|
|
|
(progn
|
|
|
|
(beginning-of-line)
|
|
|
|
;; while we have a continuation line, go up one line
|
|
|
|
(while (looking-at "^\\.")
|
|
|
|
(previous-line 1))
|
|
|
|
(unless (looking-at (concat "[0-9]+.[0-9]+[ *]"
|
Update copyright notice.
(ada-xref-create-ali): The default is now not to create automatically the
ALI files by compiling the unit, since this isn't always reliable and
requires an up-to-date project file.
(ada-prj-default-comp-cmd): No longer use gcc directly to compile
a file, but use gnatmake instead, since this gives access to the GNAT
project files.
(ada-xref-search-with-egrep): New variable, suggested by P. Waroquiers.
(ada-load-project-hook): New variable, for support of GNAT project files.
(ada-update-project-menu): Fix the detection of the project file name.
(ada-add-keymap): Change key binding for ada-find-file, that conflicted
with another binding in ada-mode.el.
(ada-add-menu): New menu "List Local References", to list the reference
to the entity only in the current file, instead of looking in the whole
project. Much faster.
(ada-find-references): New parameters arg and local-only.
(ada-find-any-references): New parameters local-only and append.
(ada-goto-declaration): Fix handling of predefined entities in xref.
(ada-get-all-references): Updated to the new xref format in GNAT 3.15,
still compatible with GNAT 3.14 of course. Fix various calls to
count-lines, that didn't work correctly when the buffer was narrowed.
2002-06-20 17:31:56 +00:00
|
|
|
(ada-name-of identlist) "[ <{=\(]"))
|
1999-10-07 14:25:59 +00:00
|
|
|
(set 'declaration-found nil))))
|
|
|
|
|
|
|
|
;; Still no success ! The ali file must be too old, and we need to
|
2004-08-22 17:14:02 +00:00
|
|
|
;; use a basic algorithm based on guesses. Note that this only happens
|
1999-10-07 14:25:59 +00:00
|
|
|
;; if the user does not want us to automatically recompile files
|
|
|
|
;; automatically
|
|
|
|
(unless declaration-found
|
Got rid of all byte-compiler warnings on Emacs.
Add to the menu when the file is loaded, not in ada-mode-hook.
Add -toolbar to the default ddd command Switches moved from
ada-prj-default-comp-cmd and ada-prj-default-make-cmd to
ada-prj-default-comp-opt
(ada-add-ada-menu): Remove the map and name parameters Add the Ada
Reference Manual to the menu
(ada-check-current): rewritten as a call to ada-compile-current
(ada-compile): Removed.
(ada-compile-application, ada-compile-current, ada-check-current):
Set the compilation-search-path so that compile.el automatically
finds the sources in src_dir. Automatic scrollong of the
compilation buffer. C-uC-cC-c asks for confirmation before
compiling
(ada-compile-current): New parameter, prj-field
(ada-complete-identifier): Load the .ali file before doing
processing
(ada-find-ali-file-in-dir): prepend build_dir to obj_dir to
conform to gnatmake's behavior.
(ada-find-file-in-dir): New function
(ada-find-references): Set the environment variables for gnatfind
(ada-find-src-file-in-dir): New function.
(ada-first-non-nil): Removed
(ada-gdb-application): Add support for jdb, the java debugger.
(ada-get-ada-file-name): Load the original-file first if not done
yet.
(ada-get-all-references): Handles the new ali syntax (parent types
are found between <>).
(ada-initialize-runtime-library): New function
(ada-mode-hook): Always load a project file when a file is opened,
so that the casing exceptions are correctly read.
(ada-operator-re): Add all missing operators ("abs", "rem", "**").
(ada-parse-prj-file): Use find-file-noselect instead of find-file
to open the project file, since the latter does not work with
speedbar Get default values before loading the prj file, or the
default executable file name is wrong. Use the absolute value of
src_dir to initialize ada-search-directories and
compilation-search-path,... Add the standard runtime library to
the search path for find-file.
(ada-prj-default-debugger): Was missing an opening '{'
(ada-prj-default-bind-opt, ada-prj-default-link-opt): New
variables.
(ada-prj-default-gnatmake-opt): New variable
(ada-prj-find-prj-file): Handles non-file buffers For non-Ada
buffers, the project file is the default one Save the windows
configuration before displaying the menu.
(ada-prj-src-dir, ada-prj-obj-dir, ada-prj-comp-opt,...): Removed
(ada-read-identifier): Fix xrefs on operators (for "mod", "and",
...) regexp-quote identifiers names to support operators +,
-,... in regexps.
(ada-remote): New function.
(ada-run-application): Erase the output buffer before starting the
run Support remote execution of the application. Use
call-process, or the arguments are incorrectly parsed
(ada-set-default-project-file): Reread the content of the active
project file, not the one from the current buffer When a project
file is set as the default project, all directories are
automatically associated with it.
(ada-set-environment): New function
(ada-treat-cmd-string): New special variable ${current}
(ada-treat-cmd-string): Revised. The substitution is now done for
any ${...} substring
(ada-xref-current): If no body was found, compiles the spec
instead. Setup ADA_{SOURCE,OBJECTS}_PATH before running the
compiler to get rid of command line length limitations.
(ada-xref-get-project-field): New function
(ada-xref-project-files): New variable
(ada-xref-runtime-library-specs-path)
(ada-xref-runtime-library-ali-path): New variables
(ada-xref-set-default-prj-values): Default run command now does a
cd to the build directory. New field: main_unit Provide a default
file name even if the current buffer has no prj file.
2000-07-24 11:13:11 +00:00
|
|
|
(if (ada-xref-find-in-modified-ali identlist)
|
|
|
|
(set 'declaration-found t)
|
2004-08-22 17:14:02 +00:00
|
|
|
;; No more idea to find the declaration. Give up
|
1999-10-07 14:25:59 +00:00
|
|
|
(progn
|
|
|
|
(kill-buffer ali-buffer)
|
|
|
|
(error (concat "No declaration of " (ada-name-of identlist)
|
|
|
|
" found."))
|
|
|
|
)))
|
|
|
|
)
|
|
|
|
|
2003-02-04 13:24:35 +00:00
|
|
|
|
1999-10-07 14:25:59 +00:00
|
|
|
;; Now that we have found a suitable line in the .ali file, get the
|
|
|
|
;; information available
|
|
|
|
(beginning-of-line)
|
|
|
|
(if declaration-found
|
2006-10-31 00:57:56 +00:00
|
|
|
(let ((current-line (buffer-substring
|
1999-10-07 14:25:59 +00:00
|
|
|
(point) (save-excursion (end-of-line) (point)))))
|
2006-10-31 00:57:56 +00:00
|
|
|
(save-excursion
|
|
|
|
(next-line 1)
|
|
|
|
(beginning-of-line)
|
|
|
|
(while (looking-at "^\\.\\(.*\\)")
|
|
|
|
(set 'current-line (concat current-line (match-string 1)))
|
|
|
|
(next-line 1))
|
|
|
|
)
|
1999-10-07 14:25:59 +00:00
|
|
|
|
|
|
|
(if (re-search-backward "^X [0-9]+ \\([a-zA-Z0-9_.-]+\\)" nil t)
|
2002-04-09 18:54:20 +00:00
|
|
|
|
|
|
|
;; If we can find the file
|
|
|
|
(condition-case err
|
|
|
|
(ada-set-declare-file
|
|
|
|
identlist
|
|
|
|
(ada-get-ada-file-name (match-string 1)
|
|
|
|
(ada-file-of identlist)))
|
2003-02-04 13:24:35 +00:00
|
|
|
|
2002-04-09 18:54:20 +00:00
|
|
|
;; Else clean up the ali file
|
|
|
|
(error
|
|
|
|
(kill-buffer ali-buffer)
|
|
|
|
(error (error-message-string err)))
|
|
|
|
))
|
2003-02-04 13:24:35 +00:00
|
|
|
|
1999-10-07 14:25:59 +00:00
|
|
|
(ada-set-references identlist current-line)
|
|
|
|
))
|
|
|
|
))
|
|
|
|
|
|
|
|
(defun ada-xref-find-in-modified-ali (identlist)
|
|
|
|
"Find the matching position for IDENTLIST in the current ali buffer.
|
|
|
|
This function is only called when the file was not up-to-date, so we need
|
|
|
|
to make some guesses.
|
1999-10-28 11:12:54 +00:00
|
|
|
This function is disabled for operators, and only works for identifiers."
|
1999-10-07 14:25:59 +00:00
|
|
|
|
|
|
|
(unless (= (string-to-char (ada-name-of identlist)) ?\")
|
|
|
|
(progn
|
2006-10-31 00:57:56 +00:00
|
|
|
(let ((declist '()) ;;; ( (line_in_ali_file line_in_ada) ( ... ))
|
1999-10-07 14:25:59 +00:00
|
|
|
(my-regexp (concat "[ *]"
|
|
|
|
(regexp-quote (ada-name-of identlist)) " "))
|
|
|
|
(line-ada "--")
|
|
|
|
(col-ada "--")
|
|
|
|
(line-ali 0)
|
|
|
|
(len 0)
|
Got rid of all byte-compiler warnings on Emacs.
Add to the menu when the file is loaded, not in ada-mode-hook.
Add -toolbar to the default ddd command Switches moved from
ada-prj-default-comp-cmd and ada-prj-default-make-cmd to
ada-prj-default-comp-opt
(ada-add-ada-menu): Remove the map and name parameters Add the Ada
Reference Manual to the menu
(ada-check-current): rewritten as a call to ada-compile-current
(ada-compile): Removed.
(ada-compile-application, ada-compile-current, ada-check-current):
Set the compilation-search-path so that compile.el automatically
finds the sources in src_dir. Automatic scrollong of the
compilation buffer. C-uC-cC-c asks for confirmation before
compiling
(ada-compile-current): New parameter, prj-field
(ada-complete-identifier): Load the .ali file before doing
processing
(ada-find-ali-file-in-dir): prepend build_dir to obj_dir to
conform to gnatmake's behavior.
(ada-find-file-in-dir): New function
(ada-find-references): Set the environment variables for gnatfind
(ada-find-src-file-in-dir): New function.
(ada-first-non-nil): Removed
(ada-gdb-application): Add support for jdb, the java debugger.
(ada-get-ada-file-name): Load the original-file first if not done
yet.
(ada-get-all-references): Handles the new ali syntax (parent types
are found between <>).
(ada-initialize-runtime-library): New function
(ada-mode-hook): Always load a project file when a file is opened,
so that the casing exceptions are correctly read.
(ada-operator-re): Add all missing operators ("abs", "rem", "**").
(ada-parse-prj-file): Use find-file-noselect instead of find-file
to open the project file, since the latter does not work with
speedbar Get default values before loading the prj file, or the
default executable file name is wrong. Use the absolute value of
src_dir to initialize ada-search-directories and
compilation-search-path,... Add the standard runtime library to
the search path for find-file.
(ada-prj-default-debugger): Was missing an opening '{'
(ada-prj-default-bind-opt, ada-prj-default-link-opt): New
variables.
(ada-prj-default-gnatmake-opt): New variable
(ada-prj-find-prj-file): Handles non-file buffers For non-Ada
buffers, the project file is the default one Save the windows
configuration before displaying the menu.
(ada-prj-src-dir, ada-prj-obj-dir, ada-prj-comp-opt,...): Removed
(ada-read-identifier): Fix xrefs on operators (for "mod", "and",
...) regexp-quote identifiers names to support operators +,
-,... in regexps.
(ada-remote): New function.
(ada-run-application): Erase the output buffer before starting the
run Support remote execution of the application. Use
call-process, or the arguments are incorrectly parsed
(ada-set-default-project-file): Reread the content of the active
project file, not the one from the current buffer When a project
file is set as the default project, all directories are
automatically associated with it.
(ada-set-environment): New function
(ada-treat-cmd-string): New special variable ${current}
(ada-treat-cmd-string): Revised. The substitution is now done for
any ${...} substring
(ada-xref-current): If no body was found, compiles the spec
instead. Setup ADA_{SOURCE,OBJECTS}_PATH before running the
compiler to get rid of command line length limitations.
(ada-xref-get-project-field): New function
(ada-xref-project-files): New variable
(ada-xref-runtime-library-specs-path)
(ada-xref-runtime-library-ali-path): New variables
(ada-xref-set-default-prj-values): Default run command now does a
cd to the build directory. New field: main_unit Provide a default
file name even if the current buffer has no prj file.
2000-07-24 11:13:11 +00:00
|
|
|
(choice 0)
|
|
|
|
(ali-buffer (current-buffer)))
|
1999-10-07 14:25:59 +00:00
|
|
|
|
2006-10-31 00:57:56 +00:00
|
|
|
(goto-char (point-max))
|
|
|
|
(while (re-search-backward my-regexp nil t)
|
|
|
|
(save-excursion
|
|
|
|
(set 'line-ali (count-lines 1 (point)))
|
|
|
|
(beginning-of-line)
|
|
|
|
;; have a look at the line and column numbers
|
|
|
|
(if (looking-at "^\\([0-9]+\\).\\([0-9]+\\)[ *]")
|
|
|
|
(progn
|
|
|
|
(setq line-ada (match-string 1))
|
|
|
|
(setq col-ada (match-string 2)))
|
|
|
|
(setq line-ada "--")
|
|
|
|
(setq col-ada "--")
|
|
|
|
)
|
|
|
|
;; construct a list with the file names and the positions within
|
|
|
|
(if (re-search-backward "^X [0-9]+ \\([a-zA-Z0-9._-]+\\)" nil t)
|
1999-10-07 14:25:59 +00:00
|
|
|
(add-to-list
|
|
|
|
'declist (list line-ali (match-string 1) line-ada col-ada))
|
2006-10-31 00:57:56 +00:00
|
|
|
)
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
;; how many possible declarations have we found ?
|
|
|
|
(setq len (length declist))
|
|
|
|
(cond
|
|
|
|
;; none => error
|
|
|
|
((= len 0)
|
|
|
|
(kill-buffer (current-buffer))
|
|
|
|
(error (concat "No declaration of "
|
|
|
|
(ada-name-of identlist)
|
|
|
|
" recorded in .ali file")))
|
|
|
|
|
|
|
|
;; one => should be the right one
|
|
|
|
((= len 1)
|
|
|
|
(goto-line (caar declist)))
|
|
|
|
|
|
|
|
;; more than one => display choice list
|
|
|
|
(t
|
2002-04-09 18:54:20 +00:00
|
|
|
(save-window-excursion
|
|
|
|
(with-output-to-temp-buffer "*choice list*"
|
2003-02-04 13:24:35 +00:00
|
|
|
|
2002-04-09 18:54:20 +00:00
|
|
|
(princ "Identifier is overloaded and Xref information is not up to date.\n")
|
|
|
|
(princ "Possible declarations are:\n\n")
|
|
|
|
(princ " no. in file at line col\n")
|
|
|
|
(princ " --- --------------------- ---- ----\n")
|
|
|
|
(let ((counter 0))
|
|
|
|
(while (< counter len)
|
|
|
|
(princ (format " %2d) %-21s %4s %4s\n"
|
2006-10-31 00:57:56 +00:00
|
|
|
(1+ counter)
|
1999-10-07 14:25:59 +00:00
|
|
|
(ada-get-ada-file-name
|
2002-04-09 18:54:20 +00:00
|
|
|
(nth 1 (nth counter declist))
|
1999-10-07 14:25:59 +00:00
|
|
|
(ada-file-of identlist))
|
2006-10-31 00:57:56 +00:00
|
|
|
(nth 2 (nth counter declist))
|
|
|
|
(nth 3 (nth counter declist))
|
|
|
|
))
|
2002-04-09 18:54:20 +00:00
|
|
|
(setq counter (1+ counter))
|
|
|
|
) ; end of while
|
|
|
|
) ; end of let
|
|
|
|
) ; end of with-output-to ...
|
|
|
|
(setq choice nil)
|
|
|
|
(while (or
|
|
|
|
(not choice)
|
|
|
|
(not (integerp choice))
|
|
|
|
(< choice 1)
|
|
|
|
(> choice len))
|
|
|
|
(setq choice
|
2005-05-16 11:34:49 +00:00
|
|
|
(string-to-number
|
2002-04-09 18:54:20 +00:00
|
|
|
(read-from-minibuffer "Enter No. of your choice: "))))
|
|
|
|
)
|
Got rid of all byte-compiler warnings on Emacs.
Add to the menu when the file is loaded, not in ada-mode-hook.
Add -toolbar to the default ddd command Switches moved from
ada-prj-default-comp-cmd and ada-prj-default-make-cmd to
ada-prj-default-comp-opt
(ada-add-ada-menu): Remove the map and name parameters Add the Ada
Reference Manual to the menu
(ada-check-current): rewritten as a call to ada-compile-current
(ada-compile): Removed.
(ada-compile-application, ada-compile-current, ada-check-current):
Set the compilation-search-path so that compile.el automatically
finds the sources in src_dir. Automatic scrollong of the
compilation buffer. C-uC-cC-c asks for confirmation before
compiling
(ada-compile-current): New parameter, prj-field
(ada-complete-identifier): Load the .ali file before doing
processing
(ada-find-ali-file-in-dir): prepend build_dir to obj_dir to
conform to gnatmake's behavior.
(ada-find-file-in-dir): New function
(ada-find-references): Set the environment variables for gnatfind
(ada-find-src-file-in-dir): New function.
(ada-first-non-nil): Removed
(ada-gdb-application): Add support for jdb, the java debugger.
(ada-get-ada-file-name): Load the original-file first if not done
yet.
(ada-get-all-references): Handles the new ali syntax (parent types
are found between <>).
(ada-initialize-runtime-library): New function
(ada-mode-hook): Always load a project file when a file is opened,
so that the casing exceptions are correctly read.
(ada-operator-re): Add all missing operators ("abs", "rem", "**").
(ada-parse-prj-file): Use find-file-noselect instead of find-file
to open the project file, since the latter does not work with
speedbar Get default values before loading the prj file, or the
default executable file name is wrong. Use the absolute value of
src_dir to initialize ada-search-directories and
compilation-search-path,... Add the standard runtime library to
the search path for find-file.
(ada-prj-default-debugger): Was missing an opening '{'
(ada-prj-default-bind-opt, ada-prj-default-link-opt): New
variables.
(ada-prj-default-gnatmake-opt): New variable
(ada-prj-find-prj-file): Handles non-file buffers For non-Ada
buffers, the project file is the default one Save the windows
configuration before displaying the menu.
(ada-prj-src-dir, ada-prj-obj-dir, ada-prj-comp-opt,...): Removed
(ada-read-identifier): Fix xrefs on operators (for "mod", "and",
...) regexp-quote identifiers names to support operators +,
-,... in regexps.
(ada-remote): New function.
(ada-run-application): Erase the output buffer before starting the
run Support remote execution of the application. Use
call-process, or the arguments are incorrectly parsed
(ada-set-default-project-file): Reread the content of the active
project file, not the one from the current buffer When a project
file is set as the default project, all directories are
automatically associated with it.
(ada-set-environment): New function
(ada-treat-cmd-string): New special variable ${current}
(ada-treat-cmd-string): Revised. The substitution is now done for
any ${...} substring
(ada-xref-current): If no body was found, compiles the spec
instead. Setup ADA_{SOURCE,OBJECTS}_PATH before running the
compiler to get rid of command line length limitations.
(ada-xref-get-project-field): New function
(ada-xref-project-files): New variable
(ada-xref-runtime-library-specs-path)
(ada-xref-runtime-library-ali-path): New variables
(ada-xref-set-default-prj-values): Default run command now does a
cd to the build directory. New field: main_unit Provide a default
file name even if the current buffer has no prj file.
2000-07-24 11:13:11 +00:00
|
|
|
(set-buffer ali-buffer)
|
2006-10-31 00:57:56 +00:00
|
|
|
(goto-line (car (nth (1- choice) declist)))
|
|
|
|
))))))
|
1999-10-07 14:25:59 +00:00
|
|
|
|
|
|
|
|
|
|
|
(defun ada-find-in-ali (identlist &optional other-frame)
|
1999-10-28 11:12:54 +00:00
|
|
|
"Look in the .ali file for the definition of the identifier in IDENTLIST.
|
|
|
|
If OTHER-FRAME is non nil, and `ada-xref-other-buffer' is non nil,
|
|
|
|
opens a new window to show the declaration."
|
1999-10-07 14:25:59 +00:00
|
|
|
|
|
|
|
(ada-get-all-references identlist)
|
|
|
|
(let ((ali-line (ada-references-of identlist))
|
2002-04-09 18:54:20 +00:00
|
|
|
(locations nil)
|
|
|
|
(start 0)
|
1999-10-07 14:25:59 +00:00
|
|
|
file line col)
|
2002-04-09 18:54:20 +00:00
|
|
|
|
|
|
|
;; Note: in some cases, an entity can have multiple references to the
|
|
|
|
;; bodies (this is for instance the case for a separate subprogram, that
|
|
|
|
;; has a reference both to the stub and to the real body).
|
|
|
|
;; In that case, we simply go to each one in turn.
|
|
|
|
|
|
|
|
;; Get all the possible locations
|
|
|
|
(string-match "^\\([0-9]+\\)[a-zA-Z+]\\([0-9]+\\)[ *]" ali-line)
|
|
|
|
(set 'locations (list (list (match-string 1 ali-line) ;; line
|
|
|
|
(match-string 2 ali-line) ;; column
|
|
|
|
(ada-declare-file-of identlist))))
|
2003-04-29 23:40:08 +00:00
|
|
|
(while (string-match "\\([0-9]+\\)[bc]\\(<[^>]+>\\)?\\([0-9]+\\)"
|
|
|
|
ali-line start)
|
2002-04-09 18:54:20 +00:00
|
|
|
(setq line (match-string 1 ali-line)
|
2003-04-29 23:40:08 +00:00
|
|
|
col (match-string 3 ali-line)
|
|
|
|
start (match-end 3))
|
2002-04-09 18:54:20 +00:00
|
|
|
|
|
|
|
;; it there was a file number in the same line
|
2003-04-29 23:40:08 +00:00
|
|
|
(if (string-match (concat "[^{(<]\\([0-9]+\\)|\\([^|bc]+\\)?"
|
2002-04-09 18:54:20 +00:00
|
|
|
(match-string 0 ali-line))
|
|
|
|
ali-line)
|
|
|
|
(let ((file-number (match-string 1 ali-line)))
|
|
|
|
(goto-char (point-min))
|
|
|
|
(re-search-forward "^D \\([a-zA-Z0-9_.-]+\\)" nil t
|
|
|
|
(string-to-number file-number))
|
|
|
|
(set 'file (match-string 1))
|
|
|
|
)
|
|
|
|
;; Else get the nearest file
|
|
|
|
(set 'file (ada-declare-file-of identlist)))
|
2003-02-04 13:24:35 +00:00
|
|
|
|
2002-04-09 18:54:20 +00:00
|
|
|
(set 'locations (append locations (list (list line col file)))))
|
|
|
|
|
|
|
|
;; Add the specs at the end again, so that from the last body we go to
|
|
|
|
;; the specs
|
|
|
|
(set 'locations (append locations (list (car locations))))
|
|
|
|
|
|
|
|
;; Find the new location we want to go to.
|
|
|
|
;; If we are on none of the locations listed, we simply go to the specs.
|
|
|
|
|
|
|
|
(setq line (caar locations)
|
|
|
|
col (nth 1 (car locations))
|
|
|
|
file (nth 2 (car locations)))
|
2003-02-04 13:24:35 +00:00
|
|
|
|
2002-04-09 18:54:20 +00:00
|
|
|
(while locations
|
|
|
|
(if (and (string= (caar locations) (ada-line-of identlist))
|
|
|
|
(string= (nth 1 (car locations)) (ada-column-of identlist))
|
|
|
|
(string= (file-name-nondirectory (nth 2 (car locations)))
|
|
|
|
(file-name-nondirectory (ada-file-of identlist))))
|
|
|
|
(setq locations (cadr locations)
|
|
|
|
line (car locations)
|
|
|
|
col (nth 1 locations)
|
|
|
|
file (nth 2 locations)
|
|
|
|
locations nil)
|
|
|
|
(set 'locations (cdr locations))))
|
|
|
|
|
|
|
|
;; Find the file in the source path
|
|
|
|
(set 'file (ada-get-ada-file-name file (ada-file-of identlist)))
|
|
|
|
|
|
|
|
;; Kill the .ali buffer
|
|
|
|
(kill-buffer (current-buffer))
|
1999-10-07 14:25:59 +00:00
|
|
|
|
|
|
|
;; Now go to the buffer
|
2002-04-09 18:54:20 +00:00
|
|
|
(ada-xref-change-buffer file
|
|
|
|
(string-to-number line)
|
|
|
|
(1- (string-to-number col))
|
|
|
|
identlist
|
|
|
|
other-frame)
|
1999-10-07 14:25:59 +00:00
|
|
|
))
|
|
|
|
|
2002-04-09 18:54:20 +00:00
|
|
|
(defun ada-find-in-src-path (identlist &optional other-frame)
|
|
|
|
"More general function for cross-references.
|
|
|
|
This function should be used when the standard algorithm that parses the
|
|
|
|
.ali file has failed, either because that file was too old or even did not
|
|
|
|
exist.
|
|
|
|
This function attempts to find the possible declarations for the identifier
|
|
|
|
anywhere in the object path.
|
|
|
|
This command requires the external `egrep' program to be available.
|
|
|
|
|
|
|
|
This works well when one is using an external librarie and wants
|
|
|
|
to find the declaration and documentation of the subprograms one is
|
|
|
|
is using."
|
2006-10-31 00:57:56 +00:00
|
|
|
;; FIXME: what does this function do?
|
2002-04-09 18:54:20 +00:00
|
|
|
(let (list
|
|
|
|
(dirs (ada-xref-get-obj-dir-field))
|
|
|
|
(regexp (concat "[ *]" (ada-name-of identlist)))
|
|
|
|
line column
|
|
|
|
choice
|
|
|
|
file)
|
2003-02-04 13:24:35 +00:00
|
|
|
|
2002-04-09 18:54:20 +00:00
|
|
|
(save-excursion
|
2003-02-04 13:24:35 +00:00
|
|
|
|
2004-08-22 17:14:02 +00:00
|
|
|
;; Do the grep in all the directories. We do multiple shell
|
2002-04-09 18:54:20 +00:00
|
|
|
;; commands instead of one in case there is no .ali file in one
|
|
|
|
;; of the directory and the shell stops because of that.
|
2003-02-04 13:24:35 +00:00
|
|
|
|
2002-04-09 18:54:20 +00:00
|
|
|
(set-buffer (get-buffer-create "*grep*"))
|
|
|
|
(while dirs
|
|
|
|
(insert (shell-command-to-string
|
2006-10-15 20:41:42 +00:00
|
|
|
(concat
|
|
|
|
"grep -E -i -h "
|
|
|
|
(shell-quote-argument (concat "^X|" regexp "( |$)"))
|
|
|
|
" "
|
|
|
|
(shell-quote-argument (file-name-as-directory (car dirs)))
|
|
|
|
"*.ali")))
|
2002-04-09 18:54:20 +00:00
|
|
|
(set 'dirs (cdr dirs)))
|
2003-02-04 13:24:35 +00:00
|
|
|
|
2002-04-09 18:54:20 +00:00
|
|
|
;; Now parse the output
|
|
|
|
(set 'case-fold-search t)
|
|
|
|
(goto-char (point-min))
|
|
|
|
(while (re-search-forward regexp nil t)
|
|
|
|
(save-excursion
|
|
|
|
(beginning-of-line)
|
|
|
|
(if (not (= (char-after) ?X))
|
|
|
|
(progn
|
|
|
|
(looking-at "\\([0-9]+\\).\\([0-9]+\\)")
|
|
|
|
(setq line (match-string 1)
|
|
|
|
column (match-string 2))
|
|
|
|
(re-search-backward "^X [0-9]+ \\(.*\\)$")
|
|
|
|
(set 'file (list (match-string 1) line column))
|
2003-02-04 13:24:35 +00:00
|
|
|
|
2002-04-09 18:54:20 +00:00
|
|
|
;; There could be duplicate choices, because of the structure
|
|
|
|
;; of the .ali files
|
|
|
|
(unless (member file list)
|
|
|
|
(set 'list (append list (list file))))))))
|
2003-02-04 13:24:35 +00:00
|
|
|
|
2002-04-09 18:54:20 +00:00
|
|
|
;; Current buffer is still "*grep*"
|
|
|
|
(kill-buffer "*grep*")
|
|
|
|
)
|
2003-02-04 13:24:35 +00:00
|
|
|
|
2002-04-09 18:54:20 +00:00
|
|
|
;; Now display the list of possible matches
|
|
|
|
(cond
|
2003-02-04 13:24:35 +00:00
|
|
|
|
2002-04-09 18:54:20 +00:00
|
|
|
;; No choice found => Error
|
|
|
|
((null list)
|
|
|
|
(error "No cross-reference found, please recompile your file"))
|
2003-02-04 13:24:35 +00:00
|
|
|
|
2002-04-09 18:54:20 +00:00
|
|
|
;; Only one choice => Do the cross-reference
|
|
|
|
((= (length list) 1)
|
|
|
|
(set 'file (ada-find-src-file-in-dir (caar list)))
|
|
|
|
(if file
|
|
|
|
(ada-xref-change-buffer file
|
|
|
|
(string-to-number (nth 1 (car list)))
|
|
|
|
(string-to-number (nth 2 (car list)))
|
|
|
|
identlist
|
|
|
|
other-frame)
|
|
|
|
(error (concat (caar list) " not found in src_dir")))
|
|
|
|
(message "This is only a (good) guess at the cross-reference.")
|
|
|
|
)
|
2003-02-04 13:24:35 +00:00
|
|
|
|
2002-04-09 18:54:20 +00:00
|
|
|
;; Else, ask the user
|
|
|
|
(t
|
|
|
|
(save-window-excursion
|
|
|
|
(with-output-to-temp-buffer "*choice list*"
|
2003-02-04 13:24:35 +00:00
|
|
|
|
2002-04-09 18:54:20 +00:00
|
|
|
(princ "Identifier is overloaded and Xref information is not up to date.\n")
|
|
|
|
(princ "Possible declarations are:\n\n")
|
|
|
|
(princ " no. in file at line col\n")
|
|
|
|
(princ " --- --------------------- ---- ----\n")
|
|
|
|
(let ((counter 0))
|
|
|
|
(while (< counter (length list))
|
|
|
|
(princ (format " %2d) %-21s %4s %4s\n"
|
|
|
|
(1+ counter)
|
|
|
|
(nth 0 (nth counter list))
|
|
|
|
(nth 1 (nth counter list))
|
|
|
|
(nth 2 (nth counter list))
|
|
|
|
))
|
|
|
|
(setq counter (1+ counter))
|
|
|
|
)))
|
|
|
|
(setq choice nil)
|
|
|
|
(while (or (not choice)
|
|
|
|
(not (integerp choice))
|
|
|
|
(< choice 1)
|
|
|
|
(> choice (length list)))
|
|
|
|
(setq choice
|
2005-05-16 11:34:49 +00:00
|
|
|
(string-to-number
|
2002-04-09 18:54:20 +00:00
|
|
|
(read-from-minibuffer "Enter No. of your choice: "))))
|
|
|
|
)
|
|
|
|
(set 'choice (1- choice))
|
|
|
|
(kill-buffer "*choice list*")
|
|
|
|
|
|
|
|
(set 'file (ada-find-src-file-in-dir (car (nth choice list))))
|
|
|
|
(if file
|
|
|
|
(ada-xref-change-buffer file
|
|
|
|
(string-to-number (nth 1 (nth choice list)))
|
|
|
|
(string-to-number (nth 2 (nth choice list)))
|
|
|
|
identlist
|
|
|
|
other-frame)
|
|
|
|
(error (concat (car (nth choice list)) " not found in src_dir")))
|
|
|
|
(message "This is only a (good) guess at the cross-reference.")
|
|
|
|
))))
|
|
|
|
|
1999-10-07 14:25:59 +00:00
|
|
|
(defun ada-xref-change-buffer
|
|
|
|
(file line column identlist &optional other-frame)
|
2002-04-09 18:54:20 +00:00
|
|
|
"Select and display FILE, at LINE and COLUMN.
|
1999-10-07 14:25:59 +00:00
|
|
|
If we do not end on the same identifier as IDENTLIST, find the closest
|
2004-08-22 17:14:02 +00:00
|
|
|
match. Kills the .ali buffer at the end.
|
1999-10-28 11:12:54 +00:00
|
|
|
If OTHER-FRAME is non-nil, creates a new frame to show the file."
|
1999-10-07 14:25:59 +00:00
|
|
|
|
2002-04-09 18:54:20 +00:00
|
|
|
(let (declaration-buffer)
|
1999-10-07 14:25:59 +00:00
|
|
|
|
|
|
|
;; Select and display the destination buffer
|
|
|
|
(if ada-xref-other-buffer
|
2006-10-31 00:57:56 +00:00
|
|
|
(if other-frame
|
|
|
|
(find-file-other-frame file)
|
|
|
|
(set 'declaration-buffer (find-file-noselect file))
|
|
|
|
(set-buffer declaration-buffer)
|
|
|
|
(switch-to-buffer-other-window declaration-buffer)
|
|
|
|
)
|
1999-10-07 14:25:59 +00:00
|
|
|
(find-file file)
|
|
|
|
)
|
|
|
|
|
|
|
|
;; move the cursor to the correct position
|
|
|
|
(push-mark)
|
|
|
|
(goto-line line)
|
|
|
|
(move-to-column column)
|
|
|
|
|
|
|
|
;; If we are not on the identifier, the ali file was not up-to-date.
|
|
|
|
;; Try to find the nearest position where the identifier is found,
|
|
|
|
;; this is probably the right one.
|
|
|
|
(unless (looking-at (ada-name-of identlist))
|
|
|
|
(ada-xref-search-nearest (ada-name-of identlist)))
|
2002-04-09 18:54:20 +00:00
|
|
|
))
|
1999-10-07 14:25:59 +00:00
|
|
|
|
|
|
|
|
|
|
|
(defun ada-xref-search-nearest (name)
|
2006-10-31 00:57:56 +00:00
|
|
|
"Search for NAME nearest to the position recorded in the Xref file.
|
|
|
|
Return the position of the declaration in the buffer, or nil if not found."
|
1999-10-07 14:25:59 +00:00
|
|
|
(let ((orgpos (point))
|
2006-10-31 00:57:56 +00:00
|
|
|
(newpos nil)
|
|
|
|
(diff nil))
|
1999-10-07 14:25:59 +00:00
|
|
|
|
|
|
|
(goto-char (point-max))
|
|
|
|
|
|
|
|
;; loop - look for all declarations of name in this file
|
|
|
|
(while (search-backward name nil t)
|
|
|
|
|
|
|
|
;; check if it really is a complete Ada identifier
|
|
|
|
(if (and
|
2006-10-31 00:57:56 +00:00
|
|
|
(not (save-excursion
|
|
|
|
(goto-char (match-end 0))
|
|
|
|
(looking-at "_")))
|
|
|
|
(not (ada-in-string-or-comment-p))
|
|
|
|
(or
|
|
|
|
;; variable declaration ?
|
|
|
|
(save-excursion
|
|
|
|
(skip-chars-forward "a-zA-Z_0-9" )
|
|
|
|
(ada-goto-next-non-ws)
|
|
|
|
(looking-at ":[^=]"))
|
|
|
|
;; procedure, function, task or package declaration ?
|
|
|
|
(save-excursion
|
|
|
|
(ada-goto-previous-word)
|
|
|
|
(looking-at "\\<[pP][rR][oO][cC][eE][dD][uU][rR][eE]\\>\\|\\<[fF][uU][nN][cC][tT][iI][oO][nN]\\>\\|\\<[tT][yY][pP][eE]\\>\\|\\<[tT][aA][sS][kK]\\>\\|\\<[pP][aA][cC][kK][aA][gG][eE]\\>\\|\\<[bB][oO][dD][yY]\\>"))))
|
|
|
|
|
|
|
|
;; check if it is nearer than the ones before if any
|
|
|
|
(if (or (not diff)
|
|
|
|
(< (abs (- (point) orgpos)) diff))
|
|
|
|
(progn
|
|
|
|
(setq newpos (point)
|
1999-10-07 14:25:59 +00:00
|
|
|
diff (abs (- newpos orgpos))))))
|
|
|
|
)
|
|
|
|
|
|
|
|
(if newpos
|
2006-10-31 00:57:56 +00:00
|
|
|
(progn
|
|
|
|
(message "ATTENTION: this declaration is only a (good) guess ...")
|
|
|
|
(goto-char newpos))
|
1999-10-07 14:25:59 +00:00
|
|
|
nil)))
|
|
|
|
|
|
|
|
|
|
|
|
;; Find the parent library file of the current file
|
|
|
|
(defun ada-goto-parent ()
|
1999-10-28 11:12:54 +00:00
|
|
|
"Go to the parent library file."
|
1999-10-07 14:25:59 +00:00
|
|
|
(interactive)
|
|
|
|
(ada-require-project-file)
|
|
|
|
|
|
|
|
(let ((buffer (ada-get-ali-buffer (buffer-file-name)))
|
2006-10-31 00:57:56 +00:00
|
|
|
(unit-name nil)
|
|
|
|
(body-name nil)
|
|
|
|
(ali-name nil))
|
1999-10-07 14:25:59 +00:00
|
|
|
(save-excursion
|
|
|
|
(set-buffer buffer)
|
|
|
|
(goto-char (point-min))
|
|
|
|
(re-search-forward "^U \\([^ \t%]+\\)%[bs][ \t]+\\([^ \t]+\\)")
|
|
|
|
(setq unit-name (match-string 1))
|
|
|
|
(if (not (string-match "\\(.*\\)\\.[^.]+" unit-name))
|
2006-10-31 00:57:56 +00:00
|
|
|
(progn
|
|
|
|
(kill-buffer buffer)
|
|
|
|
(error "No parent unit !"))
|
|
|
|
(setq unit-name (match-string 1 unit-name))
|
|
|
|
)
|
1999-10-07 14:25:59 +00:00
|
|
|
|
|
|
|
;; look for the file name for the parent unit specification
|
|
|
|
(goto-char (point-min))
|
|
|
|
(re-search-forward (concat "^W " unit-name
|
2006-10-31 00:57:56 +00:00
|
|
|
"%s[ \t]+\\([^ \t]+\\)[ \t]+"
|
|
|
|
"\\([^ \t\n]+\\)"))
|
1999-10-07 14:25:59 +00:00
|
|
|
(setq body-name (match-string 1))
|
|
|
|
(setq ali-name (match-string 2))
|
|
|
|
(kill-buffer buffer)
|
|
|
|
)
|
|
|
|
|
|
|
|
(setq ali-name (ada-find-ali-file-in-dir ali-name))
|
|
|
|
|
|
|
|
(save-excursion
|
|
|
|
;; Tries to open the new ali file to find the spec file
|
|
|
|
(if ali-name
|
2006-10-31 00:57:56 +00:00
|
|
|
(progn
|
|
|
|
(find-file ali-name)
|
|
|
|
(goto-char (point-min))
|
|
|
|
(re-search-forward (concat "^U " unit-name "%s[ \t]+"
|
|
|
|
"\\([^ \t]+\\)"))
|
|
|
|
(setq body-name (match-string 1))
|
|
|
|
(kill-buffer (current-buffer))
|
|
|
|
)
|
|
|
|
)
|
1999-10-07 14:25:59 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
(find-file body-name)
|
|
|
|
))
|
|
|
|
|
|
|
|
(defun ada-make-filename-from-adaname (adaname)
|
1999-10-28 11:12:54 +00:00
|
|
|
"Determine the filename in which ADANAME is found.
|
|
|
|
This is a GNAT specific function that uses gnatkrunch."
|
1999-10-07 14:25:59 +00:00
|
|
|
(let (krunch-buf)
|
|
|
|
(setq krunch-buf (generate-new-buffer "*gkrunch*"))
|
|
|
|
(save-excursion
|
|
|
|
(set-buffer krunch-buf)
|
|
|
|
;; send adaname to external process `gnatkr'.
|
|
|
|
(call-process "gnatkr" nil krunch-buf nil
|
2006-10-31 00:57:56 +00:00
|
|
|
adaname ada-krunch-args)
|
1999-10-07 14:25:59 +00:00
|
|
|
;; fetch output of that process
|
|
|
|
(setq adaname (buffer-substring
|
2006-10-31 00:57:56 +00:00
|
|
|
(point-min)
|
|
|
|
(progn
|
|
|
|
(goto-char (point-min))
|
|
|
|
(end-of-line)
|
|
|
|
(point))))
|
1999-10-07 14:25:59 +00:00
|
|
|
(kill-buffer krunch-buf)))
|
|
|
|
adaname
|
|
|
|
)
|
|
|
|
|
2004-11-01 07:44:08 +00:00
|
|
|
(defun ada-make-body-gnatstub (&optional interactive)
|
1999-10-07 14:25:59 +00:00
|
|
|
"Create an Ada package body in the current buffer.
|
|
|
|
This function uses the `gnatstub' program to create the body.
|
|
|
|
This function typically is to be hooked into `ff-file-created-hooks'."
|
2004-11-01 07:44:08 +00:00
|
|
|
(interactive "p")
|
1999-10-07 14:25:59 +00:00
|
|
|
|
|
|
|
(save-some-buffers nil nil)
|
|
|
|
|
2002-04-09 18:54:20 +00:00
|
|
|
;; If the current buffer is the body (as is the case when calling this
|
|
|
|
;; function from ff-file-created-hooks), then kill this temporary buffer
|
2004-11-01 07:44:08 +00:00
|
|
|
(unless interactive
|
2002-04-09 18:54:20 +00:00
|
|
|
(progn
|
|
|
|
(set-buffer-modified-p nil)
|
|
|
|
(kill-buffer (current-buffer))))
|
2003-02-04 13:24:35 +00:00
|
|
|
|
1999-10-07 14:25:59 +00:00
|
|
|
|
2002-04-09 18:54:20 +00:00
|
|
|
;; Make sure the current buffer is the spec (this might not be the case
|
|
|
|
;; if for instance the user was asked for a project file)
|
|
|
|
|
|
|
|
(unless (buffer-file-name (car (buffer-list)))
|
|
|
|
(set-buffer (cadr (buffer-list))))
|
|
|
|
|
2004-08-22 17:14:02 +00:00
|
|
|
;; Make sure we have a project file (for parameters to gnatstub). Note that
|
2002-04-09 18:54:20 +00:00
|
|
|
;; this might have already been done if we have been called from the hook,
|
|
|
|
;; but this is not an expensive call)
|
|
|
|
(ada-require-project-file)
|
1999-10-07 14:25:59 +00:00
|
|
|
|
|
|
|
;; Call the external process gnatstub
|
|
|
|
(let* ((gnatstub-opts (ada-treat-cmd-string ada-gnatstub-opts))
|
2006-10-31 00:57:56 +00:00
|
|
|
(filename (buffer-file-name (car (buffer-list))))
|
|
|
|
(output (concat (file-name-sans-extension filename) ".adb"))
|
|
|
|
(gnatstub-cmd (concat "gnatstub " gnatstub-opts " " filename))
|
|
|
|
(buffer (get-buffer-create "*gnatstub*")))
|
1999-10-07 14:25:59 +00:00
|
|
|
|
|
|
|
(save-excursion
|
|
|
|
(set-buffer buffer)
|
|
|
|
(compilation-minor-mode 1)
|
|
|
|
(erase-buffer)
|
|
|
|
(insert gnatstub-cmd)
|
|
|
|
(newline)
|
|
|
|
)
|
|
|
|
;; call gnatstub to create the body file
|
|
|
|
(call-process shell-file-name nil buffer nil "-c" gnatstub-cmd)
|
|
|
|
|
|
|
|
(if (save-excursion
|
2006-10-31 00:57:56 +00:00
|
|
|
(set-buffer buffer)
|
|
|
|
(goto-char (point-min))
|
|
|
|
(search-forward "command not found" nil t))
|
|
|
|
(progn
|
|
|
|
(message "gnatstub was not found -- using the basic algorithm")
|
|
|
|
(sleep-for 2)
|
|
|
|
(kill-buffer buffer)
|
|
|
|
(ada-make-body))
|
1999-10-07 14:25:59 +00:00
|
|
|
|
|
|
|
;; Else clean up the output
|
|
|
|
|
|
|
|
(if (file-exists-p output)
|
2006-10-31 00:57:56 +00:00
|
|
|
(progn
|
|
|
|
(find-file output)
|
|
|
|
(kill-buffer buffer))
|
1999-10-07 14:25:59 +00:00
|
|
|
|
2006-10-31 00:57:56 +00:00
|
|
|
;; display the error buffer
|
|
|
|
(display-buffer buffer)
|
|
|
|
)
|
1999-10-07 14:25:59 +00:00
|
|
|
)))
|
|
|
|
|
|
|
|
(defun ada-xref-initialize ()
|
2001-07-16 13:38:53 +00:00
|
|
|
"Function called by `ada-mode-hook' to initialize the ada-xref.el package.
|
|
|
|
For instance, it creates the gnat-specific menus, sets some hooks for
|
1999-10-07 14:25:59 +00:00
|
|
|
find-file...."
|
2001-07-16 13:38:53 +00:00
|
|
|
;; This should really be an `add-hook'. -stef
|
2003-05-04 19:54:00 +00:00
|
|
|
(setq ff-file-created-hook 'ada-make-body-gnatstub)
|
1999-10-07 14:25:59 +00:00
|
|
|
|
|
|
|
;; Completion for file names in the mini buffer should ignore .ali files
|
|
|
|
(add-to-list 'completion-ignored-extensions ".ali")
|
2003-04-29 23:40:08 +00:00
|
|
|
|
|
|
|
(ada-xref-update-project-menu)
|
1999-10-07 14:25:59 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
;; ----- Add to ada-mode-hook ---------------------------------------------
|
|
|
|
|
2002-04-09 18:54:20 +00:00
|
|
|
;; This must be done before initializing the Ada menu.
|
1999-10-07 14:25:59 +00:00
|
|
|
(add-hook 'ada-mode-hook 'ada-xref-initialize)
|
|
|
|
|
Got rid of all byte-compiler warnings on Emacs.
Add to the menu when the file is loaded, not in ada-mode-hook.
Add -toolbar to the default ddd command Switches moved from
ada-prj-default-comp-cmd and ada-prj-default-make-cmd to
ada-prj-default-comp-opt
(ada-add-ada-menu): Remove the map and name parameters Add the Ada
Reference Manual to the menu
(ada-check-current): rewritten as a call to ada-compile-current
(ada-compile): Removed.
(ada-compile-application, ada-compile-current, ada-check-current):
Set the compilation-search-path so that compile.el automatically
finds the sources in src_dir. Automatic scrollong of the
compilation buffer. C-uC-cC-c asks for confirmation before
compiling
(ada-compile-current): New parameter, prj-field
(ada-complete-identifier): Load the .ali file before doing
processing
(ada-find-ali-file-in-dir): prepend build_dir to obj_dir to
conform to gnatmake's behavior.
(ada-find-file-in-dir): New function
(ada-find-references): Set the environment variables for gnatfind
(ada-find-src-file-in-dir): New function.
(ada-first-non-nil): Removed
(ada-gdb-application): Add support for jdb, the java debugger.
(ada-get-ada-file-name): Load the original-file first if not done
yet.
(ada-get-all-references): Handles the new ali syntax (parent types
are found between <>).
(ada-initialize-runtime-library): New function
(ada-mode-hook): Always load a project file when a file is opened,
so that the casing exceptions are correctly read.
(ada-operator-re): Add all missing operators ("abs", "rem", "**").
(ada-parse-prj-file): Use find-file-noselect instead of find-file
to open the project file, since the latter does not work with
speedbar Get default values before loading the prj file, or the
default executable file name is wrong. Use the absolute value of
src_dir to initialize ada-search-directories and
compilation-search-path,... Add the standard runtime library to
the search path for find-file.
(ada-prj-default-debugger): Was missing an opening '{'
(ada-prj-default-bind-opt, ada-prj-default-link-opt): New
variables.
(ada-prj-default-gnatmake-opt): New variable
(ada-prj-find-prj-file): Handles non-file buffers For non-Ada
buffers, the project file is the default one Save the windows
configuration before displaying the menu.
(ada-prj-src-dir, ada-prj-obj-dir, ada-prj-comp-opt,...): Removed
(ada-read-identifier): Fix xrefs on operators (for "mod", "and",
...) regexp-quote identifiers names to support operators +,
-,... in regexps.
(ada-remote): New function.
(ada-run-application): Erase the output buffer before starting the
run Support remote execution of the application. Use
call-process, or the arguments are incorrectly parsed
(ada-set-default-project-file): Reread the content of the active
project file, not the one from the current buffer When a project
file is set as the default project, all directories are
automatically associated with it.
(ada-set-environment): New function
(ada-treat-cmd-string): New special variable ${current}
(ada-treat-cmd-string): Revised. The substitution is now done for
any ${...} substring
(ada-xref-current): If no body was found, compiles the spec
instead. Setup ADA_{SOURCE,OBJECTS}_PATH before running the
compiler to get rid of command line length limitations.
(ada-xref-get-project-field): New function
(ada-xref-project-files): New variable
(ada-xref-runtime-library-specs-path)
(ada-xref-runtime-library-ali-path): New variables
(ada-xref-set-default-prj-values): Default run command now does a
cd to the build directory. New field: main_unit Provide a default
file name even if the current buffer has no prj file.
2000-07-24 11:13:11 +00:00
|
|
|
;; Initializes the cross references to the runtime library
|
2002-04-09 18:54:20 +00:00
|
|
|
(ada-initialize-runtime-library "")
|
Got rid of all byte-compiler warnings on Emacs.
Add to the menu when the file is loaded, not in ada-mode-hook.
Add -toolbar to the default ddd command Switches moved from
ada-prj-default-comp-cmd and ada-prj-default-make-cmd to
ada-prj-default-comp-opt
(ada-add-ada-menu): Remove the map and name parameters Add the Ada
Reference Manual to the menu
(ada-check-current): rewritten as a call to ada-compile-current
(ada-compile): Removed.
(ada-compile-application, ada-compile-current, ada-check-current):
Set the compilation-search-path so that compile.el automatically
finds the sources in src_dir. Automatic scrollong of the
compilation buffer. C-uC-cC-c asks for confirmation before
compiling
(ada-compile-current): New parameter, prj-field
(ada-complete-identifier): Load the .ali file before doing
processing
(ada-find-ali-file-in-dir): prepend build_dir to obj_dir to
conform to gnatmake's behavior.
(ada-find-file-in-dir): New function
(ada-find-references): Set the environment variables for gnatfind
(ada-find-src-file-in-dir): New function.
(ada-first-non-nil): Removed
(ada-gdb-application): Add support for jdb, the java debugger.
(ada-get-ada-file-name): Load the original-file first if not done
yet.
(ada-get-all-references): Handles the new ali syntax (parent types
are found between <>).
(ada-initialize-runtime-library): New function
(ada-mode-hook): Always load a project file when a file is opened,
so that the casing exceptions are correctly read.
(ada-operator-re): Add all missing operators ("abs", "rem", "**").
(ada-parse-prj-file): Use find-file-noselect instead of find-file
to open the project file, since the latter does not work with
speedbar Get default values before loading the prj file, or the
default executable file name is wrong. Use the absolute value of
src_dir to initialize ada-search-directories and
compilation-search-path,... Add the standard runtime library to
the search path for find-file.
(ada-prj-default-debugger): Was missing an opening '{'
(ada-prj-default-bind-opt, ada-prj-default-link-opt): New
variables.
(ada-prj-default-gnatmake-opt): New variable
(ada-prj-find-prj-file): Handles non-file buffers For non-Ada
buffers, the project file is the default one Save the windows
configuration before displaying the menu.
(ada-prj-src-dir, ada-prj-obj-dir, ada-prj-comp-opt,...): Removed
(ada-read-identifier): Fix xrefs on operators (for "mod", "and",
...) regexp-quote identifiers names to support operators +,
-,... in regexps.
(ada-remote): New function.
(ada-run-application): Erase the output buffer before starting the
run Support remote execution of the application. Use
call-process, or the arguments are incorrectly parsed
(ada-set-default-project-file): Reread the content of the active
project file, not the one from the current buffer When a project
file is set as the default project, all directories are
automatically associated with it.
(ada-set-environment): New function
(ada-treat-cmd-string): New special variable ${current}
(ada-treat-cmd-string): Revised. The substitution is now done for
any ${...} substring
(ada-xref-current): If no body was found, compiles the spec
instead. Setup ADA_{SOURCE,OBJECTS}_PATH before running the
compiler to get rid of command line length limitations.
(ada-xref-get-project-field): New function
(ada-xref-project-files): New variable
(ada-xref-runtime-library-specs-path)
(ada-xref-runtime-library-ali-path): New variables
(ada-xref-set-default-prj-values): Default run command now does a
cd to the build directory. New field: main_unit Provide a default
file name even if the current buffer has no prj file.
2000-07-24 11:13:11 +00:00
|
|
|
|
|
|
|
;; Add these standard directories to the search path
|
2003-05-04 19:54:00 +00:00
|
|
|
(set 'ada-search-directories-internal
|
Got rid of all byte-compiler warnings on Emacs.
Add to the menu when the file is loaded, not in ada-mode-hook.
Add -toolbar to the default ddd command Switches moved from
ada-prj-default-comp-cmd and ada-prj-default-make-cmd to
ada-prj-default-comp-opt
(ada-add-ada-menu): Remove the map and name parameters Add the Ada
Reference Manual to the menu
(ada-check-current): rewritten as a call to ada-compile-current
(ada-compile): Removed.
(ada-compile-application, ada-compile-current, ada-check-current):
Set the compilation-search-path so that compile.el automatically
finds the sources in src_dir. Automatic scrollong of the
compilation buffer. C-uC-cC-c asks for confirmation before
compiling
(ada-compile-current): New parameter, prj-field
(ada-complete-identifier): Load the .ali file before doing
processing
(ada-find-ali-file-in-dir): prepend build_dir to obj_dir to
conform to gnatmake's behavior.
(ada-find-file-in-dir): New function
(ada-find-references): Set the environment variables for gnatfind
(ada-find-src-file-in-dir): New function.
(ada-first-non-nil): Removed
(ada-gdb-application): Add support for jdb, the java debugger.
(ada-get-ada-file-name): Load the original-file first if not done
yet.
(ada-get-all-references): Handles the new ali syntax (parent types
are found between <>).
(ada-initialize-runtime-library): New function
(ada-mode-hook): Always load a project file when a file is opened,
so that the casing exceptions are correctly read.
(ada-operator-re): Add all missing operators ("abs", "rem", "**").
(ada-parse-prj-file): Use find-file-noselect instead of find-file
to open the project file, since the latter does not work with
speedbar Get default values before loading the prj file, or the
default executable file name is wrong. Use the absolute value of
src_dir to initialize ada-search-directories and
compilation-search-path,... Add the standard runtime library to
the search path for find-file.
(ada-prj-default-debugger): Was missing an opening '{'
(ada-prj-default-bind-opt, ada-prj-default-link-opt): New
variables.
(ada-prj-default-gnatmake-opt): New variable
(ada-prj-find-prj-file): Handles non-file buffers For non-Ada
buffers, the project file is the default one Save the windows
configuration before displaying the menu.
(ada-prj-src-dir, ada-prj-obj-dir, ada-prj-comp-opt,...): Removed
(ada-read-identifier): Fix xrefs on operators (for "mod", "and",
...) regexp-quote identifiers names to support operators +,
-,... in regexps.
(ada-remote): New function.
(ada-run-application): Erase the output buffer before starting the
run Support remote execution of the application. Use
call-process, or the arguments are incorrectly parsed
(ada-set-default-project-file): Reread the content of the active
project file, not the one from the current buffer When a project
file is set as the default project, all directories are
automatically associated with it.
(ada-set-environment): New function
(ada-treat-cmd-string): New special variable ${current}
(ada-treat-cmd-string): Revised. The substitution is now done for
any ${...} substring
(ada-xref-current): If no body was found, compiles the spec
instead. Setup ADA_{SOURCE,OBJECTS}_PATH before running the
compiler to get rid of command line length limitations.
(ada-xref-get-project-field): New function
(ada-xref-project-files): New variable
(ada-xref-runtime-library-specs-path)
(ada-xref-runtime-library-ali-path): New variables
(ada-xref-set-default-prj-values): Default run command now does a
cd to the build directory. New field: main_unit Provide a default
file name even if the current buffer has no prj file.
2000-07-24 11:13:11 +00:00
|
|
|
(append (mapcar 'directory-file-name ada-xref-runtime-library-specs-path)
|
|
|
|
ada-search-directories))
|
|
|
|
|
1999-10-07 14:25:59 +00:00
|
|
|
(provide 'ada-xref)
|
|
|
|
|
2003-09-01 15:45:59 +00:00
|
|
|
;;; arch-tag: 415a39fe-577b-4676-b3b1-6ff6db7ca24e
|
2000-10-08 17:47:56 +00:00
|
|
|
;;; ada-xref.el ends here
|