[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/ada-mode a3be258 27/48: Release Ada mode 5.3.1, wisi 1.
From: |
Stefan Monnier |
Subject: |
[elpa] externals/ada-mode a3be258 27/48: Release Ada mode 5.3.1, wisi 1.1.6 |
Date: |
Mon, 30 Nov 2020 17:20:42 -0500 (EST) |
branch: externals/ada-mode
commit a3be25872848f7a96a216a5676b5693430429728
Author: Stephen Leake <stephen_leake@stephe-leake.org>
Commit: Stephen Leake <stephen_leake@stephe-leake.org>
Release Ada mode 5.3.1, wisi 1.1.6
* packages/ada-mode/*: Release Ada mode 5.3.1.
* packages/ada-mode/ada_mode_gps_indent.gpr: Rename to
ada_mode_gps_indent.gpr.gp; generate .gpr via gnatprep.
* packages/ada-mode/build.sh: New file.
* packages/wisi/parse_table-mode.el: New file.
* packages/wisi/wisi.el: Release wisi 1.1.6.
---
NEWS | 35 +++++
README | 2 +-
ada-gnat-compile.el | 50 ++++---
ada-gnat-xref.el | 6 +-
ada-mode.el | 109 ++++++++++----
ada-mode.info | 165 ++++++++++++---------
ada-mode.texi | 97 +++++++-----
ada-skel.el | 2 +-
ada-wisi.el | 15 +-
...de_gps_indent.gpr => ada_mode_gps_indent.gpr.gp | 5 +-
build.sh | 24 +++
gnat-core.el | 16 +-
gpr-mode.info | 2 +-
gpr_query-process_refresh.adb.gp | 2 +-
gpr_query.gpr.gp | 2 +-
15 files changed, 369 insertions(+), 163 deletions(-)
diff --git a/NEWS b/NEWS
index e9f0990..fea6ed8 100755
--- a/NEWS
+++ b/NEWS
@@ -1,6 +1,41 @@
GNU Emacs Ada mode NEWS -- history of user-visible changes.
+* Ada mode 5.3.1
+3 Oct 2017
+
+** Ada mode 5.2.2 should have been numbered 5.3.0, since it introduced
+ the GPS indentation backend major feature.
+
+** GNAT GPL 2017 is supported for gpr_query and ada_mode_gps_indent;
+ see ada_mode.info for installation instructions.
+
+** New Ada-mode submenu "Select Project" lists all loaded Ada-mode
+ project, making it easier to switch between them.
+
+** New Ada-mode menu entry "Delete project..." allows deleting a
+ loaded project, to reduce clutter in the new "Select Project"
+ menu.
+
+** `ada-add-log-for-current-function' (for a revision control commit)
+ will return a type name. However, `ada-which-function' will not.
+
+** New option `ada-fill-comment-adaptive', if non-nil, causes all
+ comments to be filled to the same width, rather than to the same
+ column. This looks better in deeply nested code.
+
+** When 'ada-auto-case' is nil, 'ada-case-adjust-at-point' used to do
+ nothing; it now capitalizes the word at point. This helps with some
+ alternate casing styles.
+
+** Improve handling of GPR_PROJECT_PATH in 'compilation-environment'
+ when selecting/deselection ada-mode project files.
+
+** ada-gnat-xref-all (used by ada-show-references) now preserves point
+ when appending more references.
+
+** Minor bug fixes.
+
* Ada mode 5.2.2
9 Jul 2017
diff --git a/README b/README
index fee5577..4568a1b 100755
--- a/README
+++ b/README
@@ -1,4 +1,4 @@
-Emacs Ada mode version 5.2.2
+Emacs Ada mode version 5.3.1
Ada mode provides auto-casing, fontification, navigation, and
indentation for Ada source code files.
diff --git a/ada-gnat-compile.el b/ada-gnat-compile.el
index 87833a8..93338b3 100755
--- a/ada-gnat-compile.el
+++ b/ada-gnat-compile.el
@@ -306,20 +306,6 @@ Prompt user if more than one."
t)
;;;; strings
- ((looking-at "package \"Ada\" is hidden")
- (pop-to-buffer source-buffer)
- (forward-word -1)
- (insert "Standard.")
- t)
-
- ((looking-at (concat "\\(?:possible \\)?misspelling of "
ada-gnat-quoted-name-regexp))
- (let ((expected-name (match-string 1)))
- (pop-to-buffer source-buffer)
- (looking-at ada-name-regexp)
- (delete-region (match-beginning 1) (match-end 1))
- (insert expected-name))
- t)
-
((looking-at (concat "\"end " ada-name-regexp ";\" expected"))
(let ((expected-name (match-string 1)))
(pop-to-buffer source-buffer)
@@ -358,6 +344,11 @@ Prompt user if more than one."
(forward-line 1)
(move-to-column message-column)
(cond
+ ((looking-at "found procedure name")
+ (pop-to-buffer source-buffer)
+ (forward-word 1)
+ (insert "'Access")
+ t)
((looking-at "found type access")
(pop-to-buffer source-buffer)
(if (looking-at "'Access")
@@ -401,6 +392,14 @@ Prompt user if more than one."
(insert (concat stuff)));; if missing ")", don't need space;
otherwise do?
t)
+ ((looking-at (concat "\\(?:possible \\)?misspelling of "
ada-gnat-quoted-name-regexp))
+ (let ((expected-name (match-string 1)))
+ (pop-to-buffer source-buffer)
+ (looking-at ada-name-regexp)
+ (delete-region (match-beginning 1) (match-end 1))
+ (insert expected-name))
+ t)
+
((looking-at "No legal interpretation for operator")
(forward-line 1)
(move-to-column message-column)
@@ -427,6 +426,12 @@ Prompt user if more than one."
(ada-fix-add-use-type type)
t))
+ ((looking-at "package \"Ada\" is hidden")
+ (pop-to-buffer source-buffer)
+ (forward-word -1)
+ (insert "Standard.")
+ t)
+
((looking-at "parentheses required for unary minus")
(set-buffer source-buffer)
(insert "(")
@@ -608,10 +613,19 @@ Prompt user if more than one."
;;
;; find error locations in .gpr files
(setq compilation-search-path (append compilation-search-path (ada-prj-get
'prj_dir)))
- (setq compilation-environment
- (list
- (let ((process-environment (cl-copy-list (ada-prj-get 'proc_env))))
- (concat "GPR_PROJECT_PATH=" (getenv "GPR_PROJECT_PATH")))))
+
+ ;; ‘compilation-environment’ is buffer-local, but the user might
+ ;; delete that buffer. So set both global and local.
+ (let* ((process-environment (ada-prj-get 'proc_env))
+ (gpr-path (getenv "GPR_PROJECT_PATH"))
+ (comp-env (list (concat "GPR_PROJECT_PATH=" gpr-path)))
+ (comp-buf (get-buffer "*compilation*")))
+ (when (buffer-live-p comp-buf)
+ (with-current-buffer comp-buf
+ (setenv "GPR_PROJECT_PATH" gpr-path)
+ (setq compilation-environment comp-env)))
+ (set-default 'compilation-environment comp-env)
+ )
;; must be after indentation engine setup, because that resets the
;; indent function list.
diff --git a/ada-gnat-xref.el b/ada-gnat-xref.el
index 0507356..ff14362 100755
--- a/ada-gnat-xref.el
+++ b/ada-gnat-xref.el
@@ -194,6 +194,7 @@ elements of the result may be nil."
" "))
;; gnat find uses standard gnu format for output, so don't
;; need to set compilation-error-regexp-alist
+ prev-pos
prev-content)
;; compilation-environment is buffer-local; don't set in 'let'
(setq compilation-environment (ada-prj-get 'proc_env))
@@ -201,6 +202,7 @@ elements of the result may be nil."
;; WORKAROUND: the 'compilation' API doesn't let us specify "append",
so we use this.
(with-current-buffer (get-buffer-create compilation-buffer-name)
(when append
+ (setq prev-pos (point))
(setq prev-content (buffer-substring (point-min) (point-max))))
(unless ada-gnat-debug-run
@@ -214,9 +216,9 @@ elements of the result may be nil."
(lambda (_name) compilation-buffer-name))
(when append
(let ((inhibit-read-only t))
- (save-excursion
(goto-char (point-min))
- (insert prev-content)))))
+ (insert prev-content)
+ (goto-char prev-pos))))
))))
;;;;; setup
diff --git a/ada-mode.el b/ada-mode.el
index 6ded112..efd2c4f 100755
--- a/ada-mode.el
+++ b/ada-mode.el
@@ -2,12 +2,12 @@
;;
;; Copyright (C) 1994, 1995, 1997 - 2017 Free Software Foundation, Inc.
;;
-;; Author: Stephen Leake <stephen_leake@member.fsf.org>
-;; Maintainer: Stephen Leake <stephen_leake@member.fsf.org>
+;; Author: Stephen Leake <stephen_leake@stephe-leake.org>
+;; Maintainer: Stephen Leake <stephen_leake@stephe-leake.org>
;; Keywords: languages
;; ada
-;; Version: 5.2.2
-;; package-requires: ((wisi "1.1.5") (cl-lib "0.4") (emacs "24.3"))
+;; Version: 5.3.1
+;; package-requires: ((wisi "1.1.6") (cl-lib "0.4") (emacs "24.3"))
;; url: http://www.nongnu.org/ada-mode/
;;
;; (Gnu ELPA requires single digits between dots in versions)
@@ -168,7 +168,7 @@
(defun ada-mode-version ()
"Return Ada mode version."
(interactive)
- (let ((version-string "5.2.2"))
+ (let ((version-string "5.3.1"))
;; must match:
;; ada-mode.texi
;; README-ada-mode
@@ -274,12 +274,18 @@ indentation parser accepts."
(defcustom ada-fill-comment-prefix "-- "
"Comment fill prefix."
:type 'string)
-(make-variable-buffer-local 'ada-language-version)
+(make-variable-buffer-local 'ada-fill-comment-prefix)
(defcustom ada-fill-comment-postfix " --"
"Comment fill postfix."
:type 'string)
-(make-variable-buffer-local 'ada-language-version)
+(make-variable-buffer-local 'ada-fill-comment-postfix)
+
+(defcustom ada-fill-comment-adaptive nil
+ "If non-nil, comments are filled to the same width (not including
indentation),
+rather than to the same column."
+ :type 'boolean
+ :safe #'booleanp)
(defcustom ada-prj-file-extensions '("adp" "prj")
"List of Emacs Ada mode project file extensions.
@@ -404,6 +410,7 @@ Values defined by cross reference packages.")
["Show project" ada-prj-show t]
["Show project file search path" ada-prj-show-prj-path t]
["Show source file search path" ada-prj-show-src-path t]
+ ["Delete project ..." ada-prj-delete t]
)
("Build"
["Next compilation error" next-error t]
@@ -462,6 +469,37 @@ Values defined by cross reference packages.")
["Reset parser" ada-reset-parser t]
)))
+(defun ada-project-menu-compute ()
+ "Return an easy-menu menu for `ada-project-menu-install'.
+Menu displays currently parsed Ada mode projects."
+ (let (menu)
+ (dolist (item ada-prj-alist)
+ (push
+ (vector
+ (if (equal (car item) ada-prj-current-file)
+ ;; current project
+ (concat (car item) " *")
+ (car item))
+ `(lambda () (interactive) (ada-select-prj-file ,(car item)))
+ t)
+ menu)
+ )
+ (nreverse menu)))
+
+(defun ada-project-menu-install ()
+ "Install the Ada project menu as a submenu."
+ (define-key-after
+ (lookup-key ada-mode-map [menu-bar Ada]);; map to put menu in
+ [ada-prj-select] ;; key (a menu entry)
+ (easy-menu-binding ;; binding
+ (easy-menu-create-menu
+ "Select Project"
+ (ada-project-menu-compute)))
+
+ ;; FIXME: this doesn’t work; "Select Project" is at end
+ (lookup-key ada-mode-map [menu-bar Ada Project\ files]) ;; after
+ ))
+
(easy-menu-define ada-context-menu nil
"Context menu keymap for Ada mode"
'("Ada"
@@ -1251,13 +1289,15 @@ and treat `ada-case-strict' as t in code.."
)))
(defun ada-case-adjust-at-point (&optional in-comment)
- "Adjust case of word at point, move to end of word.
+ "If ’ada-auto-case’ is non-nil, adjust case of word at point, move to end of
word.
With prefix arg, adjust case as code even if in comment;
-otherwise, capitalize words in comments."
+otherwise, capitalize words in comments.
+If ’ada-auto-case’ is nil, capitalize current word."
(interactive "P")
(cond
- ((and (not in-comment)
- (ada-in-string-or-comment-p))
+ ((or (not ada-auto-case)
+ (and (not in-comment)
+ (ada-in-string-or-comment-p)))
(skip-syntax-backward "w_")
(capitalize-word 1))
@@ -1723,6 +1763,14 @@ Indexed by project variable xref_tool.")
(ada-select-prj-file (completing-read "project: " ada-prj-alist nil t))
)
+(defun ada-prj-delete ()
+ "Delete a project file from the list of currently available project files."
+ (interactive)
+ (let* ((prj-file (completing-read "project: " ada-prj-alist nil t))
+ (prj-entry (assoc prj-file ada-prj-alist)))
+ (setq ada-prj-alist (delete prj-entry ada-prj-alist))
+ ))
+
(defun ada-prj-show ()
"Show current Emacs Ada mode project file."
(interactive)
@@ -1986,18 +2034,23 @@ unit name; it should return the Ada name that should be
found in FILE-NAME.")
;;
;; This is run from ff-pre-load-hook, so ff-function-name may have
;; been set by ff-treat-special; don't reset it.
- "Function called with no parameters; it should return the name
-of the package, protected type, subprogram, or task type whose
-definition/declaration point is in, or for declarations that
-don't have declarative regions, just after; or nil. In addition,
-if `ff-function-name' is non-nil, store in `ff-function-name' a
-regexp that will find the function in the other file.")
-
-(defun ada-which-function ()
+ "Function called with one parameter (INCLUDE-TYPE); it should
+return the name of the package, protected type, subprogram, or
+task type whose definition/declaration point is in, or for
+declarations that don't have declarative regions, just after; or
+nil.
+
+If INCLUDE-TYPE is non-nil, include type names.
+
+In addition, if `ff-function-name' is non-nil, store in
+`ff-function-name' a regexp that will find the function in the
+other file.")
+
+(defun ada-which-function (&optional include-type)
"See `ada-which-function' variable."
- (interactive)
+ (interactive "P")
(when ada-which-function
- (funcall ada-which-function)))
+ (funcall ada-which-function include-type)))
(defvar ada-on-context-clause nil
;; supplied by indentation engine
@@ -2042,7 +2095,7 @@ regexp that will find the function in the other file.")
;; first, then call `ada-which-function'
(save-excursion
(end-of-line 1)
- (ada-which-function)))
+ (ada-which-function t)))
(defun ada-set-point-accordingly ()
"Move to the string specified in `ff-function-name', which may be a regexp,
@@ -2675,9 +2728,11 @@ The paragraph is indented on the first line."
;; setting it in ada-mode causes indent-region to use it for
;; all indentation.
(fill-prefix ada-fill-comment-prefix)
- (fill-column (current-fill-column)))
-
- ;; We should run before-change-functions here, but we don't know from/to
yet.
+ (fill-column (if ada-fill-comment-adaptive
+ (save-excursion
+ (back-to-indentation)
+ (+ (current-column) fill-column))
+ (current-fill-column))))
;; Find end of comment paragraph
(back-to-indentation)
@@ -2794,6 +2849,8 @@ The paragraph is indented on the first line."
(setq major-mode 'ada-mode)
(setq mode-name "Ada")
(use-local-map ada-mode-map)
+ (add-hook 'menu-bar-update-hook #'ada-project-menu-install)
+
(set-syntax-table ada-mode-syntax-table)
(define-abbrev-table 'ada-mode-abbrev-table ())
(setq local-abbrev-table ada-mode-abbrev-table)
@@ -2894,7 +2951,7 @@ The paragraph is indented on the first line."
;; fill-region-as-paragraph in ada-fill-comment-paragraph does not
;; call syntax-propertize, so set comment syntax on
;; ada-fill-comment-prefix. In post-local because user may want to
- ;; set it per-file.
+ ;; set it per-file. FIXME: only in emacs < 25?
(put-text-property 0 2 'syntax-table '(11 . nil) ada-fill-comment-prefix)
(cl-case ada-language-version
diff --git a/ada-mode.info b/ada-mode.info
index 161070d..978f733 100644
--- a/ada-mode.info
+++ b/ada-mode.info
@@ -1,4 +1,4 @@
-This is ada-mode.info, produced by makeinfo version 6.3 from
+This is ada-mode.info, produced by makeinfo version 6.4 from
ada-mode.texi.
Copyright (C) 1999 - 2017 Free Software Foundation, Inc.
@@ -22,7 +22,7 @@ END-INFO-DIR-ENTRY
File: ada-mode.info, Node: Top, Next: Overview, Prev: (dir), Up: (dir)
-Ada Mode Version 5.2.2
+Ada Mode Version 5.3.1
Copyright (C) 1999 - 2017 Free Software Foundation, Inc.
@@ -68,6 +68,7 @@ Installation
gpr_query
* Building GNATCOLL::
+* Building gpr_query::
ada_mode_gps_indent
@@ -210,11 +211,11 @@ is an AdaCore extension, not available in FSF GCC.
must be built. Its source code is in the Gnu ELPA package.
'gpr_query' requires the 'GNATCOLL' library provided by AdaCore,
-distributed with GNAT GPL 2016, and also available at Github
+distributed with GNAT GPL 2016 or 2017, and also available at Github
(<https://github.com/AdaCore/gnatcoll>). (The 'GNATCOLL' distributed
with GNAT GPL 2015 does not compile cleanly). The notes below assume
that the compiler is installed at '$prefix', e.g.
-'/usr/local/gnat-2016', and that '$prefix/bin' is first on the 'PATH'.
+'/usr/local/gnat-2017', and that '$prefix/bin' is first on the 'PATH'.
If you are running Windows, use Cygwin 'bash' to run these commands.
In general, 'gpr_query' should be compiled with the compiler version
@@ -226,25 +227,46 @@ if the compiler version changes, to force a complete
rebuild.
* Menu:
* Building GNATCOLL::
+* Building gpr_query::
-File: ada-mode.info, Node: Building GNATCOLL, Up: gpr_query
+File: ada-mode.info, Node: Building GNATCOLL, Next: Building gpr_query, Up:
gpr_query
2.2.1 Building GNATCOLL
-----------------------
'GNATCOLL' may already be installed on your system: if it is,
-'$prefix/lib/gnat' will contain 'gnatcoll' GPR files. If not, configure
-(assuming the GPL 2016 version) by:
+'$prefix/lib/gnat' will contain 'gnatcoll' GPR files. If not, and you
+are using GNAT GPL 2017, first install the 'libiconv' library.
- tar zxf ~/Downloads/gnatcoll-gpl-2016-src.tar.gz
- cd gnatcoll-gpl-2016-src
+ On Linux, use the package manager to install the development version
+of 'libiconv' (usually named 'libiconv-dev').
+
+ On Windows, one way to get the library is to install MingW32 from the
+MSYS2 project (<http://www.msys2.org/>), use its package manger 'pacman'
+to install 'libiconv', then copy the 'libiconv' files to the GNAT
+installation:
+
+ cp d:/msys64/mingw32/include/iconv.h d:/Apps/GNAT-gpl_2017/include/
+ cp d:/msys64/mingw32/lib/libiconv.a
d:/Apps/GNAT-gpl_2017/lib/gcc/i686-pc-mingw32/6.3.1/
+
+ Then configure (assuming the GPL 2017 version) by:
+
+ tar zxf ~/Downloads/gnatcoll-gpl-2017-src.tar.gz
+ cd gnatcoll-gpl-2017-src
./configure --prefix=$prefix
- You should see at least the following lines at the end of the output:
+ where '$prefix' is the GNAT installation directory.
+
+ You should see at least the following lines at the end of the
+configure output:
configure: Sqlite: embedded (see --with-sqlite)
+ configure: Iconv: yes (see --with-iconv)
configure: Projects: yes
+ configure: Xref: yes
+
+ If you are using GNAT GPL 2016, the 'Xref' line is not present.
Then, build and install:
@@ -254,18 +276,22 @@ File: ada-mode.info, Node: Building GNATCOLL, Up:
gpr_query
If you are debugging 'gpr_query', you may want to build an sqlite3
executable that is compatible with the database it creates:
- cd gnatcoll-gpl-2016-src/src/sqlite/amalgamation/
+ cd gnatcoll-gpl-2017-src/src/sqlite/amalgamation/
gcc -O2 -o sqlite3 shell.c sqlite3.c -ldl -lpthread
+
+File: ada-mode.info, Node: Building gpr_query, Prev: Building GNATCOLL, Up:
gpr_query
+
2.2.2 Building 'gpr_query'
--------------------------
-To build and install 'gpr_query', assuming the 'ada-mode-5.2.xx' GNU
+To build and install 'gpr_query', assuming the 'ada-mode-5.3.xx' GNU
ELPA package is installed:
- cd ~/.emacs.d/elpa/ada-mode-5.2.xx
- gprbuild -p -P gpr_query.gpr
- gprinstall -P gpr_query.gpr
+ cd ~/.emacs.d/elpa/ada-mode-5.3.xx
+ ./build.sh
+
+ This also builds *note ada_mode_gps_indent::.
'ada-mode' will use 'gpr_query' for cross reference functions if
'gpr_query' is found in 'PATH'.
@@ -302,15 +328,15 @@ File: ada-mode.info, Node: ada_mode_gps_indent install,
Next: ada_mode_gps_ind
2.3.1 Install
-------------
-To install 'ada_mode_gps_indent', assuming the 'ada-mode-5.2.xx' GNU
+To install 'ada_mode_gps_indent', assuming the 'ada-mode-5.3.xx' GNU
ELPA package is installed:
* Install 'gnatcoll' (*note Building GNATCOLL::).
- * Compile and install 'ada_mode_gps_indent.adb':
- cd ~/.emacs.d/elpa/ada-mode-5.xx/build/Makefile
- export GPS_ROOT=<path to GPS>
- gprbuild -p -P ada_mode_gps_indent.gpr
- gprinstall -p -P ada_mode_gps_indent.gpr
+ * Compile and install 'ada_mode_gps_indent':
+ cd ~/.emacs.d/elpa/ada-mode-5.3.xx/
+ ./build.sh
+
+ This also builds *note gpr_query::.
File: ada-mode.info, Node: ada_mode_gps_indent configure, Prev:
ada_mode_gps_indent install, Up: ada_mode_gps_indent
@@ -494,7 +520,7 @@ the syntax to set a variable is the following:
Ada comment:
-- Local Variables:
- -- jit-lock-defer-time: 0.5
+ -- jit-lock-defer-time: 1.5
-- End:
The above can all be set by the following code in your '~/.emacs'.
@@ -2675,52 +2701,53 @@ Index
Tag Table:
Node: Top945
-Node: Overview3576
-Node: Installation4786
-Node: Ada Reference Manual5688
-Node: gpr_query5964
-Node: Building GNATCOLL7451
-Node: ada_mode_gps_indent8717
-Node: ada_mode_gps_indent install9631
-Node: ada_mode_gps_indent configure10184
-Node: Customization11007
-Node: Non-standard file names11489
-Node: Other compiler13330
-Node: Other cross-reference13909
-Node: Other customization14651
-Node: Compiling Executing17996
-Node: Compile commands18731
-Node: Compiling Examples21382
-Node: No project files22214
-Node: Set compiler options27580
-Node: Set source search path29542
-Node: Use GNAT project file31995
-Node: Use multiple GNAT project files34769
-Node: Use a Makefile37489
-Node: Compiler errors38804
-Node: Project files39621
-Node: Project file overview40648
-Node: Project file variables42192
-Node: Moving Through Ada Code47067
-Node: Identifier completion49766
-Node: Indentation50728
-Node: Statement skeletons55076
-Node: Aligning code56861
-Node: Automatic casing57806
-Node: Comment Handling60510
-Node: Key summary61029
-Node: Developer overview63656
-Node: Directory structure64024
-Node: Package organization67995
-Node: Ada mode68230
-Node: gpr mode70426
-Node: GNAT core70709
-Node: Wisi71543
-Node: OpenToken72443
-Node: ELPA73045
-Node: Savannah73655
-Node: ada-france73993
-Node: GNU Free Documentation License74233
-Node: Index99394
+Node: Overview3599
+Node: Installation4809
+Node: Ada Reference Manual5711
+Node: gpr_query5987
+Node: Building GNATCOLL7505
+Node: Building gpr_query9277
+Node: ada_mode_gps_indent9729
+Node: ada_mode_gps_indent install10643
+Node: ada_mode_gps_indent configure11103
+Node: Customization11926
+Node: Non-standard file names12408
+Node: Other compiler14249
+Node: Other cross-reference14828
+Node: Other customization15570
+Node: Compiling Executing18915
+Node: Compile commands19650
+Node: Compiling Examples22301
+Node: No project files23133
+Node: Set compiler options28499
+Node: Set source search path30461
+Node: Use GNAT project file32914
+Node: Use multiple GNAT project files35688
+Node: Use a Makefile38408
+Node: Compiler errors39723
+Node: Project files40540
+Node: Project file overview41567
+Node: Project file variables43111
+Node: Moving Through Ada Code47986
+Node: Identifier completion50685
+Node: Indentation51647
+Node: Statement skeletons55995
+Node: Aligning code57780
+Node: Automatic casing58725
+Node: Comment Handling61429
+Node: Key summary61948
+Node: Developer overview64575
+Node: Directory structure64943
+Node: Package organization68914
+Node: Ada mode69149
+Node: gpr mode71345
+Node: GNAT core71628
+Node: Wisi72462
+Node: OpenToken73362
+Node: ELPA73964
+Node: Savannah74574
+Node: ada-france74912
+Node: GNU Free Documentation License75152
+Node: Index100313
End Tag Table
diff --git a/ada-mode.texi b/ada-mode.texi
index ed05879..05e6e77 100755
--- a/ada-mode.texi
+++ b/ada-mode.texi
@@ -26,7 +26,7 @@ developing GNU and promoting software freedom.''
@titlepage
@sp 10
-@title Ada Mode Version 5.2.2
+@title Ada Mode Version 5.3.1
@page
@vskip 0pt plus 1filll
@insertcopying
@@ -36,7 +36,7 @@ developing GNU and promoting software freedom.''
@node Top, Overview, (dir), (dir)
-Ada Mode Version 5.2.2
+Ada Mode Version 5.3.1
@ifnottex
@insertcopying
@@ -72,6 +72,7 @@ Installation
gpr_query
* Building GNATCOLL::
+* Building @file{gpr_query}::
ada_mode_gps_indent
@@ -198,34 +199,35 @@ Annotated Ada Reference Manual in info format.
@section gpr_query
Ada mode has support for an external cross reference tool
-@code{gpr_query}, which uses compiler-generated information. In the
+@file{gpr_query}, which uses compiler-generated information. In the
case of Ada, the necessary @file{.ali} files are automatically
generated by the standard compilation process. For other languages,
e.g. C, C++, @file{.gli} files can be generated using the compiler
switch @code{-fdump-xref}. @code{-fdump-xref} is an AdaCore extension,
not available in FSF GCC.
-@code{gpr_query} is an Ada program, which is distributed as source and
+@file{gpr_query} is an Ada program, which is distributed as source and
must be built. Its source code is in the Gnu ELPA package.
-@code{gpr_query} requires the @code{GNATCOLL} library provided by
-AdaCore, distributed with GNAT GPL 2016, and also available at Github
-(@url{https://github.com/AdaCore/gnatcoll}). (The @code{GNATCOLL}
-distributed with GNAT GPL 2015 does not compile cleanly). The notes
-below assume that the compiler is installed at @file{$prefix},
-e.g. @file{/usr/local/gnat-2016}, and that @file{$prefix/bin} is first
-on the @code{PATH}. If you are running Windows, use Cygwin @code{bash}
-to run these commands.
+@file{gpr_query} requires the @code{GNATCOLL} library provided by
+AdaCore, distributed with GNAT GPL 2016 or 2017, and also available at
+Github (@url{https://github.com/AdaCore/gnatcoll}). (The
+@code{GNATCOLL} distributed with GNAT GPL 2015 does not compile
+cleanly). The notes below assume that the compiler is installed at
+@file{$prefix}, e.g. @file{/usr/local/gnat-2017}, and that
+@file{$prefix/bin} is first on the @code{PATH}. If you are running
+Windows, use Cygwin @code{bash} to run these commands.
-In general, @code{gpr_query} should be compiled with the compiler
+In general, @file{gpr_query} should be compiled with the compiler
version that is used to generate the user project @file{.ali} files;
the @file{ali} file format can change with each compiler
-version. @code{gpr_query} creates a database of cross reference
+version. @file{gpr_query} creates a database of cross reference
information; that database must be deleted if the compiler version
changes, to force a complete rebuild.
@menu
* Building GNATCOLL::
+* Building @file{gpr_query}::
@end menu
@node Building GNATCOLL
@@ -233,21 +235,44 @@ changes, to force a complete rebuild.
@code{GNATCOLL} may already be installed on your system: if it is,
@file{$prefix/lib/gnat} will contain @file{gnatcoll} GPR files. If
-not, configure (assuming the GPL 2016 version) by:
+not, and you are using GNAT GPL 2017, first install the
+@code{libiconv} library.
+
+On Linux, use the package manager to install the development version
+of @code{libiconv} (usually named @code{libiconv-dev}).
+
+On Windows, one way to get the library is to install MingW32 from the
+MSYS2 project (@url{http://www.msys2.org/}), use its package manger
+@code{pacman} to install @code{libiconv}, then copy the
+@code{libiconv} files to the GNAT installation:
+
+@example
+cp d:/msys64/mingw32/include/iconv.h d:/Apps/GNAT-gpl_2017/include/
+cp d:/msys64/mingw32/lib/libiconv.a
d:/Apps/GNAT-gpl_2017/lib/gcc/i686-pc-mingw32/6.3.1/
+@end example
+
+Then configure (assuming the GPL 2017 version) by:
@example
-tar zxf ~/Downloads/gnatcoll-gpl-2016-src.tar.gz
-cd gnatcoll-gpl-2016-src
+tar zxf ~/Downloads/gnatcoll-gpl-2017-src.tar.gz
+cd gnatcoll-gpl-2017-src
./configure --prefix=$prefix
@end example
-You should see at least the following lines at the end of the output:
+where @code{$prefix} is the GNAT installation directory.
+
+You should see at least the following lines at the end of the
+configure output:
@example
configure: Sqlite: embedded (see --with-sqlite)
+configure: Iconv: yes (see --with-iconv)
configure: Projects: yes
+configure: Xref: yes
@end example
+If you are using GNAT GPL 2016, the @code{Xref} line is not present.
+
Then, build and install:
@example
@@ -259,23 +284,25 @@ If you are debugging @file{gpr_query}, you may want to
build an
sqlite3 executable that is compatible with the database it creates:
@example
-cd gnatcoll-gpl-2016-src/src/sqlite/amalgamation/
+cd gnatcoll-gpl-2017-src/src/sqlite/amalgamation/
gcc -O2 -o sqlite3 shell.c sqlite3.c -ldl -lpthread
@end example
-@subsection Building @code{gpr_query}
+@node Building @file{gpr_query}
+@subsection Building @file{gpr_query}
-To build and install @code{gpr_query}, assuming the
-@code{ada-mode-5.2.xx} GNU ELPA package is installed:
+To build and install @file{gpr_query}, assuming the
+@code{ada-mode-5.3.xx} GNU ELPA package is installed:
@example
-cd ~/.emacs.d/elpa/ada-mode-5.2.xx
-gprbuild -p -P gpr_query.gpr
-gprinstall -P gpr_query.gpr
+cd ~/.emacs.d/elpa/ada-mode-5.3.xx
+./build.sh
@end example
-@code{ada-mode} will use @code{gpr_query} for cross reference
-functions if @code{gpr_query} is found in @code{PATH}.
+This also builds @ref{ada_mode_gps_indent}.
+
+@code{ada-mode} will use @file{gpr_query} for cross reference
+functions if @file{gpr_query} is found in @code{PATH}.
@node ada_mode_gps_indent, , gpr_query, Installation
@section ada_mode_gps_indent
@@ -302,20 +329,20 @@ consistent with the ada-wisi indentation engine.
@node ada_mode_gps_indent install
@subsection Install
To install @code{ada_mode_gps_indent}, assuming the
-@code{ada-mode-5.2.xx} GNU ELPA package is installed:
+@code{ada-mode-5.3.xx} GNU ELPA package is installed:
@itemize
@item
Install @file{gnatcoll} (@ref{Building GNATCOLL}).
@item
-Compile and install @file{ada_mode_gps_indent.adb}:
+Compile and install @file{ada_mode_gps_indent}:
@example
-cd ~/.emacs.d/elpa/ada-mode-5.xx/build/Makefile
-export GPS_ROOT=<path to GPS>
-gprbuild -p -P ada_mode_gps_indent.gpr
-gprinstall -p -P ada_mode_gps_indent.gpr
+cd ~/.emacs.d/elpa/ada-mode-5.3.xx/
+./build.sh
@end example
+This also builds @ref{gpr_query}.
+
@end itemize
@node ada_mode_gps_indent configure
@@ -491,7 +518,7 @@ in an Ada comment:
@example
-- Local Variables:
--- jit-lock-defer-time: 0.5
+-- jit-lock-defer-time: 1.5
-- End:
@end example
@@ -1326,7 +1353,7 @@ directories from a GPR file.
@item @code{xref_tool} [default: @code{ada-xref-tool}]
Cross reference tool for this project.
-If @code{gpr_query} is found in @code{PATH}, @code{ada-xref-tool}
+If @file{gpr_query} is found in @code{PATH}, @code{ada-xref-tool}
defaults to @code{'gpr_query}. Otherwise, it defaults to @code{'gnat},
which uses @code{gnat find}.
diff --git a/ada-skel.el b/ada-skel.el
index 4684c23..2d3d330 100755
--- a/ada-skel.el
+++ b/ada-skel.el
@@ -209,7 +209,7 @@ Each user will probably want to override this."
(define-skeleton ada-skel-loop
"Insert a loop statement with an optional name (from `str')."
()
- str & ":\n"
+ str & " :\n"
"loop\n"
"exit " str | -1 " when " _ ";\n"
"end loop " str | -1 ";")
diff --git a/ada-wisi.el b/ada-wisi.el
index 8dbdc41..a6da214 100755
--- a/ada-wisi.el
+++ b/ada-wisi.el
@@ -1351,7 +1351,7 @@ comment: comment"
(goto-char name-pos))
))
-(defun ada-wisi-goto-declaration-start ()
+(defun ada-wisi-goto-declaration-start (&optional include-type)
"For `ada-goto-declaration-start', which see.
Also return cache at start."
(wisi-validate-cache (point) t)
@@ -1366,6 +1366,10 @@ Also return cache at start."
(progn
(setq done
(cl-case (wisi-cache-nonterm cache)
+ (full_type_declaration
+ (when include-type
+ (eq (wisi-cache-token cache) 'TYPE)))
+
((generic_package_declaration
generic_subprogram_declaration)
(eq (wisi-cache-token cache) 'GENERIC))
@@ -1607,14 +1611,14 @@ Also return cache at start."
ada-symbol-end)))
result))
-(defun ada-wisi-which-function ()
+(defun ada-wisi-which-function (include-type)
"For `ada-which-function'."
(wisi-validate-cache (point))
;; no message on parse fail, since this could be called from which-func-mode
(when (> wisi-cache-max (point))
(save-excursion
(let ((result nil)
- (cache (condition-case nil (ada-wisi-goto-declaration-start) (error
nil))))
+ (cache (condition-case nil (ada-wisi-goto-declaration-start
include-type) (error nil))))
(if (null cache)
;; bob or failed parse
(setq result "")
@@ -1627,6 +1631,9 @@ Also return cache at start."
;; add or delete 'body' as needed
(cl-ecase (wisi-cache-nonterm cache)
+ (full_type_declaration
+ (setq result (ada-wisi-which-function-1 "type" nil)))
+
(package_body
(setq result (ada-wisi-which-function-1 "package" nil)))
@@ -1794,6 +1801,4 @@ TOKEN-TEXT; move point to just past token."
(setq ada-which-function 'ada-wisi-which-function)
(provide 'ada-wisi)
-(provide 'ada-indent-engine)
-
;; end of file
diff --git a/ada_mode_gps_indent.gpr b/ada_mode_gps_indent.gpr.gp
similarity index 97%
rename from ada_mode_gps_indent.gpr
rename to ada_mode_gps_indent.gpr.gp
index 3667edf..511f8c5 100755
--- a/ada_mode_gps_indent.gpr
+++ b/ada_mode_gps_indent.gpr.gp
@@ -17,8 +17,11 @@
-- MA 02110-1335, USA.
with "gnat_util";
-with "gnatcoll_sqlite";
with "gnatcoll_iconv";
+with "gnatcoll_sqlite";
+#if HAVE_GNATCOLL_XREF="yes"
+with "gnatcoll_xref";
+#end if;
project Ada_Mode_GPS_Indent is
for Main use ("ada_mode_gps_indent.adb");
diff --git a/build.sh b/build.sh
new file mode 100755
index 0000000..7877d6d
--- /dev/null
+++ b/build.sh
@@ -0,0 +1,24 @@
+# Build and install executables for Ada mode.
+
+# In December 2016, GNATCOLL changed its Xref interface. First, the
+# GPR was split out; and second, one of the subprogram
+# interfaces.changed.
+#
+# Determine whether the split-out gnatcoll_xref.gpr is available.
+echo 'with "gnatcoll_xref"; abstract project check_xref is end check_xref;' >
check_xref.gpr;
+gprbuild -P check_xref.gpr > /dev/null 2>&1;
+if test $? -eq 0 ; then HAVE_GNATCOLL_XREF="yes"; else
HAVE_GNATCOLL_XREF="no"; fi
+
+echo "HAVE_GNATCOLL_XREF=$HAVE_GNATCOLL_XREF"
+
+gnatprep -DHAVE_GNATCOLL_XREF=$HAVE_GNATCOLL_XREF
gpr_query-process_refresh.adb.gp gpr_query-process_refresh.adb
+gnatprep -DHAVE_GNATCOLL_XREF=$HAVE_GNATCOLL_XREF gpr_query.gpr.gp
gpr_query.gpr
+
+gprbuild -p -P gpr_query.gpr
+gprinstall -P gpr_query.gpr
+
+gnatprep -DHAVE_GNATCOLL_XREF=$HAVE_GNATCOLL_XREF ada_mode_gps_indent.gpr.gp
ada_mode_gps_indent.gpr
+gprbuild -p -P ada_mode_gps_indent.gpr
+gprinstall -p -P ada_mode_gps_indent.gpr
+
+# end of file
diff --git a/gnat-core.el b/gnat-core.el
index 69548a1..1b3b2ac 100755
--- a/gnat-core.el
+++ b/gnat-core.el
@@ -26,6 +26,9 @@
(require 'cl-lib)
(require 'ada-mode) ;; for ada-prj-* etc; will be refactored sometime
+(defvar gpr-query--sessions nil) ;; gpr-query.el
+(declare-function gpr-query-kill-session "gpr-query.el" (session) )
+
;;;;; code
(defcustom ada-gnat-debug-run nil
@@ -109,8 +112,17 @@ See also `gnat-parse-emacs-final'."
(defun gnat-prj-parse-emacs-final (project)
"Final processing of gnat-specific Emacs Ada project file settings."
- (when (buffer-live-p (get-buffer (gnat-run-buffer-name)))
- (kill-buffer (gnat-run-buffer-name))); things may have changed, force
re-create
+ ;; things may have changed, force re-create gnat or gpr-query sessions.
+ (cl-ecase (ada-prj-get 'xref_tool project)
+ (gnat
+ (when (buffer-live-p (get-buffer (gnat-run-buffer-name)))
+ (kill-buffer (gnat-run-buffer-name))))
+
+ (gpr_query
+ (let ((session (cdr (assoc ada-prj-current-file gpr-query--sessions))))
+ (when session
+ (gpr-query-kill-session session))))
+ )
(if (ada-prj-get 'gpr_file project)
(setq project (gnat-parse-gpr (ada-prj-get 'gpr_file project) project))
diff --git a/gpr-mode.info b/gpr-mode.info
index 03c0a6c..3500232 100644
--- a/gpr-mode.info
+++ b/gpr-mode.info
@@ -1,4 +1,4 @@
-This is gpr-mode.info, produced by makeinfo version 6.3 from
+This is gpr-mode.info, produced by makeinfo version 6.4 from
gpr-mode.texi.
Copyright (C) 2013 Free Software Foundation, Inc.
diff --git a/gpr_query-process_refresh.adb.gp b/gpr_query-process_refresh.adb.gp
index 72ccbfc..64b7071 100755
--- a/gpr_query-process_refresh.adb.gp
+++ b/gpr_query-process_refresh.adb.gp
@@ -20,7 +20,7 @@ is
begin
Parse_All_LI_Files
(Self => Xref,
-#if GNAT_VERSION="GPL_2016"
+#if HAVE_GNATCOLL_XREF="no"
Tree => Tree,
#end if;
Project => Tree.Root_Project,
diff --git a/gpr_query.gpr.gp b/gpr_query.gpr.gp
index ef39dce..7ca3de4 100755
--- a/gpr_query.gpr.gp
+++ b/gpr_query.gpr.gp
@@ -18,7 +18,7 @@
with "gnatcoll";
with "gnatcoll_sqlite";
-#if GNAT_VERSION="GPL_2017"
+#if HAVE_GNATCOLL_XREF="yes"
with "gnatcoll_xref";
#end if;
with "gnat_util";
- [elpa] externals/ada-mode 0a42145 16/48: * packages/ada-mode: Miscellaneous tweaks to fix warnings, (continued)
- [elpa] externals/ada-mode 0a42145 16/48: * packages/ada-mode: Miscellaneous tweaks to fix warnings, Stefan Monnier, 2020/11/30
- [elpa] externals/ada-mode 45fad69 11/48: publish ada-mode 5.1.6, wisi 1.0.6, new package ada-ref-man, Stefan Monnier, 2020/11/30
- [elpa] externals/ada-mode b27dd06 17/48: * ada-mode: Use lexical-binding since it requires Emacs-24.2 anyway, Stefan Monnier, 2020/11/30
- [elpa] externals/ada-mode cc65bfe 18/48: Update ada-mode, wisi, Stefan Monnier, 2020/11/30
- [elpa] externals/ada-mode ce778fa 24/48: Clear executable bit for Emacs Lisp files., Stefan Monnier, 2020/11/30
- [elpa] externals/ada-mode 7e7262b 25/48: * ada-mode/ada-mode.el (ada-case-activate-keys): Fix compiler warning., Stefan Monnier, 2020/11/30
- [elpa] externals/ada-mode 2db72b9 26/48: Update ada-mode to version 5.2.2, wisi to version 1.1.5, Stefan Monnier, 2020/11/30
- [elpa] externals/ada-mode e4a40ea 28/48: Warn about transfer.fsckObjects, Stefan Monnier, 2020/11/30
- [elpa] externals/ada-mode 75a4c9f 14/48: release ada-mode 5.1.7, wisi 1.1.0; minor format changes in ada-ref-man (take 2), Stefan Monnier, 2020/11/30
- [elpa] externals/ada-mode f292e14 20/48: fix executable bits, Stefan Monnier, 2020/11/30
- [elpa] externals/ada-mode a3be258 27/48: Release Ada mode 5.3.1, wisi 1.1.6,
Stefan Monnier <=
- [elpa] externals/ada-mode 04ed297 29/48: * packages/ada-mode/ada-mode.el (ada-mode): emacs 26 vs hack-local-variables, Stefan Monnier, 2020/11/30