Mercurial > emacs
annotate lisp/progmodes/ada-mode.el @ 106896:00c4f0387055
from trunk
author | Kenichi Handa <handa@m17n.org> |
---|---|
date | Sat, 16 Jan 2010 10:43:20 +0900 |
parents | 7fd22a65b1a9 |
children | 908cefda5ea2 |
rev | line source |
---|---|
38422
7a94f1c588c4
Some fixes to follow coding conventions.
Pavel Janík <Pavel@Janik.cz>
parents:
38401
diff
changeset
|
1 ;;; ada-mode.el --- major-mode for editing Ada sources |
30411
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
2 |
64699
629afbe74e61
Update copyright for release of 22.1 for progmodes directory.
Nick Roberts <nickrob@snap.net.nz>
parents:
64434
diff
changeset
|
3 ;; Copyright (C) 1994, 1995, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, |
106815 | 4 ;; 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc. |
25903
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
5 |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
6 ;; Author: Rolf Ebert <ebert@inf.enst.fr> |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
7 ;; Markus Heritsch <Markus.Heritsch@studbox.uni-stuttgart.de> |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
8 ;; Emmanuel Briot <briot@gnat.com> |
73531
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
9 ;; Maintainer: Stephen Leake <stephen_leake@member.fsf.org> |
25903
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
10 ;; Keywords: languages ada |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
11 |
38422
7a94f1c588c4
Some fixes to follow coding conventions.
Pavel Janík <Pavel@Janik.cz>
parents:
38401
diff
changeset
|
12 ;; This file is part of GNU Emacs. |
25903
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
13 |
94673
52b7a8c22af5
Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents:
92148
diff
changeset
|
14 ;; GNU Emacs is free software: you can redistribute it and/or modify |
10705 | 15 ;; it under the terms of the GNU General Public License as published by |
94673
52b7a8c22af5
Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents:
92148
diff
changeset
|
16 ;; the Free Software Foundation, either version 3 of the License, or |
52b7a8c22af5
Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents:
92148
diff
changeset
|
17 ;; (at your option) any later version. |
10705 | 18 |
38401 | 19 ;; GNU Emacs is distributed in the hope that it will be useful, |
10705 | 20 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of |
21 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
22 ;; GNU General Public License for more details. | |
23 | |
24 ;; You should have received a copy of the GNU General Public License | |
94673
52b7a8c22af5
Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents:
92148
diff
changeset
|
25 ;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. |
25903
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
26 |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
27 ;;; Commentary: |
78600
4f60c94dc647
Fix up comment style in header.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
78589
diff
changeset
|
28 ;; This mode is a major mode for editing Ada code. This is a major |
4f60c94dc647
Fix up comment style in header.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
78589
diff
changeset
|
29 ;; rewrite of the file packaged with Emacs-20. The Ada mode is |
4f60c94dc647
Fix up comment style in header.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
78589
diff
changeset
|
30 ;; composed of four Lisp files: ada-mode.el, ada-xref.el, ada-prj.el |
4f60c94dc647
Fix up comment style in header.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
78589
diff
changeset
|
31 ;; and ada-stmt.el. Only this file (ada-mode.el) is completely |
4f60c94dc647
Fix up comment style in header.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
78589
diff
changeset
|
32 ;; independent from the GNU Ada compiler GNAT, distributed by Ada |
4f60c94dc647
Fix up comment style in header.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
78589
diff
changeset
|
33 ;; Core Technologies. All the other files rely heavily on features |
4f60c94dc647
Fix up comment style in header.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
78589
diff
changeset
|
34 ;; provided only by GNAT. |
4f60c94dc647
Fix up comment style in header.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
78589
diff
changeset
|
35 ;; |
4f60c94dc647
Fix up comment style in header.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
78589
diff
changeset
|
36 ;; Note: this mode will not work with Emacs 19. If you are on a VMS |
4f60c94dc647
Fix up comment style in header.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
78589
diff
changeset
|
37 ;; system, where the latest version of Emacs is 19.28, you will need |
4f60c94dc647
Fix up comment style in header.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
78589
diff
changeset
|
38 ;; another file, called ada-vms.el, that provides some required |
4f60c94dc647
Fix up comment style in header.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
78589
diff
changeset
|
39 ;; functions. |
25903
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
40 |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
41 ;;; Usage: |
78600
4f60c94dc647
Fix up comment style in header.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
78589
diff
changeset
|
42 ;; Emacs should enter Ada mode automatically when you load an Ada file. |
4f60c94dc647
Fix up comment style in header.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
78589
diff
changeset
|
43 ;; By default, the valid extensions for Ada files are .ads, .adb or .ada |
4f60c94dc647
Fix up comment style in header.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
78589
diff
changeset
|
44 ;; If the ada-mode does not start automatically, then simply type the |
4f60c94dc647
Fix up comment style in header.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
78589
diff
changeset
|
45 ;; following command : |
4f60c94dc647
Fix up comment style in header.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
78589
diff
changeset
|
46 ;; M-x ada-mode |
4f60c94dc647
Fix up comment style in header.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
78589
diff
changeset
|
47 ;; |
4f60c94dc647
Fix up comment style in header.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
78589
diff
changeset
|
48 ;; By default, ada-mode is configured to take full advantage of the GNAT |
4f60c94dc647
Fix up comment style in header.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
78589
diff
changeset
|
49 ;; compiler (the menus will include the cross-referencing features,...). |
4f60c94dc647
Fix up comment style in header.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
78589
diff
changeset
|
50 ;; If you are using another compiler, you might want to set the following |
4f60c94dc647
Fix up comment style in header.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
78589
diff
changeset
|
51 ;; variable in your .emacs (Note: do not set this in the ada-mode-hook, it |
4f60c94dc647
Fix up comment style in header.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
78589
diff
changeset
|
52 ;; won't work) : |
4f60c94dc647
Fix up comment style in header.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
78589
diff
changeset
|
53 ;; (setq ada-which-compiler 'generic) |
4f60c94dc647
Fix up comment style in header.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
78589
diff
changeset
|
54 ;; |
4f60c94dc647
Fix up comment style in header.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
78589
diff
changeset
|
55 ;; This mode requires find-file.el to be present on your system. |
25903
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
56 |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
57 ;;; History: |
78600
4f60c94dc647
Fix up comment style in header.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
78589
diff
changeset
|
58 ;; The first Ada mode for GNU Emacs was written by V. Broman in |
4f60c94dc647
Fix up comment style in header.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
78589
diff
changeset
|
59 ;; 1985. He based his work on the already existing Modula-2 mode. |
4f60c94dc647
Fix up comment style in header.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
78589
diff
changeset
|
60 ;; This was distributed as ada.el in versions of Emacs prior to 19.29. |
4f60c94dc647
Fix up comment style in header.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
78589
diff
changeset
|
61 ;; |
4f60c94dc647
Fix up comment style in header.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
78589
diff
changeset
|
62 ;; Lynn Slater wrote an extensive Ada mode in 1989. It consisted of |
4f60c94dc647
Fix up comment style in header.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
78589
diff
changeset
|
63 ;; several files with support for dired commands and other nice |
4f60c94dc647
Fix up comment style in header.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
78589
diff
changeset
|
64 ;; things. It is currently available from the PAL |
4f60c94dc647
Fix up comment style in header.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
78589
diff
changeset
|
65 ;; (wuarchive.wustl.edu:/languages/ada) as ada-mode-1.06a.tar.Z. |
4f60c94dc647
Fix up comment style in header.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
78589
diff
changeset
|
66 ;; |
4f60c94dc647
Fix up comment style in header.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
78589
diff
changeset
|
67 ;; The probably very first Ada mode (called electric-ada.el) was |
4f60c94dc647
Fix up comment style in header.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
78589
diff
changeset
|
68 ;; written by Steven D. Litvintchouk and Steven M. Rosen for the |
4f60c94dc647
Fix up comment style in header.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
78589
diff
changeset
|
69 ;; Gosling Emacs. L. Slater based his development on ada.el and |
4f60c94dc647
Fix up comment style in header.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
78589
diff
changeset
|
70 ;; electric-ada.el. |
4f60c94dc647
Fix up comment style in header.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
78589
diff
changeset
|
71 ;; |
4f60c94dc647
Fix up comment style in header.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
78589
diff
changeset
|
72 ;; A complete rewrite by M. Heritsch and R. Ebert has been done. |
4f60c94dc647
Fix up comment style in header.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
78589
diff
changeset
|
73 ;; Some ideas from the Ada mode mailing list have been |
4f60c94dc647
Fix up comment style in header.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
78589
diff
changeset
|
74 ;; added. Some of the functionality of L. Slater's mode has not |
4f60c94dc647
Fix up comment style in header.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
78589
diff
changeset
|
75 ;; (yet) been recoded in this new mode. Perhaps you prefer sticking |
4f60c94dc647
Fix up comment style in header.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
78589
diff
changeset
|
76 ;; to his version. |
4f60c94dc647
Fix up comment style in header.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
78589
diff
changeset
|
77 ;; |
4f60c94dc647
Fix up comment style in header.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
78589
diff
changeset
|
78 ;; A complete rewrite for Emacs-20 / GNAT-3.11 has been done by Ada Core |
4f60c94dc647
Fix up comment style in header.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
78589
diff
changeset
|
79 ;; Technologies. |
25903
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
80 |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
81 ;;; Credits: |
78600
4f60c94dc647
Fix up comment style in header.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
78589
diff
changeset
|
82 ;; Many thanks to John McCabe <john@assen.demon.co.uk> for sending so |
4f60c94dc647
Fix up comment style in header.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
78589
diff
changeset
|
83 ;; many patches included in this package. |
4f60c94dc647
Fix up comment style in header.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
78589
diff
changeset
|
84 ;; Christian Egli <Christian.Egli@hcsd.hac.com>: |
4f60c94dc647
Fix up comment style in header.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
78589
diff
changeset
|
85 ;; ada-imenu-generic-expression |
4f60c94dc647
Fix up comment style in header.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
78589
diff
changeset
|
86 ;; Many thanks also to the following persons that have contributed |
4f60c94dc647
Fix up comment style in header.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
78589
diff
changeset
|
87 ;; to the ada-mode |
4f60c94dc647
Fix up comment style in header.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
78589
diff
changeset
|
88 ;; Philippe Waroquiers (PW) <philippe@cfmu.eurocontrol.be> in particular, |
4f60c94dc647
Fix up comment style in header.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
78589
diff
changeset
|
89 ;; woodruff@stc.llnl.gov (John Woodruff) |
4f60c94dc647
Fix up comment style in header.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
78589
diff
changeset
|
90 ;; jj@ddci.dk (Jesper Joergensen) |
4f60c94dc647
Fix up comment style in header.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
78589
diff
changeset
|
91 ;; gse@ocsystems.com (Scott Evans) |
4f60c94dc647
Fix up comment style in header.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
78589
diff
changeset
|
92 ;; comar@gnat.com (Cyrille Comar) |
4f60c94dc647
Fix up comment style in header.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
78589
diff
changeset
|
93 ;; stephen.leake@gsfc.nasa.gov (Stephen Leake) |
4f60c94dc647
Fix up comment style in header.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
78589
diff
changeset
|
94 ;; robin-reply@reagans.org |
4f60c94dc647
Fix up comment style in header.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
78589
diff
changeset
|
95 ;; and others for their valuable hints. |
25903
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
96 |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
97 ;;; Code: |
78600
4f60c94dc647
Fix up comment style in header.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
78589
diff
changeset
|
98 ;; Note: Every function in this package is compiler-independent. |
4f60c94dc647
Fix up comment style in header.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
78589
diff
changeset
|
99 ;; The names start with ada- |
4f60c94dc647
Fix up comment style in header.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
78589
diff
changeset
|
100 ;; The variables that the user can edit can all be modified through |
4f60c94dc647
Fix up comment style in header.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
78589
diff
changeset
|
101 ;; the customize mode. They are sorted in alphabetical order in this |
4f60c94dc647
Fix up comment style in header.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
78589
diff
changeset
|
102 ;; file. |
4f60c94dc647
Fix up comment style in header.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
78589
diff
changeset
|
103 |
4f60c94dc647
Fix up comment style in header.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
78589
diff
changeset
|
104 ;; Supported packages. |
4f60c94dc647
Fix up comment style in header.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
78589
diff
changeset
|
105 ;; This package supports a number of other Emacs modes. These other modes |
4f60c94dc647
Fix up comment style in header.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
78589
diff
changeset
|
106 ;; should be loaded before the ada-mode, which will then setup some variables |
4f60c94dc647
Fix up comment style in header.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
78589
diff
changeset
|
107 ;; to improve the support for Ada code. |
4f60c94dc647
Fix up comment style in header.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
78589
diff
changeset
|
108 ;; Here is the list of these modes: |
4f60c94dc647
Fix up comment style in header.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
78589
diff
changeset
|
109 ;; `which-function-mode': Display the name of the subprogram the cursor is |
4f60c94dc647
Fix up comment style in header.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
78589
diff
changeset
|
110 ;; in in the mode line. |
4f60c94dc647
Fix up comment style in header.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
78589
diff
changeset
|
111 ;; `outline-mode': Provides the capability to collapse or expand the code |
4f60c94dc647
Fix up comment style in header.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
78589
diff
changeset
|
112 ;; for specific language constructs, for instance if you want to hide the |
4f60c94dc647
Fix up comment style in header.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
78589
diff
changeset
|
113 ;; code corresponding to a subprogram |
4f60c94dc647
Fix up comment style in header.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
78589
diff
changeset
|
114 ;; `align': This mode is now provided with Emacs 21, but can also be |
4f60c94dc647
Fix up comment style in header.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
78589
diff
changeset
|
115 ;; installed manually for older versions of Emacs. It provides the |
4f60c94dc647
Fix up comment style in header.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
78589
diff
changeset
|
116 ;; capability to automatically realign the selected region (for instance |
4f60c94dc647
Fix up comment style in header.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
78589
diff
changeset
|
117 ;; all ':=', ':' and '--' will be aligned on top of each other. |
4f60c94dc647
Fix up comment style in header.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
78589
diff
changeset
|
118 ;; `imenu': Provides a menu with the list of entities defined in the current |
4f60c94dc647
Fix up comment style in header.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
78589
diff
changeset
|
119 ;; buffer, and an easy way to jump to any of them |
4f60c94dc647
Fix up comment style in header.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
78589
diff
changeset
|
120 ;; `speedbar': Provides a separate file browser, and the capability for each |
4f60c94dc647
Fix up comment style in header.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
78589
diff
changeset
|
121 ;; file to see the list of entities defined in it and to jump to them |
4f60c94dc647
Fix up comment style in header.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
78589
diff
changeset
|
122 ;; easily |
4f60c94dc647
Fix up comment style in header.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
78589
diff
changeset
|
123 ;; `abbrev-mode': Provides the capability to define abbreviations, which |
4f60c94dc647
Fix up comment style in header.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
78589
diff
changeset
|
124 ;; are automatically expanded when you type them. See the Emacs manual. |
44465
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
125 |
73922
289cedd46cd8
Delete `eval-and-compile' around `require'.
Juanma Barranquero <lekktu@gmail.com>
parents:
73531
diff
changeset
|
126 (require 'find-file nil t) |
289cedd46cd8
Delete `eval-and-compile' around `require'.
Juanma Barranquero <lekktu@gmail.com>
parents:
73531
diff
changeset
|
127 (require 'align nil t) |
289cedd46cd8
Delete `eval-and-compile' around `require'.
Juanma Barranquero <lekktu@gmail.com>
parents:
73531
diff
changeset
|
128 (require 'which-func nil t) |
289cedd46cd8
Delete `eval-and-compile' around `require'.
Juanma Barranquero <lekktu@gmail.com>
parents:
73531
diff
changeset
|
129 (require 'compile nil t) |
25903
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
130 |
73932
242a56e8b2c0
Replace conditional (require 'ispell) with defvar.
Juanma Barranquero <lekktu@gmail.com>
parents:
73922
diff
changeset
|
131 (defvar ispell-check-comments) |
65223
554ac3736464
(compile-auto-highlight, skeleton-further-elements): Add defvars.
Juanma Barranquero <lekktu@gmail.com>
parents:
64717
diff
changeset
|
132 (defvar skeleton-further-elements) |
554ac3736464
(compile-auto-highlight, skeleton-further-elements): Add defvars.
Juanma Barranquero <lekktu@gmail.com>
parents:
64717
diff
changeset
|
133 |
73531
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
134 (defun ada-mode-version () |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
135 "Return Ada mode version." |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
136 (interactive) |
97058
b6ac850e9d2b
Fix bug #272, and update Ada mode to version 4.0.
Juanma Barranquero <lekktu@gmail.com>
parents:
95268
diff
changeset
|
137 (let ((version-string "4.00")) |
105372
bd2966850aac
Use `called-interactively-p' instead of `interactive-p'.
Juanma Barranquero <lekktu@gmail.com>
parents:
104543
diff
changeset
|
138 (if (called-interactively-p 'interactive) |
73531
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
139 (message version-string) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
140 version-string))) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
141 |
25903
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
142 (defvar ada-mode-hook nil |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
143 "*List of functions to call when Ada mode is invoked. |
50736
b0ce71ab9c28
(ada-search-directories): Take into account ADA_INCLUDE_PATH for better
Juanma Barranquero <lekktu@gmail.com>
parents:
49598
diff
changeset
|
144 This hook is automatically executed after the `ada-mode' is |
25903
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
145 fully loaded. |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
146 This is a good place to add Ada environment specific bindings.") |
18120 | 147 |
148 (defgroup ada nil | |
73531
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
149 "Major mode for editing and compiling Ada source in Emacs." |
66963
a11fdee52c05
Add :link (custom-group-link font-lock-faces) to defgroup.
Juri Linkov <juri@jurta.org>
parents:
65584
diff
changeset
|
150 :link '(custom-group-link :tag "Font Lock Faces group" font-lock-faces) |
18120 | 151 :group 'languages) |
152 | |
25903
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
153 (defcustom ada-auto-case t |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
154 "*Non-nil means automatically change case of preceding word while typing. |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
155 Casing is done according to `ada-case-keyword', `ada-case-identifier' |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
156 and `ada-case-attribute'." |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
157 :type 'boolean :group 'ada) |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
158 |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
159 (defcustom ada-broken-decl-indent 0 |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
160 "*Number of columns to indent a broken declaration. |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
161 |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
162 An example is : |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
163 declare |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
164 A, |
73531
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
165 >>>>>B : Integer;" |
25903
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
166 :type 'integer :group 'ada) |
18120 | 167 |
168 (defcustom ada-broken-indent 2 | |
25903
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
169 "*Number of columns to indent the continuation of a broken line. |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
170 |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
171 An example is : |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
172 My_Var : My_Type := (Field1 => |
73531
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
173 >>>>>>>>>Value);" |
25903
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
174 :type 'integer :group 'ada) |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
175 |
45931
a4c8d672ccbe
* progmodes/ada-mode.el: Update copyright notice.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
44933
diff
changeset
|
176 (defcustom ada-continuation-indent ada-broken-indent |
63528
d6d50a511d12
(ada-format-paramlist)
Juanma Barranquero <lekktu@gmail.com>
parents:
63425
diff
changeset
|
177 "*Number of columns to indent the continuation of broken lines in parenthesis. |
45931
a4c8d672ccbe
* progmodes/ada-mode.el: Update copyright notice.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
44933
diff
changeset
|
178 |
a4c8d672ccbe
* progmodes/ada-mode.el: Update copyright notice.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
44933
diff
changeset
|
179 An example is : |
a4c8d672ccbe
* progmodes/ada-mode.el: Update copyright notice.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
44933
diff
changeset
|
180 Func (Param1, |
73531
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
181 >>>>>Param2);" |
45931
a4c8d672ccbe
* progmodes/ada-mode.el: Update copyright notice.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
44933
diff
changeset
|
182 :type 'integer :group 'ada) |
a4c8d672ccbe
* progmodes/ada-mode.el: Update copyright notice.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
44933
diff
changeset
|
183 |
25903
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
184 (defcustom ada-case-attribute 'ada-capitalize-word |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
185 "*Function to call to adjust the case of Ada attributes. |
30411
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
186 It may be `downcase-word', `upcase-word', `ada-loose-case-word', |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
187 `ada-capitalize-word' or `ada-no-auto-case'." |
25903
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
188 :type '(choice (const downcase-word) |
73531
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
189 (const upcase-word) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
190 (const ada-capitalize-word) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
191 (const ada-loose-case-word) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
192 (const ada-no-auto-case)) |
18120 | 193 :group 'ada) |
10705 | 194 |
44465
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
195 (defcustom ada-case-exception-file |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
196 (list (convert-standard-filename' "~/.emacs_case_exceptions")) |
30411
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
197 "*List of special casing exceptions dictionaries for identifiers. |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
198 The first file is the one where new exceptions will be saved by Emacs |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
199 when you call `ada-create-case-exception'. |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
200 |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
201 These files should contain one word per line, that gives the casing |
63528
d6d50a511d12
(ada-format-paramlist)
Juanma Barranquero <lekktu@gmail.com>
parents:
63425
diff
changeset
|
202 to be used for that word in Ada files. If the line starts with the |
44465
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
203 character *, then the exception will be used for substrings that either |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
204 start at the beginning of a word or after a _ character, and end either |
73422
e1bac685e6a0
(ada-83-string-keywords, ada-last-which-function-line ada-no-auto-case,
Juanma Barranquero <lekktu@gmail.com>
parents:
71924
diff
changeset
|
205 at the end of the word or at a _ character. Each line can be terminated |
e1bac685e6a0
(ada-83-string-keywords, ada-last-which-function-line ada-no-auto-case,
Juanma Barranquero <lekktu@gmail.com>
parents:
71924
diff
changeset
|
206 by a comment." |
30411
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
207 :type '(repeat (file)) |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
208 :group 'ada) |
18120 | 209 |
210 (defcustom ada-case-keyword 'downcase-word | |
26225
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
211 "*Function to call to adjust the case of an Ada keywords. |
25903
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
212 It may be `downcase-word', `upcase-word', `ada-loose-case-word' or |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
213 `ada-capitalize-word'." |
18120 | 214 :type '(choice (const downcase-word) |
73531
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
215 (const upcase-word) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
216 (const ada-capitalize-word) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
217 (const ada-loose-case-word) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
218 (const ada-no-auto-case)) |
18120 | 219 :group 'ada) |
220 | |
221 (defcustom ada-case-identifier 'ada-loose-case-word | |
13231
fb78cec8e440
All doc strings changed to comply with standard Emacs conventions.
Richard M. Stallman <rms@gnu.org>
parents:
13160
diff
changeset
|
222 "*Function to call to adjust the case of an Ada identifier. |
25903
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
223 It may be `downcase-word', `upcase-word', `ada-loose-case-word' or |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
224 `ada-capitalize-word'." |
18120 | 225 :type '(choice (const downcase-word) |
73531
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
226 (const upcase-word) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
227 (const ada-capitalize-word) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
228 (const ada-loose-case-word) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
229 (const ada-no-auto-case)) |
18120 | 230 :group 'ada) |
231 | |
232 (defcustom ada-clean-buffer-before-saving t | |
26225
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
233 "*Non-nil means remove trailing spaces and untabify the buffer before saving." |
25903
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
234 :type 'boolean :group 'ada) |
106829
e9774faca8a4
* progmodes/ada-mode.el (ada-clean-buffer-before-saving): Make obsolete.
Juanma Barranquero <lekktu@gmail.com>
parents:
106815
diff
changeset
|
235 (make-obsolete-variable 'ada-clean-buffer-before-saving |
e9774faca8a4
* progmodes/ada-mode.el (ada-clean-buffer-before-saving): Make obsolete.
Juanma Barranquero <lekktu@gmail.com>
parents:
106815
diff
changeset
|
236 "use the `write-file-functions' hook." |
e9774faca8a4
* progmodes/ada-mode.el (ada-clean-buffer-before-saving): Make obsolete.
Juanma Barranquero <lekktu@gmail.com>
parents:
106815
diff
changeset
|
237 "23.2") |
e9774faca8a4
* progmodes/ada-mode.el (ada-clean-buffer-before-saving): Make obsolete.
Juanma Barranquero <lekktu@gmail.com>
parents:
106815
diff
changeset
|
238 |
25903
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
239 |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
240 (defcustom ada-indent 3 |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
241 "*Size of Ada indentation. |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
242 |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
243 An example is : |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
244 procedure Foo is |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
245 begin |
73531
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
246 >>>>>>>>>>null;" |
25903
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
247 :type 'integer :group 'ada) |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
248 |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
249 (defcustom ada-indent-after-return t |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
250 "*Non-nil means automatically indent after RET or LFD." |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
251 :type 'boolean :group 'ada) |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
252 |
30411
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
253 (defcustom ada-indent-align-comments t |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
254 "*Non-nil means align comments on previous line comments, if any. |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
255 If nil, indentation is calculated as usual. |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
256 Note that indentation is calculated only if `ada-indent-comment-as-code' is t. |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
257 |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
258 For instance: |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
259 A := 1; -- A multi-line comment |
73531
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
260 -- aligned if ada-indent-align-comments is t" |
30411
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
261 :type 'boolean :group 'ada) |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
262 |
25903
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
263 (defcustom ada-indent-comment-as-code t |
30411
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
264 "*Non-nil means indent comment lines as code. |
63528
d6d50a511d12
(ada-format-paramlist)
Juanma Barranquero <lekktu@gmail.com>
parents:
63425
diff
changeset
|
265 A nil value means do not auto-indent comments." |
25903
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
266 :type 'boolean :group 'ada) |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
267 |
44465
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
268 (defcustom ada-indent-handle-comment-special nil |
63528
d6d50a511d12
(ada-format-paramlist)
Juanma Barranquero <lekktu@gmail.com>
parents:
63425
diff
changeset
|
269 "*Non-nil if comment lines should be handled specially inside parenthesis. |
44465
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
270 By default, if the line that contains the open parenthesis has some |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
271 text following it, then the following lines will be indented in the |
63528
d6d50a511d12
(ada-format-paramlist)
Juanma Barranquero <lekktu@gmail.com>
parents:
63425
diff
changeset
|
272 same column as this text. This will not be true if the first line is |
44465
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
273 a comment and `ada-indent-handle-comment-special' is t. |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
274 |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
275 type A is |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
276 ( Value_1, -- common behavior, when not a comment |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
277 Value_2); |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
278 |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
279 type A is |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
280 ( -- `ada-indent-handle-comment-special' is nil |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
281 Value_1, |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
282 Value_2); |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
283 |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
284 type A is |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
285 ( -- `ada-indent-handle-comment-special' is non-nil |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
286 Value_1, |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
287 Value_2);" |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
288 :type 'boolean :group 'ada) |
49598
0d8b17d428b5
Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
45931
diff
changeset
|
289 |
25903
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
290 (defcustom ada-indent-is-separate t |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
291 "*Non-nil means indent 'is separate' or 'is abstract' if on a single line." |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
292 :type 'boolean :group 'ada) |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
293 |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
294 (defcustom ada-indent-record-rel-type 3 |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
295 "*Indentation for 'record' relative to 'type' or 'use'. |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
296 |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
297 An example is: |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
298 type A is |
73531
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
299 >>>>>>>>>>>record" |
25903
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
300 :type 'integer :group 'ada) |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
301 |
30411
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
302 (defcustom ada-indent-renames ada-broken-indent |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
303 "*Indentation for renames relative to the matching function statement. |
63528
d6d50a511d12
(ada-format-paramlist)
Juanma Barranquero <lekktu@gmail.com>
parents:
63425
diff
changeset
|
304 If `ada-indent-return' is null or negative, the indentation is done relative to |
d6d50a511d12
(ada-format-paramlist)
Juanma Barranquero <lekktu@gmail.com>
parents:
63425
diff
changeset
|
305 the open parenthesis (if there is no parenthesis, `ada-broken-indent' is used). |
30411
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
306 |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
307 An example is: |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
308 function A (B : Integer) |
73531
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
309 return C; |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
310 >>>renames Foo;" |
30411
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
311 :type 'integer :group 'ada) |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
312 |
25903
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
313 (defcustom ada-indent-return 0 |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
314 "*Indentation for 'return' relative to the matching 'function' statement. |
63528
d6d50a511d12
(ada-format-paramlist)
Juanma Barranquero <lekktu@gmail.com>
parents:
63425
diff
changeset
|
315 If `ada-indent-return' is null or negative, the indentation is done relative to |
d6d50a511d12
(ada-format-paramlist)
Juanma Barranquero <lekktu@gmail.com>
parents:
63425
diff
changeset
|
316 the open parenthesis (if there is no parenthesis, `ada-broken-indent' is used). |
25903
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
317 |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
318 An example is: |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
319 function A (B : Integer) |
73531
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
320 >>>>>return C;" |
25903
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
321 :type 'integer :group 'ada) |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
322 |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
323 (defcustom ada-indent-to-open-paren t |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
324 "*Non-nil means indent according to the innermost open parenthesis." |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
325 :type 'boolean :group 'ada) |
18120 | 326 |
41012
39ee7e7e2200
(ada-fill-comment-prefix): GNAT wants 2 spaces.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
38446
diff
changeset
|
327 (defcustom ada-fill-comment-prefix "-- " |
25903
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
328 "*Text inserted in the first columns when filling a comment paragraph. |
41036
aaa6f44a1b96
(ada-fill-comment-prefix): Doc fix.
Richard M. Stallman <rms@gnu.org>
parents:
41012
diff
changeset
|
329 Note: if you modify this variable, you will have to invoke `ada-mode' |
aaa6f44a1b96
(ada-fill-comment-prefix): Doc fix.
Richard M. Stallman <rms@gnu.org>
parents:
41012
diff
changeset
|
330 again to take account of the new value." |
25903
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
331 :type 'string :group 'ada) |
18120 | 332 |
333 (defcustom ada-fill-comment-postfix " --" | |
25903
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
334 "*Text inserted at the end of each line when filling a comment paragraph. |
63528
d6d50a511d12
(ada-format-paramlist)
Juanma Barranquero <lekktu@gmail.com>
parents:
63425
diff
changeset
|
335 Used by `ada-fill-comment-paragraph-postfix'." |
25903
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
336 :type 'string :group 'ada) |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
337 |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
338 (defcustom ada-label-indent -4 |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
339 "*Number of columns to indent a label. |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
340 |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
341 An example is: |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
342 procedure Foo is |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
343 begin |
73531
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
344 >>>>Label: |
45931
a4c8d672ccbe
* progmodes/ada-mode.el: Update copyright notice.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
44933
diff
changeset
|
345 |
a4c8d672ccbe
* progmodes/ada-mode.el: Update copyright notice.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
44933
diff
changeset
|
346 This is also used for <<..>> labels" |
25903
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
347 :type 'integer :group 'ada) |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
348 |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
349 (defcustom ada-language-version 'ada95 |
73932
242a56e8b2c0
Replace conditional (require 'ispell) with defvar.
Juanma Barranquero <lekktu@gmail.com>
parents:
73922
diff
changeset
|
350 "*Ada language version; one of `ada83', `ada95', `ada2005'." |
242a56e8b2c0
Replace conditional (require 'ispell) with defvar.
Juanma Barranquero <lekktu@gmail.com>
parents:
73922
diff
changeset
|
351 :type '(choice (const ada83) (const ada95) (const ada2005)) :group 'ada) |
25903
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
352 |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
353 (defcustom ada-move-to-declaration nil |
73531
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
354 "*Non-nil means `ada-move-to-start' moves to the subprogram declaration, not to 'begin'." |
25903
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
355 :type 'boolean :group 'ada) |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
356 |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
357 (defcustom ada-popup-key '[down-mouse-3] |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
358 "*Key used for binding the contextual menu. |
30411
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
359 If nil, no contextual menu is available." |
35959 | 360 :type '(restricted-sexp :match-alternatives (stringp vectorp)) |
35263 | 361 :group 'ada) |
25903
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
362 |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
363 (defcustom ada-search-directories |
50736
b0ce71ab9c28
(ada-search-directories): Take into account ADA_INCLUDE_PATH for better
Juanma Barranquero <lekktu@gmail.com>
parents:
49598
diff
changeset
|
364 (append '(".") |
b0ce71ab9c28
(ada-search-directories): Take into account ADA_INCLUDE_PATH for better
Juanma Barranquero <lekktu@gmail.com>
parents:
49598
diff
changeset
|
365 (split-string (or (getenv "ADA_INCLUDE_PATH") "") ":") |
b0ce71ab9c28
(ada-search-directories): Take into account ADA_INCLUDE_PATH for better
Juanma Barranquero <lekktu@gmail.com>
parents:
49598
diff
changeset
|
366 '("/usr/adainclude" "/usr/local/adainclude" |
b0ce71ab9c28
(ada-search-directories): Take into account ADA_INCLUDE_PATH for better
Juanma Barranquero <lekktu@gmail.com>
parents:
49598
diff
changeset
|
367 "/opt/gnu/adainclude")) |
73531
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
368 "*Default list of directories to search for Ada files. |
63528
d6d50a511d12
(ada-format-paramlist)
Juanma Barranquero <lekktu@gmail.com>
parents:
63425
diff
changeset
|
369 See the description for the `ff-search-directories' variable. This variable |
73531
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
370 is the initial value of `ada-search-directories-internal'." |
25903
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
371 :type '(repeat (choice :tag "Directory" |
73531
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
372 (const :tag "default" nil) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
373 (directory :format "%v"))) |
18120 | 374 :group 'ada) |
375 | |
50812
15929fed5553
(ada-xemacs): Variable removed, since it's better to use (featurep 'xemacs).
Juanma Barranquero <lekktu@gmail.com>
parents:
50736
diff
changeset
|
376 (defvar ada-search-directories-internal ada-search-directories |
15929fed5553
(ada-xemacs): Variable removed, since it's better to use (featurep 'xemacs).
Juanma Barranquero <lekktu@gmail.com>
parents:
50736
diff
changeset
|
377 "Internal version of `ada-search-directories'. |
15929fed5553
(ada-xemacs): Variable removed, since it's better to use (featurep 'xemacs).
Juanma Barranquero <lekktu@gmail.com>
parents:
50736
diff
changeset
|
378 Its value is the concatenation of the search path as read in the project file |
15929fed5553
(ada-xemacs): Variable removed, since it's better to use (featurep 'xemacs).
Juanma Barranquero <lekktu@gmail.com>
parents:
50736
diff
changeset
|
379 and the standard runtime location, and the value of the user-defined |
63528
d6d50a511d12
(ada-format-paramlist)
Juanma Barranquero <lekktu@gmail.com>
parents:
63425
diff
changeset
|
380 `ada-search-directories'.") |
50812
15929fed5553
(ada-xemacs): Variable removed, since it's better to use (featurep 'xemacs).
Juanma Barranquero <lekktu@gmail.com>
parents:
50736
diff
changeset
|
381 |
25903
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
382 (defcustom ada-stmt-end-indent 0 |
26225
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
383 "*Number of columns to indent the end of a statement on a separate line. |
25903
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
384 |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
385 An example is: |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
386 if A = B |
73531
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
387 >>>>then" |
25903
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
388 :type 'integer :group 'ada) |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
389 |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
390 (defcustom ada-tab-policy 'indent-auto |
26225
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
391 "*Control the behavior of the TAB key. |
25903
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
392 Must be one of : |
63528
d6d50a511d12
(ada-format-paramlist)
Juanma Barranquero <lekktu@gmail.com>
parents:
63425
diff
changeset
|
393 `indent-rigidly' : always adds `ada-indent' blanks at the beginning of the line. |
25903
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
394 `indent-auto' : use indentation functions in this file. |
73531
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
395 `always-tab' : do `indent-relative'." |
25903
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
396 :type '(choice (const indent-auto) |
73531
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
397 (const indent-rigidly) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
398 (const always-tab)) |
18120 | 399 :group 'ada) |
10705 | 400 |
30411
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
401 (defcustom ada-use-indent ada-broken-indent |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
402 "*Indentation for the lines in a 'use' statement. |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
403 |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
404 An example is: |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
405 use Ada.Text_IO, |
73531
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
406 >>>>Ada.Numerics;" |
30411
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
407 :type 'integer :group 'ada) |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
408 |
25903
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
409 (defcustom ada-when-indent 3 |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
410 "*Indentation for 'when' relative to 'exception' or 'case'. |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
411 |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
412 An example is: |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
413 case A is |
73531
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
414 >>>>when B =>" |
25903
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
415 :type 'integer :group 'ada) |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
416 |
30411
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
417 (defcustom ada-with-indent ada-broken-indent |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
418 "*Indentation for the lines in a 'with' statement. |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
419 |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
420 An example is: |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
421 with Ada.Text_IO, |
73531
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
422 >>>>Ada.Numerics;" |
30411
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
423 :type 'integer :group 'ada) |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
424 |
25903
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
425 (defcustom ada-which-compiler 'gnat |
26225
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
426 "*Name of the compiler to use. |
71537
2a4ed80e93ba
(ada-which-compiler, ada-mode-menu, ada-compile-mouse-goto-error,
Juanma Barranquero <lekktu@gmail.com>
parents:
68764
diff
changeset
|
427 This will determine what features are made available through the Ada mode. |
73422
e1bac685e6a0
(ada-83-string-keywords, ada-last-which-function-line ada-no-auto-case,
Juanma Barranquero <lekktu@gmail.com>
parents:
71924
diff
changeset
|
428 The possible choices are: |
74202
abb4062752c5
(ada-which-compiler): Fix typo in docstring.
Juanma Barranquero <lekktu@gmail.com>
parents:
74073
diff
changeset
|
429 `gnat': Use Ada Core Technologies' GNAT compiler. Add some cross-referencing |
73422
e1bac685e6a0
(ada-83-string-keywords, ada-last-which-function-line ada-no-auto-case,
Juanma Barranquero <lekktu@gmail.com>
parents:
71924
diff
changeset
|
430 features. |
e1bac685e6a0
(ada-83-string-keywords, ada-last-which-function-line ada-no-auto-case,
Juanma Barranquero <lekktu@gmail.com>
parents:
71924
diff
changeset
|
431 `generic': Use a generic compiler." |
25903
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
432 :type '(choice (const gnat) |
73531
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
433 (const generic)) |
25903
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
434 :group 'ada) |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
435 |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
436 |
10705 | 437 ;;; ---- end of user configurable variables |
438 | |
439 | |
25903
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
440 (defvar ada-body-suffixes '(".adb") |
26225
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
441 "List of possible suffixes for Ada body files. |
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
442 The extensions should include a `.' if needed.") |
25903
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
443 |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
444 (defvar ada-spec-suffixes '(".ads") |
26225
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
445 "List of possible suffixes for Ada spec files. |
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
446 The extensions should include a `.' if needed.") |
25903
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
447 |
32300
5acb191f2a15
(ada-mode-menu): Add name to menu map.
Dave Love <fx@gnu.org>
parents:
30411
diff
changeset
|
448 (defvar ada-mode-menu (make-sparse-keymap "Ada") |
71537
2a4ed80e93ba
(ada-which-compiler, ada-mode-menu, ada-compile-mouse-goto-error,
Juanma Barranquero <lekktu@gmail.com>
parents:
68764
diff
changeset
|
449 "Menu for Ada mode.") |
25903
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
450 |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
451 (defvar ada-mode-map (make-sparse-keymap) |
17914
e5e2ef0dd5ab
(ada-krunch-args): Use gnatkr instead of gnatk8.
Richard M. Stallman <rms@gnu.org>
parents:
14415
diff
changeset
|
452 "Local keymap used for Ada mode.") |
10705 | 453 |
95268
bcc553c768f9
* textmodes/reftex-vars.el (reftex-extra-bindings-prefix): New var.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
94673
diff
changeset
|
454 (defvar ada-mode-extra-map (make-sparse-keymap) |
bcc553c768f9
* textmodes/reftex-vars.el (reftex-extra-bindings-prefix): New var.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
94673
diff
changeset
|
455 "Keymap used for non-standard keybindings.") |
bcc553c768f9
* textmodes/reftex-vars.el (reftex-extra-bindings-prefix): New var.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
94673
diff
changeset
|
456 |
bcc553c768f9
* textmodes/reftex-vars.el (reftex-extra-bindings-prefix): New var.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
94673
diff
changeset
|
457 ;; default is C-c C-q because it's free in ada-mode-map |
bcc553c768f9
* textmodes/reftex-vars.el (reftex-extra-bindings-prefix): New var.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
94673
diff
changeset
|
458 (defvar ada-mode-extra-prefix "\C-c\C-q" |
bcc553c768f9
* textmodes/reftex-vars.el (reftex-extra-bindings-prefix): New var.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
94673
diff
changeset
|
459 "Prefix key to access `ada-mode-extra-map' functions.") |
bcc553c768f9
* textmodes/reftex-vars.el (reftex-extra-bindings-prefix): New var.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
94673
diff
changeset
|
460 |
30411
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
461 (defvar ada-mode-abbrev-table nil |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
462 "Local abbrev table for Ada mode.") |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
463 |
10705 | 464 (defvar ada-mode-syntax-table nil |
465 "Syntax table to be used for editing Ada source code.") | |
466 | |
12039
a75524689022
(initial comments): Copyright 1995; don't speak
Karl Heuer <kwzh@gnu.org>
parents:
11869
diff
changeset
|
467 (defvar ada-mode-symbol-syntax-table nil |
a75524689022
(initial comments): Copyright 1995; don't speak
Karl Heuer <kwzh@gnu.org>
parents:
11869
diff
changeset
|
468 "Syntax table for Ada, where `_' is a word constituent.") |
a75524689022
(initial comments): Copyright 1995; don't speak
Karl Heuer <kwzh@gnu.org>
parents:
11869
diff
changeset
|
469 |
73935
a1e6ec065b4f
(ada-83-string-keywords, ada-95-string-keywords, ada-2005-string-keywords):
Juanma Barranquero <lekktu@gmail.com>
parents:
73932
diff
changeset
|
470 (eval-when-compile |
74002
5909c257c4ea
(ada-mode-version): Bump version.
Juanma Barranquero <lekktu@gmail.com>
parents:
73935
diff
changeset
|
471 ;; These values are used in eval-when-compile expressions. |
73935
a1e6ec065b4f
(ada-83-string-keywords, ada-95-string-keywords, ada-2005-string-keywords):
Juanma Barranquero <lekktu@gmail.com>
parents:
73932
diff
changeset
|
472 (defconst ada-83-string-keywords |
a1e6ec065b4f
(ada-83-string-keywords, ada-95-string-keywords, ada-2005-string-keywords):
Juanma Barranquero <lekktu@gmail.com>
parents:
73932
diff
changeset
|
473 '("abort" "abs" "accept" "access" "all" "and" "array" "at" "begin" |
a1e6ec065b4f
(ada-83-string-keywords, ada-95-string-keywords, ada-2005-string-keywords):
Juanma Barranquero <lekktu@gmail.com>
parents:
73932
diff
changeset
|
474 "body" "case" "constant" "declare" "delay" "delta" "digits" "do" |
a1e6ec065b4f
(ada-83-string-keywords, ada-95-string-keywords, ada-2005-string-keywords):
Juanma Barranquero <lekktu@gmail.com>
parents:
73932
diff
changeset
|
475 "else" "elsif" "end" "entry" "exception" "exit" "for" "function" |
a1e6ec065b4f
(ada-83-string-keywords, ada-95-string-keywords, ada-2005-string-keywords):
Juanma Barranquero <lekktu@gmail.com>
parents:
73932
diff
changeset
|
476 "generic" "goto" "if" "in" "is" "limited" "loop" "mod" "new" |
a1e6ec065b4f
(ada-83-string-keywords, ada-95-string-keywords, ada-2005-string-keywords):
Juanma Barranquero <lekktu@gmail.com>
parents:
73932
diff
changeset
|
477 "not" "null" "of" "or" "others" "out" "package" "pragma" "private" |
a1e6ec065b4f
(ada-83-string-keywords, ada-95-string-keywords, ada-2005-string-keywords):
Juanma Barranquero <lekktu@gmail.com>
parents:
73932
diff
changeset
|
478 "procedure" "raise" "range" "record" "rem" "renames" "return" |
a1e6ec065b4f
(ada-83-string-keywords, ada-95-string-keywords, ada-2005-string-keywords):
Juanma Barranquero <lekktu@gmail.com>
parents:
73932
diff
changeset
|
479 "reverse" "select" "separate" "subtype" "task" "terminate" "then" |
a1e6ec065b4f
(ada-83-string-keywords, ada-95-string-keywords, ada-2005-string-keywords):
Juanma Barranquero <lekktu@gmail.com>
parents:
73932
diff
changeset
|
480 "type" "use" "when" "while" "with" "xor") |
a1e6ec065b4f
(ada-83-string-keywords, ada-95-string-keywords, ada-2005-string-keywords):
Juanma Barranquero <lekktu@gmail.com>
parents:
73932
diff
changeset
|
481 "List of Ada 83 keywords. |
73932
242a56e8b2c0
Replace conditional (require 'ispell) with defvar.
Juanma Barranquero <lekktu@gmail.com>
parents:
73922
diff
changeset
|
482 Used to define `ada-*-keywords'.") |
242a56e8b2c0
Replace conditional (require 'ispell) with defvar.
Juanma Barranquero <lekktu@gmail.com>
parents:
73922
diff
changeset
|
483 |
73935
a1e6ec065b4f
(ada-83-string-keywords, ada-95-string-keywords, ada-2005-string-keywords):
Juanma Barranquero <lekktu@gmail.com>
parents:
73932
diff
changeset
|
484 (defconst ada-95-string-keywords |
a1e6ec065b4f
(ada-83-string-keywords, ada-95-string-keywords, ada-2005-string-keywords):
Juanma Barranquero <lekktu@gmail.com>
parents:
73932
diff
changeset
|
485 '("abstract" "aliased" "protected" "requeue" "tagged" "until") |
a1e6ec065b4f
(ada-83-string-keywords, ada-95-string-keywords, ada-2005-string-keywords):
Juanma Barranquero <lekktu@gmail.com>
parents:
73932
diff
changeset
|
486 "List of keywords new in Ada 95. |
73932
242a56e8b2c0
Replace conditional (require 'ispell) with defvar.
Juanma Barranquero <lekktu@gmail.com>
parents:
73922
diff
changeset
|
487 Used to define `ada-*-keywords'.") |
242a56e8b2c0
Replace conditional (require 'ispell) with defvar.
Juanma Barranquero <lekktu@gmail.com>
parents:
73922
diff
changeset
|
488 |
73935
a1e6ec065b4f
(ada-83-string-keywords, ada-95-string-keywords, ada-2005-string-keywords):
Juanma Barranquero <lekktu@gmail.com>
parents:
73932
diff
changeset
|
489 (defconst ada-2005-string-keywords |
a1e6ec065b4f
(ada-83-string-keywords, ada-95-string-keywords, ada-2005-string-keywords):
Juanma Barranquero <lekktu@gmail.com>
parents:
73932
diff
changeset
|
490 '("interface" "overriding" "synchronized") |
a1e6ec065b4f
(ada-83-string-keywords, ada-95-string-keywords, ada-2005-string-keywords):
Juanma Barranquero <lekktu@gmail.com>
parents:
73932
diff
changeset
|
491 "List of keywords new in Ada 2005. |
a1e6ec065b4f
(ada-83-string-keywords, ada-95-string-keywords, ada-2005-string-keywords):
Juanma Barranquero <lekktu@gmail.com>
parents:
73932
diff
changeset
|
492 Used to define `ada-*-keywords.'")) |
25903
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
493 |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
494 (defvar ada-ret-binding nil |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
495 "Variable to save key binding of RET when casing is activated.") |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
496 |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
497 (defvar ada-case-exception '() |
26225
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
498 "Alist of words (entities) that have special casing.") |
25903
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
499 |
44465
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
500 (defvar ada-case-exception-substring '() |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
501 "Alist of substrings (entities) that have special casing. |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
502 The substrings are detected for word constituant when the word |
63528
d6d50a511d12
(ada-format-paramlist)
Juanma Barranquero <lekktu@gmail.com>
parents:
63425
diff
changeset
|
503 is not itself in `ada-case-exception', and only for substrings that |
44465
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
504 either are at the beginning or end of the word, or start after '_'.") |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
505 |
25903
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
506 (defvar ada-lfd-binding nil |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
507 "Variable to save key binding of LFD when casing is activated.") |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
508 |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
509 (defvar ada-other-file-alist nil |
63528
d6d50a511d12
(ada-format-paramlist)
Juanma Barranquero <lekktu@gmail.com>
parents:
63425
diff
changeset
|
510 "Variable used by `find-file' to find the name of the other package. |
26225
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
511 See `ff-other-file-alist'.") |
25903
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
512 |
44465
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
513 (defvar ada-align-list |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
514 '(("[^:]\\(\\s-*\\):[^:]" 1 t) |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
515 ("[^=]\\(\\s-+\\)=[^=]" 1 t) |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
516 ("\\(\\s-*\\)use\\s-" 1) |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
517 ("\\(\\s-*\\)--" 1)) |
73531
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
518 "Ada support for align.el <= 2.2. |
44465
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
519 This variable provides regular expressions on which to align different lines. |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
520 See `align-mode-alist' for more information.") |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
521 |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
522 (defvar ada-align-modes |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
523 '((ada-declaration |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
524 (regexp . "[^:]\\(\\s-*\\):[^:]") |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
525 (valid . (lambda() (not (ada-in-comment-p)))) |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
526 (modes . '(ada-mode))) |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
527 (ada-assignment |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
528 (regexp . "[^=]\\(\\s-+\\)=[^=]") |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
529 (valid . (lambda() (not (ada-in-comment-p)))) |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
530 (modes . '(ada-mode))) |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
531 (ada-comment |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
532 (regexp . "\\(\\s-*\\)--") |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
533 (modes . '(ada-mode))) |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
534 (ada-use |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
535 (regexp . "\\(\\s-*\\)use\\s-") |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
536 (valid . (lambda() (not (ada-in-comment-p)))) |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
537 (modes . '(ada-mode))) |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
538 ) |
73422
e1bac685e6a0
(ada-83-string-keywords, ada-last-which-function-line ada-no-auto-case,
Juanma Barranquero <lekktu@gmail.com>
parents:
71924
diff
changeset
|
539 "Ada support for align.el >= 2.8. |
44465
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
540 This variable defines several rules to use to align different lines.") |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
541 |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
542 (defconst ada-align-region-separate |
73932
242a56e8b2c0
Replace conditional (require 'ispell) with defvar.
Juanma Barranquero <lekktu@gmail.com>
parents:
73922
diff
changeset
|
543 (eval-when-compile |
242a56e8b2c0
Replace conditional (require 'ispell) with defvar.
Juanma Barranquero <lekktu@gmail.com>
parents:
73922
diff
changeset
|
544 (concat |
242a56e8b2c0
Replace conditional (require 'ispell) with defvar.
Juanma Barranquero <lekktu@gmail.com>
parents:
73922
diff
changeset
|
545 "^\\s-*\\($\\|\\(" |
242a56e8b2c0
Replace conditional (require 'ispell) with defvar.
Juanma Barranquero <lekktu@gmail.com>
parents:
73922
diff
changeset
|
546 "begin\\|" |
242a56e8b2c0
Replace conditional (require 'ispell) with defvar.
Juanma Barranquero <lekktu@gmail.com>
parents:
73922
diff
changeset
|
547 "declare\\|" |
242a56e8b2c0
Replace conditional (require 'ispell) with defvar.
Juanma Barranquero <lekktu@gmail.com>
parents:
73922
diff
changeset
|
548 "else\\|" |
242a56e8b2c0
Replace conditional (require 'ispell) with defvar.
Juanma Barranquero <lekktu@gmail.com>
parents:
73922
diff
changeset
|
549 "end\\|" |
242a56e8b2c0
Replace conditional (require 'ispell) with defvar.
Juanma Barranquero <lekktu@gmail.com>
parents:
73922
diff
changeset
|
550 "exception\\|" |
242a56e8b2c0
Replace conditional (require 'ispell) with defvar.
Juanma Barranquero <lekktu@gmail.com>
parents:
73922
diff
changeset
|
551 "for\\|" |
242a56e8b2c0
Replace conditional (require 'ispell) with defvar.
Juanma Barranquero <lekktu@gmail.com>
parents:
73922
diff
changeset
|
552 "function\\|" |
242a56e8b2c0
Replace conditional (require 'ispell) with defvar.
Juanma Barranquero <lekktu@gmail.com>
parents:
73922
diff
changeset
|
553 "generic\\|" |
242a56e8b2c0
Replace conditional (require 'ispell) with defvar.
Juanma Barranquero <lekktu@gmail.com>
parents:
73922
diff
changeset
|
554 "if\\|" |
242a56e8b2c0
Replace conditional (require 'ispell) with defvar.
Juanma Barranquero <lekktu@gmail.com>
parents:
73922
diff
changeset
|
555 "is\\|" |
242a56e8b2c0
Replace conditional (require 'ispell) with defvar.
Juanma Barranquero <lekktu@gmail.com>
parents:
73922
diff
changeset
|
556 "procedure\\|" |
242a56e8b2c0
Replace conditional (require 'ispell) with defvar.
Juanma Barranquero <lekktu@gmail.com>
parents:
73922
diff
changeset
|
557 "record\\|" |
242a56e8b2c0
Replace conditional (require 'ispell) with defvar.
Juanma Barranquero <lekktu@gmail.com>
parents:
73922
diff
changeset
|
558 "return\\|" |
242a56e8b2c0
Replace conditional (require 'ispell) with defvar.
Juanma Barranquero <lekktu@gmail.com>
parents:
73922
diff
changeset
|
559 "type\\|" |
242a56e8b2c0
Replace conditional (require 'ispell) with defvar.
Juanma Barranquero <lekktu@gmail.com>
parents:
73922
diff
changeset
|
560 "when" |
242a56e8b2c0
Replace conditional (require 'ispell) with defvar.
Juanma Barranquero <lekktu@gmail.com>
parents:
73922
diff
changeset
|
561 "\\)\\>\\)")) |
63528
d6d50a511d12
(ada-format-paramlist)
Juanma Barranquero <lekktu@gmail.com>
parents:
63425
diff
changeset
|
562 "See the variable `align-region-separate' for more information.") |
44465
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
563 |
25903
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
564 ;;; ---- Below are the regexp used in this package for parsing |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
565 |
10705 | 566 (defconst ada-83-keywords |
25903
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
567 (eval-when-compile |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
568 (concat "\\<" (regexp-opt ada-83-string-keywords t) "\\>")) |
73922
289cedd46cd8
Delete `eval-and-compile' around `require'.
Juanma Barranquero <lekktu@gmail.com>
parents:
73531
diff
changeset
|
569 "Regular expression matching Ada83 keywords.") |
10705 | 570 |
12039
a75524689022
(initial comments): Copyright 1995; don't speak
Karl Heuer <kwzh@gnu.org>
parents:
11869
diff
changeset
|
571 (defconst ada-95-keywords |
25903
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
572 (eval-when-compile |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
573 (concat "\\<" (regexp-opt |
73531
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
574 (append |
73922
289cedd46cd8
Delete `eval-and-compile' around `require'.
Juanma Barranquero <lekktu@gmail.com>
parents:
73531
diff
changeset
|
575 ada-95-string-keywords |
73531
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
576 ada-83-string-keywords) t) "\\>")) |
73922
289cedd46cd8
Delete `eval-and-compile' around `require'.
Juanma Barranquero <lekktu@gmail.com>
parents:
73531
diff
changeset
|
577 "Regular expression matching Ada95 keywords.") |
289cedd46cd8
Delete `eval-and-compile' around `require'.
Juanma Barranquero <lekktu@gmail.com>
parents:
73531
diff
changeset
|
578 |
289cedd46cd8
Delete `eval-and-compile' around `require'.
Juanma Barranquero <lekktu@gmail.com>
parents:
73531
diff
changeset
|
579 (defconst ada-2005-keywords |
289cedd46cd8
Delete `eval-and-compile' around `require'.
Juanma Barranquero <lekktu@gmail.com>
parents:
73531
diff
changeset
|
580 (eval-when-compile |
289cedd46cd8
Delete `eval-and-compile' around `require'.
Juanma Barranquero <lekktu@gmail.com>
parents:
73531
diff
changeset
|
581 (concat "\\<" (regexp-opt |
289cedd46cd8
Delete `eval-and-compile' around `require'.
Juanma Barranquero <lekktu@gmail.com>
parents:
73531
diff
changeset
|
582 (append |
289cedd46cd8
Delete `eval-and-compile' around `require'.
Juanma Barranquero <lekktu@gmail.com>
parents:
73531
diff
changeset
|
583 ada-2005-string-keywords |
289cedd46cd8
Delete `eval-and-compile' around `require'.
Juanma Barranquero <lekktu@gmail.com>
parents:
73531
diff
changeset
|
584 ada-83-string-keywords |
289cedd46cd8
Delete `eval-and-compile' around `require'.
Juanma Barranquero <lekktu@gmail.com>
parents:
73531
diff
changeset
|
585 ada-95-string-keywords) t) "\\>")) |
289cedd46cd8
Delete `eval-and-compile' around `require'.
Juanma Barranquero <lekktu@gmail.com>
parents:
73531
diff
changeset
|
586 "Regular expression matching Ada2005 keywords.") |
289cedd46cd8
Delete `eval-and-compile' around `require'.
Juanma Barranquero <lekktu@gmail.com>
parents:
73531
diff
changeset
|
587 |
289cedd46cd8
Delete `eval-and-compile' around `require'.
Juanma Barranquero <lekktu@gmail.com>
parents:
73531
diff
changeset
|
588 (defvar ada-keywords ada-2005-keywords |
289cedd46cd8
Delete `eval-and-compile' around `require'.
Juanma Barranquero <lekktu@gmail.com>
parents:
73531
diff
changeset
|
589 "Regular expression matching Ada keywords.") |
289cedd46cd8
Delete `eval-and-compile' around `require'.
Juanma Barranquero <lekktu@gmail.com>
parents:
73531
diff
changeset
|
590 ;; FIXME: make this customizable |
10705 | 591 |
25903
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
592 (defconst ada-ident-re |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
593 "\\(\\sw\\|[_.]\\)+" |
12586
f8bbc7a3b87a
(ada-ident-re): Doc fix.
Richard M. Stallman <rms@gnu.org>
parents:
12053
diff
changeset
|
594 "Regexp matching Ada (qualified) identifiers.") |
12039
a75524689022
(initial comments): Copyright 1995; don't speak
Karl Heuer <kwzh@gnu.org>
parents:
11869
diff
changeset
|
595 |
73922
289cedd46cd8
Delete `eval-and-compile' around `require'.
Juanma Barranquero <lekktu@gmail.com>
parents:
73531
diff
changeset
|
596 ;; "with" needs to be included in the regexp, to match generic subprogram parameters |
289cedd46cd8
Delete `eval-and-compile' around `require'.
Juanma Barranquero <lekktu@gmail.com>
parents:
73531
diff
changeset
|
597 ;; Similarly, we put '[not] overriding' on the same line with 'procedure' etc. |
10705 | 598 (defvar ada-procedure-start-regexp |
44465
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
599 (concat |
73922
289cedd46cd8
Delete `eval-and-compile' around `require'.
Juanma Barranquero <lekktu@gmail.com>
parents:
73531
diff
changeset
|
600 "^[ \t]*\\(with[ \t]+\\)?\\(\\(not[ \t]+\\)?overriding[ \t]+\\)?\\(procedure\\|function\\|task\\)[ \t\n]+" |
44465
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
601 |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
602 ;; subprogram name: operator ("[+/=*]") |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
603 "\\(" |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
604 "\\(\"[^\"]+\"\\)" |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
605 |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
606 ;; subprogram name: name |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
607 "\\|" |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
608 "\\(\\(\\sw\\|[_.]\\)+\\)" |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
609 "\\)") |
73922
289cedd46cd8
Delete `eval-and-compile' around `require'.
Juanma Barranquero <lekktu@gmail.com>
parents:
73531
diff
changeset
|
610 "Regexp matching Ada subprogram start. |
78600
4f60c94dc647
Fix up comment style in header.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
78589
diff
changeset
|
611 The actual start is at (match-beginning 4). The name is in (match-string 5).") |
73922
289cedd46cd8
Delete `eval-and-compile' around `require'.
Juanma Barranquero <lekktu@gmail.com>
parents:
73531
diff
changeset
|
612 |
289cedd46cd8
Delete `eval-and-compile' around `require'.
Juanma Barranquero <lekktu@gmail.com>
parents:
73531
diff
changeset
|
613 (defconst ada-name-regexp |
73932
242a56e8b2c0
Replace conditional (require 'ispell) with defvar.
Juanma Barranquero <lekktu@gmail.com>
parents:
73922
diff
changeset
|
614 "\\([a-zA-Z][a-zA-Z0-9_.']*[a-zA-Z0-9]\\)" |
73922
289cedd46cd8
Delete `eval-and-compile' around `require'.
Juanma Barranquero <lekktu@gmail.com>
parents:
73531
diff
changeset
|
615 "Regexp matching a fully qualified name (including attribute).") |
289cedd46cd8
Delete `eval-and-compile' around `require'.
Juanma Barranquero <lekktu@gmail.com>
parents:
73531
diff
changeset
|
616 |
289cedd46cd8
Delete `eval-and-compile' around `require'.
Juanma Barranquero <lekktu@gmail.com>
parents:
73531
diff
changeset
|
617 (defconst ada-package-start-regexp |
289cedd46cd8
Delete `eval-and-compile' around `require'.
Juanma Barranquero <lekktu@gmail.com>
parents:
73531
diff
changeset
|
618 (concat "^[ \t]*\\(private[ \t]+\\)?\\(package\\)[ \t\n]+\\(body[ \t]*\\)?" ada-name-regexp) |
289cedd46cd8
Delete `eval-and-compile' around `require'.
Juanma Barranquero <lekktu@gmail.com>
parents:
73531
diff
changeset
|
619 "Regexp matching start of package. |
289cedd46cd8
Delete `eval-and-compile' around `require'.
Juanma Barranquero <lekktu@gmail.com>
parents:
73531
diff
changeset
|
620 The package name is in (match-string 4).") |
10705 | 621 |
73932
242a56e8b2c0
Replace conditional (require 'ispell) with defvar.
Juanma Barranquero <lekktu@gmail.com>
parents:
73922
diff
changeset
|
622 (defconst ada-compile-goto-error-file-linenr-re |
242a56e8b2c0
Replace conditional (require 'ispell) with defvar.
Juanma Barranquero <lekktu@gmail.com>
parents:
73922
diff
changeset
|
623 "\\([-_.a-zA-Z0-9]+\\):\\([0-9]+\\)\\(:\\([0-9]+\\)\\)?" |
242a56e8b2c0
Replace conditional (require 'ispell) with defvar.
Juanma Barranquero <lekktu@gmail.com>
parents:
73922
diff
changeset
|
624 "Regexp matching filename:linenr[:column].") |
242a56e8b2c0
Replace conditional (require 'ispell) with defvar.
Juanma Barranquero <lekktu@gmail.com>
parents:
73922
diff
changeset
|
625 |
242a56e8b2c0
Replace conditional (require 'ispell) with defvar.
Juanma Barranquero <lekktu@gmail.com>
parents:
73922
diff
changeset
|
626 |
10705 | 627 ;;; ---- regexps for indentation functions |
628 | |
629 (defvar ada-block-start-re | |
25903
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
630 (eval-when-compile |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
631 (concat "\\<\\(" (regexp-opt '("begin" "declare" "else" |
73531
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
632 "exception" "generic" "loop" "or" |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
633 "private" "select" )) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
634 "\\|\\(\\(limited\\|abstract\\|tagged\\)[ \t\n]+\\)*record\\)\\>")) |
13231
fb78cec8e440
All doc strings changed to comply with standard Emacs conventions.
Richard M. Stallman <rms@gnu.org>
parents:
13160
diff
changeset
|
635 "Regexp for keywords starting Ada blocks.") |
10705 | 636 |
637 (defvar ada-end-stmt-re | |
25903
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
638 (eval-when-compile |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
639 (concat "\\(" |
73531
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
640 ";" "\\|" |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
641 "=>[ \t]*$" "\\|" |
97058
b6ac850e9d2b
Fix bug #272, and update Ada mode to version 4.0.
Juanma Barranquero <lekktu@gmail.com>
parents:
95268
diff
changeset
|
642 "=>[ \t]*--.*$" "\\|" |
73531
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
643 "^[ \t]*separate[ \t]*(\\(\\sw\\|[_.]\\)+)" "\\|" |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
644 "\\<" (regexp-opt '("begin" "declare" "is" "do" "else" "generic" |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
645 "loop" "private" "record" "select" |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
646 "then abort" "then") t) "\\>" "\\|" |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
647 "^[ \t]*" (regexp-opt '("function" "package" "procedure") |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
648 t) "\\>\\(\\sw\\|[ \t_.]\\)+\\<is\\>" "\\|" |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
649 "^[ \t]*exception\\>" |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
650 "\\)") ) |
10705 | 651 "Regexp of possible ends for a non-broken statement. |
13231
fb78cec8e440
All doc strings changed to comply with standard Emacs conventions.
Richard M. Stallman <rms@gnu.org>
parents:
13160
diff
changeset
|
652 A new statement starts after these.") |
10705 | 653 |
25903
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
654 (defvar ada-matching-start-re |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
655 (eval-when-compile |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
656 (concat "\\<" |
73531
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
657 (regexp-opt |
73932
242a56e8b2c0
Replace conditional (require 'ispell) with defvar.
Juanma Barranquero <lekktu@gmail.com>
parents:
73922
diff
changeset
|
658 '("end" "loop" "select" "begin" "case" "do" "declare" |
242a56e8b2c0
Replace conditional (require 'ispell) with defvar.
Juanma Barranquero <lekktu@gmail.com>
parents:
73922
diff
changeset
|
659 "if" "task" "package" "procedure" "function" "record" "protected") t) |
73531
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
660 "\\>")) |
63528
d6d50a511d12
(ada-format-paramlist)
Juanma Barranquero <lekktu@gmail.com>
parents:
63425
diff
changeset
|
661 "Regexp used in `ada-goto-matching-start'.") |
25903
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
662 |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
663 (defvar ada-matching-decl-start-re |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
664 (eval-when-compile |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
665 (concat "\\<" |
73531
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
666 (regexp-opt |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
667 '("is" "separate" "end" "declare" "if" "new" "begin" "generic" "when") t) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
668 "\\>")) |
63528
d6d50a511d12
(ada-format-paramlist)
Juanma Barranquero <lekktu@gmail.com>
parents:
63425
diff
changeset
|
669 "Regexp used in `ada-goto-matching-decl-start'.") |
25903
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
670 |
10705 | 671 (defvar ada-loop-start-re |
672 "\\<\\(for\\|while\\|loop\\)\\>" | |
673 "Regexp for the start of a loop.") | |
674 | |
675 (defvar ada-subprog-start-re | |
25903
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
676 (eval-when-compile |
106830
4ff0e607507d
* progmodes/ada-mode.el: Deal with Ada 2005 "overriding" keyword.
Juanma Barranquero <lekktu@gmail.com>
parents:
106829
diff
changeset
|
677 (concat "\\<" (regexp-opt '("accept" "entry" "function" "overriding" "package" "procedure" |
73531
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
678 "protected" "task") t) "\\>")) |
10705 | 679 "Regexp for the start of a subprogram.") |
680 | |
17914
e5e2ef0dd5ab
(ada-krunch-args): Use gnatkr instead of gnatk8.
Richard M. Stallman <rms@gnu.org>
parents:
14415
diff
changeset
|
681 (defvar ada-named-block-re |
25903
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
682 "[ \t]*\\(\\sw\\|_\\)+[ \t]*:[^=]" |
17914
e5e2ef0dd5ab
(ada-krunch-args): Use gnatkr instead of gnatk8.
Richard M. Stallman <rms@gnu.org>
parents:
14415
diff
changeset
|
683 "Regexp of the name of a block or loop.") |
e5e2ef0dd5ab
(ada-krunch-args): Use gnatkr instead of gnatk8.
Richard M. Stallman <rms@gnu.org>
parents:
14415
diff
changeset
|
684 |
26225
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
685 (defvar ada-contextual-menu-on-identifier nil |
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
686 "Set to true when the right mouse button was clicked on an identifier.") |
25903
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
687 |
30411
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
688 (defvar ada-contextual-menu-last-point nil |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
689 "Position of point just before displaying the menu. |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
690 This is a list (point buffer). |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
691 Since `ada-popup-menu' moves the point where the user clicked, the region |
63528
d6d50a511d12
(ada-format-paramlist)
Juanma Barranquero <lekktu@gmail.com>
parents:
63425
diff
changeset
|
692 is modified. Therefore no command from the menu knows what the user selected |
30411
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
693 before displaying the contextual menu. |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
694 To get the original region, restore the point to this position before |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
695 calling `region-end' and `region-beginning'. |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
696 Modify this variable if you want to restore the point to another position.") |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
697 |
50736
b0ce71ab9c28
(ada-search-directories): Take into account ADA_INCLUDE_PATH for better
Juanma Barranquero <lekktu@gmail.com>
parents:
49598
diff
changeset
|
698 (easy-menu-define ada-contextual-menu nil |
b0ce71ab9c28
(ada-search-directories): Take into account ADA_INCLUDE_PATH for better
Juanma Barranquero <lekktu@gmail.com>
parents:
49598
diff
changeset
|
699 "Menu to use when the user presses the right mouse button. |
30411
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
700 The variable `ada-contextual-menu-on-identifier' will be set to t before |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
701 displaying the menu if point was on an identifier." |
50736
b0ce71ab9c28
(ada-search-directories): Take into account ADA_INCLUDE_PATH for better
Juanma Barranquero <lekktu@gmail.com>
parents:
49598
diff
changeset
|
702 '("Ada" |
b0ce71ab9c28
(ada-search-directories): Take into account ADA_INCLUDE_PATH for better
Juanma Barranquero <lekktu@gmail.com>
parents:
49598
diff
changeset
|
703 ["Goto Declaration/Body" ada-point-and-xref |
b0ce71ab9c28
(ada-search-directories): Take into account ADA_INCLUDE_PATH for better
Juanma Barranquero <lekktu@gmail.com>
parents:
49598
diff
changeset
|
704 :included ada-contextual-menu-on-identifier] |
b0ce71ab9c28
(ada-search-directories): Take into account ADA_INCLUDE_PATH for better
Juanma Barranquero <lekktu@gmail.com>
parents:
49598
diff
changeset
|
705 ["Goto Body" ada-point-and-xref-body |
b0ce71ab9c28
(ada-search-directories): Take into account ADA_INCLUDE_PATH for better
Juanma Barranquero <lekktu@gmail.com>
parents:
49598
diff
changeset
|
706 :included ada-contextual-menu-on-identifier] |
b0ce71ab9c28
(ada-search-directories): Take into account ADA_INCLUDE_PATH for better
Juanma Barranquero <lekktu@gmail.com>
parents:
49598
diff
changeset
|
707 ["Goto Previous Reference" ada-xref-goto-previous-reference] |
b0ce71ab9c28
(ada-search-directories): Take into account ADA_INCLUDE_PATH for better
Juanma Barranquero <lekktu@gmail.com>
parents:
49598
diff
changeset
|
708 ["List References" ada-find-references |
b0ce71ab9c28
(ada-search-directories): Take into account ADA_INCLUDE_PATH for better
Juanma Barranquero <lekktu@gmail.com>
parents:
49598
diff
changeset
|
709 :included ada-contextual-menu-on-identifier] |
b0ce71ab9c28
(ada-search-directories): Take into account ADA_INCLUDE_PATH for better
Juanma Barranquero <lekktu@gmail.com>
parents:
49598
diff
changeset
|
710 ["List Local References" ada-find-local-references |
b0ce71ab9c28
(ada-search-directories): Take into account ADA_INCLUDE_PATH for better
Juanma Barranquero <lekktu@gmail.com>
parents:
49598
diff
changeset
|
711 :included ada-contextual-menu-on-identifier] |
b0ce71ab9c28
(ada-search-directories): Take into account ADA_INCLUDE_PATH for better
Juanma Barranquero <lekktu@gmail.com>
parents:
49598
diff
changeset
|
712 ["-" nil nil] |
b0ce71ab9c28
(ada-search-directories): Take into account ADA_INCLUDE_PATH for better
Juanma Barranquero <lekktu@gmail.com>
parents:
49598
diff
changeset
|
713 ["Other File" ff-find-other-file] |
b0ce71ab9c28
(ada-search-directories): Take into account ADA_INCLUDE_PATH for better
Juanma Barranquero <lekktu@gmail.com>
parents:
49598
diff
changeset
|
714 ["Goto Parent Unit" ada-goto-parent])) |
26225
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
715 |
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
716 |
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
717 ;;------------------------------------------------------------------ |
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
718 ;; Support for imenu (see imenu.el) |
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
719 ;;------------------------------------------------------------------ |
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
720 |
44465
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
721 (defconst ada-imenu-comment-re "\\([ \t]*--.*\\)?") |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
722 |
30411
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
723 (defconst ada-imenu-subprogram-menu-re |
106830
4ff0e607507d
* progmodes/ada-mode.el: Deal with Ada 2005 "overriding" keyword.
Juanma Barranquero <lekktu@gmail.com>
parents:
106829
diff
changeset
|
724 (concat "^[ \t]*\\(overriding[ \t]*\\)?\\(procedure\\|function\\)[ \t\n]+" |
44465
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
725 "\\(\\(\\sw\\|_\\)+\\)[ \t\n]*\\([ \t\n]\\|([^)]+)" |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
726 ada-imenu-comment-re |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
727 "\\)[ \t\n]*" |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
728 "\\(return[ \t\n]+\\(\\sw\\|[_.]\\)+[ \t\n]*\\)?is[ \t\n]")) |
30411
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
729 |
26225
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
730 (defvar ada-imenu-generic-expression |
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
731 (list |
106830
4ff0e607507d
* progmodes/ada-mode.el: Deal with Ada 2005 "overriding" keyword.
Juanma Barranquero <lekktu@gmail.com>
parents:
106829
diff
changeset
|
732 (list nil ada-imenu-subprogram-menu-re 3) |
26225
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
733 (list "*Specs*" |
73531
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
734 (concat |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
735 "^[ \t]*\\(procedure\\|function\\)[ \t\n]+\\(\\(\\sw\\|_\\)+\\)" |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
736 "\\(" |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
737 "\\(" ada-imenu-comment-re "[ \t\n]+\\|[ \t\n]*([^)]+)" |
44465
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
738 ada-imenu-comment-re "\\)";; parameter list or simple space |
73531
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
739 "\\([ \t\n]*return[ \t\n]+\\(\\sw\\|[_.]\\)+[ \t\n]*\\)?" |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
740 "\\)?;") 2) |
44465
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
741 '("*Tasks*" "^[ \t]*task[ \t]+\\(type[ \t]+\\)?\\(\\(body[ \t]+\\)?\\(\\sw\\|_\\)+\\)" 2) |
26225
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
742 '("*Type Defs*" "^[ \t]*\\(sub\\)?type[ \t]+\\(\\(\\sw\\|_\\)+\\)" 2) |
44465
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
743 '("*Protected*" |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
744 "^[ \t]*protected[ \t]+\\(type[ \t]+\\)?\\(\\(body[ \t]+\\)?\\(\\sw\\|_\\)+\\)" 2) |
26225
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
745 '("*Packages*" "^[ \t]*package[ \t]+\\(\\(body[ \t]+\\)?\\(\\sw\\|[_.]\\)+\\)" 1)) |
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
746 "Imenu generic expression for Ada mode. |
63528
d6d50a511d12
(ada-format-paramlist)
Juanma Barranquero <lekktu@gmail.com>
parents:
63425
diff
changeset
|
747 See `imenu-generic-expression'. This variable will create several submenus for |
44465
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
748 each type of entity that can be found in an Ada file.") |
30411
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
749 |
26225
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
750 |
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
751 ;;------------------------------------------------------------ |
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
752 ;; Support for compile.el |
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
753 ;;------------------------------------------------------------ |
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
754 |
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
755 (defun ada-compile-mouse-goto-error () |
71537
2a4ed80e93ba
(ada-which-compiler, ada-mode-menu, ada-compile-mouse-goto-error,
Juanma Barranquero <lekktu@gmail.com>
parents:
68764
diff
changeset
|
756 "Mouse interface for `ada-compile-goto-error'." |
26225
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
757 (interactive) |
25903
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
758 (mouse-set-point last-input-event) |
26225
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
759 (ada-compile-goto-error (point)) |
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
760 ) |
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
761 |
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
762 (defun ada-compile-goto-error (pos) |
63528
d6d50a511d12
(ada-format-paramlist)
Juanma Barranquero <lekktu@gmail.com>
parents:
63425
diff
changeset
|
763 "Replace `compile-goto-error' from compile.el. |
d6d50a511d12
(ada-format-paramlist)
Juanma Barranquero <lekktu@gmail.com>
parents:
63425
diff
changeset
|
764 If POS is on a file and line location, go to this position. It adds |
d6d50a511d12
(ada-format-paramlist)
Juanma Barranquero <lekktu@gmail.com>
parents:
63425
diff
changeset
|
765 to compile.el the capacity to go to a reference in an error message. |
73531
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
766 For instance, on these lines: |
26225
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
767 foo.adb:61:11: [...] in call to size declared at foo.ads:11 |
73531
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
768 foo.adb:61:11: [...] in call to local declared at line 20 |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
769 the 4 file locations can be clicked on and jumped to." |
26225
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
770 (interactive "d") |
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
771 (goto-char pos) |
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
772 |
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
773 (skip-chars-backward "-a-zA-Z0-9_:./\\") |
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
774 (cond |
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
775 ;; special case: looking at a filename:line not at the beginning of a line |
73932
242a56e8b2c0
Replace conditional (require 'ispell) with defvar.
Juanma Barranquero <lekktu@gmail.com>
parents:
73922
diff
changeset
|
776 ;; or a simple line reference "at line ..." |
26225
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
777 ((and (not (bolp)) |
73932
242a56e8b2c0
Replace conditional (require 'ispell) with defvar.
Juanma Barranquero <lekktu@gmail.com>
parents:
73922
diff
changeset
|
778 (or (looking-at ada-compile-goto-error-file-linenr-re) |
242a56e8b2c0
Replace conditional (require 'ispell) with defvar.
Juanma Barranquero <lekktu@gmail.com>
parents:
73922
diff
changeset
|
779 (and |
242a56e8b2c0
Replace conditional (require 'ispell) with defvar.
Juanma Barranquero <lekktu@gmail.com>
parents:
73922
diff
changeset
|
780 (save-excursion |
242a56e8b2c0
Replace conditional (require 'ispell) with defvar.
Juanma Barranquero <lekktu@gmail.com>
parents:
73922
diff
changeset
|
781 (beginning-of-line) |
242a56e8b2c0
Replace conditional (require 'ispell) with defvar.
Juanma Barranquero <lekktu@gmail.com>
parents:
73922
diff
changeset
|
782 (looking-at ada-compile-goto-error-file-linenr-re)) |
242a56e8b2c0
Replace conditional (require 'ispell) with defvar.
Juanma Barranquero <lekktu@gmail.com>
parents:
73922
diff
changeset
|
783 (save-excursion |
242a56e8b2c0
Replace conditional (require 'ispell) with defvar.
Juanma Barranquero <lekktu@gmail.com>
parents:
73922
diff
changeset
|
784 (if (looking-at "\\([0-9]+\\)") (backward-word 1)) |
242a56e8b2c0
Replace conditional (require 'ispell) with defvar.
Juanma Barranquero <lekktu@gmail.com>
parents:
73922
diff
changeset
|
785 (looking-at "line \\([0-9]+\\)")))) |
242a56e8b2c0
Replace conditional (require 'ispell) with defvar.
Juanma Barranquero <lekktu@gmail.com>
parents:
73922
diff
changeset
|
786 ) |
242a56e8b2c0
Replace conditional (require 'ispell) with defvar.
Juanma Barranquero <lekktu@gmail.com>
parents:
73922
diff
changeset
|
787 (let ((line (if (match-beginning 2) (match-string 2) (match-string 1))) |
242a56e8b2c0
Replace conditional (require 'ispell) with defvar.
Juanma Barranquero <lekktu@gmail.com>
parents:
73922
diff
changeset
|
788 (file (if (match-beginning 2) (match-string 1) |
242a56e8b2c0
Replace conditional (require 'ispell) with defvar.
Juanma Barranquero <lekktu@gmail.com>
parents:
73922
diff
changeset
|
789 (save-excursion (beginning-of-line) |
242a56e8b2c0
Replace conditional (require 'ispell) with defvar.
Juanma Barranquero <lekktu@gmail.com>
parents:
73922
diff
changeset
|
790 (looking-at ada-compile-goto-error-file-linenr-re) |
242a56e8b2c0
Replace conditional (require 'ispell) with defvar.
Juanma Barranquero <lekktu@gmail.com>
parents:
73922
diff
changeset
|
791 (match-string 1)))) |
73531
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
792 (error-pos (point-marker)) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
793 source) |
74202
abb4062752c5
(ada-which-compiler): Fix typo in docstring.
Juanma Barranquero <lekktu@gmail.com>
parents:
74073
diff
changeset
|
794 |
abb4062752c5
(ada-which-compiler): Fix typo in docstring.
Juanma Barranquero <lekktu@gmail.com>
parents:
74073
diff
changeset
|
795 ;; set source marker |
26225
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
796 (save-excursion |
97058
b6ac850e9d2b
Fix bug #272, and update Ada mode to version 4.0.
Juanma Barranquero <lekktu@gmail.com>
parents:
95268
diff
changeset
|
797 (compilation-find-file (point-marker) (match-string 1) "./") |
b6ac850e9d2b
Fix bug #272, and update Ada mode to version 4.0.
Juanma Barranquero <lekktu@gmail.com>
parents:
95268
diff
changeset
|
798 (set-buffer file) |
b6ac850e9d2b
Fix bug #272, and update Ada mode to version 4.0.
Juanma Barranquero <lekktu@gmail.com>
parents:
95268
diff
changeset
|
799 |
104543
da8b3e61b182
Use forward-line rather than goto-line.
Glenn Morris <rgm@gnu.org>
parents:
103989
diff
changeset
|
800 (when (stringp line) |
da8b3e61b182
Use forward-line rather than goto-line.
Glenn Morris <rgm@gnu.org>
parents:
103989
diff
changeset
|
801 (goto-char (point-min)) |
da8b3e61b182
Use forward-line rather than goto-line.
Glenn Morris <rgm@gnu.org>
parents:
103989
diff
changeset
|
802 (forward-line (1- (string-to-number line)))) |
97058
b6ac850e9d2b
Fix bug #272, and update Ada mode to version 4.0.
Juanma Barranquero <lekktu@gmail.com>
parents:
95268
diff
changeset
|
803 |
b6ac850e9d2b
Fix bug #272, and update Ada mode to version 4.0.
Juanma Barranquero <lekktu@gmail.com>
parents:
95268
diff
changeset
|
804 (setq source (point-marker))) |
74202
abb4062752c5
(ada-which-compiler): Fix typo in docstring.
Juanma Barranquero <lekktu@gmail.com>
parents:
74073
diff
changeset
|
805 |
abb4062752c5
(ada-which-compiler): Fix typo in docstring.
Juanma Barranquero <lekktu@gmail.com>
parents:
74073
diff
changeset
|
806 (compilation-goto-locus error-pos source nil) |
abb4062752c5
(ada-which-compiler): Fix typo in docstring.
Juanma Barranquero <lekktu@gmail.com>
parents:
74073
diff
changeset
|
807 |
26225
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
808 )) |
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
809 |
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
810 ;; otherwise, default behavior |
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
811 (t |
74202
abb4062752c5
(ada-which-compiler): Fix typo in docstring.
Juanma Barranquero <lekktu@gmail.com>
parents:
74073
diff
changeset
|
812 (compile-goto-error)) |
26225
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
813 ) |
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
814 (recenter)) |
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
815 |
30411
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
816 |
26225
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
817 ;;------------------------------------------------------------------------- |
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
818 ;; Grammar related function |
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
819 ;; The functions below work with the syntax class of the characters in an Ada |
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
820 ;; buffer. Two syntax tables are created, depending on whether we want '_' |
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
821 ;; to be considered as part of a word or not. |
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
822 ;; Some characters may have multiple meanings depending on the context: |
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
823 ;; - ' is either the beginning of a constant character or an attribute |
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
824 ;; - # is either part of a based litteral or a gnatprep statement. |
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
825 ;; - " starts a string, but not if inside a constant character. |
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
826 ;; - ( and ) should be ignored if inside a constant character. |
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
827 ;; Thus their syntax property is changed automatically, and we can still use |
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
828 ;; the standard Emacs functions for sexp (see `ada-in-string-p') |
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
829 ;; |
78589
56d6a084bbb6
(ada-create-syntax-table): Move
Martin Rudalics <rudalics@gmx.at>
parents:
78234
diff
changeset
|
830 ;; On Emacs, this is done through the `syntax-table' text property. The |
56d6a084bbb6
(ada-create-syntax-table): Move
Martin Rudalics <rudalics@gmx.at>
parents:
78234
diff
changeset
|
831 ;; corresponding action is applied automatically each time the buffer |
56d6a084bbb6
(ada-create-syntax-table): Move
Martin Rudalics <rudalics@gmx.at>
parents:
78234
diff
changeset
|
832 ;; changes. If `font-lock-mode' is enabled (the default) the action is |
56d6a084bbb6
(ada-create-syntax-table): Move
Martin Rudalics <rudalics@gmx.at>
parents:
78234
diff
changeset
|
833 ;; set up by `font-lock-syntactic-keywords'. Otherwise, we do it |
56d6a084bbb6
(ada-create-syntax-table): Move
Martin Rudalics <rudalics@gmx.at>
parents:
78234
diff
changeset
|
834 ;; manually in `ada-after-change-function'. The proper method is |
56d6a084bbb6
(ada-create-syntax-table): Move
Martin Rudalics <rudalics@gmx.at>
parents:
78234
diff
changeset
|
835 ;; installed by `ada-handle-syntax-table-properties'. |
26225
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
836 ;; |
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
837 ;; on XEmacs, the `syntax-table' property does not exist and we have to use a |
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
838 ;; slow advice to `parse-partial-sexp' to do the same thing. |
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
839 ;; When executing parse-partial-sexp, we simply modify the strings before and |
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
840 ;; after, so that the special constants '"', '(' and ')' do not interact |
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
841 ;; with parse-partial-sexp. |
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
842 ;; Note: this code is slow and needs to be rewritten as soon as something |
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
843 ;; better is available on XEmacs. |
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
844 ;;------------------------------------------------------------------------- |
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
845 |
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
846 (defun ada-create-syntax-table () |
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
847 "Create the two syntax tables use in the Ada mode. |
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
848 The standard table declares `_' as a symbol constituent, the second one |
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
849 declares it as a word constituent." |
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
850 (interactive) |
33716
c55ff055c68a
(ada-mode): `set '' -> `setq'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
32300
diff
changeset
|
851 (setq ada-mode-syntax-table (make-syntax-table)) |
26225
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
852 |
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
853 ;; define string brackets (`%' is alternative string bracket, but |
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
854 ;; almost never used as such and throws font-lock and indentation |
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
855 ;; off the track.) |
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
856 (modify-syntax-entry ?% "$" ada-mode-syntax-table) |
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
857 (modify-syntax-entry ?\" "\"" ada-mode-syntax-table) |
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
858 |
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
859 (modify-syntax-entry ?: "." ada-mode-syntax-table) |
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
860 (modify-syntax-entry ?\; "." ada-mode-syntax-table) |
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
861 (modify-syntax-entry ?& "." ada-mode-syntax-table) |
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
862 (modify-syntax-entry ?\| "." ada-mode-syntax-table) |
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
863 (modify-syntax-entry ?+ "." ada-mode-syntax-table) |
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
864 (modify-syntax-entry ?* "." ada-mode-syntax-table) |
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
865 (modify-syntax-entry ?/ "." ada-mode-syntax-table) |
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
866 (modify-syntax-entry ?= "." ada-mode-syntax-table) |
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
867 (modify-syntax-entry ?< "." ada-mode-syntax-table) |
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
868 (modify-syntax-entry ?> "." ada-mode-syntax-table) |
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
869 (modify-syntax-entry ?$ "." ada-mode-syntax-table) |
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
870 (modify-syntax-entry ?\[ "." ada-mode-syntax-table) |
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
871 (modify-syntax-entry ?\] "." ada-mode-syntax-table) |
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
872 (modify-syntax-entry ?\{ "." ada-mode-syntax-table) |
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
873 (modify-syntax-entry ?\} "." ada-mode-syntax-table) |
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
874 (modify-syntax-entry ?. "." ada-mode-syntax-table) |
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
875 (modify-syntax-entry ?\\ "." ada-mode-syntax-table) |
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
876 (modify-syntax-entry ?\' "." ada-mode-syntax-table) |
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
877 |
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
878 ;; a single hyphen is punctuation, but a double hyphen starts a comment |
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
879 (modify-syntax-entry ?- ". 12" ada-mode-syntax-table) |
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
880 |
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
881 ;; See the comment above on grammar related function for the special |
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
882 ;; setup for '#'. |
50812
15929fed5553
(ada-xemacs): Variable removed, since it's better to use (featurep 'xemacs).
Juanma Barranquero <lekktu@gmail.com>
parents:
50736
diff
changeset
|
883 (if (featurep 'xemacs) |
26225
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
884 (modify-syntax-entry ?# "<" ada-mode-syntax-table) |
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
885 (modify-syntax-entry ?# "$" ada-mode-syntax-table)) |
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
886 |
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
887 ;; and \f and \n end a comment |
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
888 (modify-syntax-entry ?\f "> " ada-mode-syntax-table) |
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
889 (modify-syntax-entry ?\n "> " ada-mode-syntax-table) |
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
890 |
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
891 ;; define what belongs in Ada symbols |
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
892 (modify-syntax-entry ?_ "_" ada-mode-syntax-table) |
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
893 |
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
894 ;; define parentheses to match |
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
895 (modify-syntax-entry ?\( "()" ada-mode-syntax-table) |
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
896 (modify-syntax-entry ?\) ")(" ada-mode-syntax-table) |
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
897 |
33716
c55ff055c68a
(ada-mode): `set '' -> `setq'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
32300
diff
changeset
|
898 (setq ada-mode-symbol-syntax-table (copy-syntax-table ada-mode-syntax-table)) |
26225
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
899 (modify-syntax-entry ?_ "w" ada-mode-symbol-syntax-table) |
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
900 ) |
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
901 |
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
902 ;; Support of special characters in XEmacs (see the comments at the beginning |
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
903 ;; of the section on Grammar related functions). |
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
904 |
50812
15929fed5553
(ada-xemacs): Variable removed, since it's better to use (featurep 'xemacs).
Juanma Barranquero <lekktu@gmail.com>
parents:
50736
diff
changeset
|
905 (if (featurep 'xemacs) |
26225
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
906 (defadvice parse-partial-sexp (around parse-partial-sexp-protect-constants) |
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
907 "Handles special character constants and gnatprep statements." |
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
908 (let (change) |
73531
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
909 (if (< to from) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
910 (let ((tmp from)) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
911 (setq from to to tmp))) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
912 (save-excursion |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
913 (goto-char from) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
914 (while (re-search-forward "'\\([(\")#]\\)'" to t) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
915 (setq change (cons (list (match-beginning 1) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
916 1 |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
917 (match-string 1)) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
918 change)) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
919 (replace-match "'A'")) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
920 (goto-char from) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
921 (while (re-search-forward "\\(#[0-9a-fA-F]*#\\)" to t) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
922 (setq change (cons (list (match-beginning 1) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
923 (length (match-string 1)) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
924 (match-string 1)) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
925 change)) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
926 (replace-match (make-string (length (match-string 1)) ?@)))) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
927 ad-do-it |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
928 (save-excursion |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
929 (while change |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
930 (goto-char (caar change)) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
931 (delete-char (cadar change)) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
932 (insert (caddar change)) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
933 (setq change (cdr change))))))) |
26225
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
934 |
78589
56d6a084bbb6
(ada-create-syntax-table): Move
Martin Rudalics <rudalics@gmx.at>
parents:
78234
diff
changeset
|
935 (defun ada-set-syntax-table-properties () |
56d6a084bbb6
(ada-create-syntax-table): Move
Martin Rudalics <rudalics@gmx.at>
parents:
78234
diff
changeset
|
936 "Assign `syntax-table' properties in accessible part of buffer. |
56d6a084bbb6
(ada-create-syntax-table): Move
Martin Rudalics <rudalics@gmx.at>
parents:
78234
diff
changeset
|
937 In particular, character constants are said to be strings, #...# |
56d6a084bbb6
(ada-create-syntax-table): Move
Martin Rudalics <rudalics@gmx.at>
parents:
78234
diff
changeset
|
938 are treated as numbers instead of gnatprep comments." |
56d6a084bbb6
(ada-create-syntax-table): Move
Martin Rudalics <rudalics@gmx.at>
parents:
78234
diff
changeset
|
939 (let ((modified (buffer-modified-p)) |
56d6a084bbb6
(ada-create-syntax-table): Move
Martin Rudalics <rudalics@gmx.at>
parents:
78234
diff
changeset
|
940 (buffer-undo-list t) |
56d6a084bbb6
(ada-create-syntax-table): Move
Martin Rudalics <rudalics@gmx.at>
parents:
78234
diff
changeset
|
941 (inhibit-read-only t) |
56d6a084bbb6
(ada-create-syntax-table): Move
Martin Rudalics <rudalics@gmx.at>
parents:
78234
diff
changeset
|
942 (inhibit-point-motion-hooks t) |
97058
b6ac850e9d2b
Fix bug #272, and update Ada mode to version 4.0.
Juanma Barranquero <lekktu@gmail.com>
parents:
95268
diff
changeset
|
943 (inhibit-modification-hooks t)) |
78589
56d6a084bbb6
(ada-create-syntax-table): Move
Martin Rudalics <rudalics@gmx.at>
parents:
78234
diff
changeset
|
944 (remove-text-properties (point-min) (point-max) '(syntax-table nil)) |
56d6a084bbb6
(ada-create-syntax-table): Move
Martin Rudalics <rudalics@gmx.at>
parents:
78234
diff
changeset
|
945 (goto-char (point-min)) |
56d6a084bbb6
(ada-create-syntax-table): Move
Martin Rudalics <rudalics@gmx.at>
parents:
78234
diff
changeset
|
946 (while (re-search-forward |
56d6a084bbb6
(ada-create-syntax-table): Move
Martin Rudalics <rudalics@gmx.at>
parents:
78234
diff
changeset
|
947 ;; The following regexp was adapted from |
56d6a084bbb6
(ada-create-syntax-table): Move
Martin Rudalics <rudalics@gmx.at>
parents:
78234
diff
changeset
|
948 ;; `ada-font-lock-syntactic-keywords'. |
56d6a084bbb6
(ada-create-syntax-table): Move
Martin Rudalics <rudalics@gmx.at>
parents:
78234
diff
changeset
|
949 "^[ \t]*\\(#\\(?:if\\|else\\|elsif\\|end\\)\\)\\|[^a-zA-Z0-9)]\\('\\)[^'\n]\\('\\)" |
56d6a084bbb6
(ada-create-syntax-table): Move
Martin Rudalics <rudalics@gmx.at>
parents:
78234
diff
changeset
|
950 nil t) |
56d6a084bbb6
(ada-create-syntax-table): Move
Martin Rudalics <rudalics@gmx.at>
parents:
78234
diff
changeset
|
951 (if (match-beginning 1) |
56d6a084bbb6
(ada-create-syntax-table): Move
Martin Rudalics <rudalics@gmx.at>
parents:
78234
diff
changeset
|
952 (put-text-property |
56d6a084bbb6
(ada-create-syntax-table): Move
Martin Rudalics <rudalics@gmx.at>
parents:
78234
diff
changeset
|
953 (match-beginning 1) (match-end 1) 'syntax-table '(11 . ?\n)) |
56d6a084bbb6
(ada-create-syntax-table): Move
Martin Rudalics <rudalics@gmx.at>
parents:
78234
diff
changeset
|
954 (put-text-property |
56d6a084bbb6
(ada-create-syntax-table): Move
Martin Rudalics <rudalics@gmx.at>
parents:
78234
diff
changeset
|
955 (match-beginning 2) (match-end 2) 'syntax-table '(7 . ?')) |
56d6a084bbb6
(ada-create-syntax-table): Move
Martin Rudalics <rudalics@gmx.at>
parents:
78234
diff
changeset
|
956 (put-text-property |
56d6a084bbb6
(ada-create-syntax-table): Move
Martin Rudalics <rudalics@gmx.at>
parents:
78234
diff
changeset
|
957 (match-beginning 3) (match-end 3) 'syntax-table '(7 . ?')))) |
56d6a084bbb6
(ada-create-syntax-table): Move
Martin Rudalics <rudalics@gmx.at>
parents:
78234
diff
changeset
|
958 (unless modified |
56d6a084bbb6
(ada-create-syntax-table): Move
Martin Rudalics <rudalics@gmx.at>
parents:
78234
diff
changeset
|
959 (restore-buffer-modified-p nil)))) |
26225
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
960 |
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
961 (defun ada-after-change-function (beg end old-len) |
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
962 "Called when the region between BEG and END was changed in the buffer. |
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
963 OLD-LEN indicates what the length of the replaced text was." |
78589
56d6a084bbb6
(ada-create-syntax-table): Move
Martin Rudalics <rudalics@gmx.at>
parents:
78234
diff
changeset
|
964 (save-excursion |
56d6a084bbb6
(ada-create-syntax-table): Move
Martin Rudalics <rudalics@gmx.at>
parents:
78234
diff
changeset
|
965 (save-restriction |
56d6a084bbb6
(ada-create-syntax-table): Move
Martin Rudalics <rudalics@gmx.at>
parents:
78234
diff
changeset
|
966 (let ((from (progn (goto-char beg) (line-beginning-position))) |
56d6a084bbb6
(ada-create-syntax-table): Move
Martin Rudalics <rudalics@gmx.at>
parents:
78234
diff
changeset
|
967 (to (progn (goto-char end) (line-end-position)))) |
56d6a084bbb6
(ada-create-syntax-table): Move
Martin Rudalics <rudalics@gmx.at>
parents:
78234
diff
changeset
|
968 (narrow-to-region from to) |
56d6a084bbb6
(ada-create-syntax-table): Move
Martin Rudalics <rudalics@gmx.at>
parents:
78234
diff
changeset
|
969 (save-match-data |
56d6a084bbb6
(ada-create-syntax-table): Move
Martin Rudalics <rudalics@gmx.at>
parents:
78234
diff
changeset
|
970 (ada-set-syntax-table-properties)))))) |
56d6a084bbb6
(ada-create-syntax-table): Move
Martin Rudalics <rudalics@gmx.at>
parents:
78234
diff
changeset
|
971 |
56d6a084bbb6
(ada-create-syntax-table): Move
Martin Rudalics <rudalics@gmx.at>
parents:
78234
diff
changeset
|
972 (defun ada-initialize-syntax-table-properties () |
56d6a084bbb6
(ada-create-syntax-table): Move
Martin Rudalics <rudalics@gmx.at>
parents:
78234
diff
changeset
|
973 "Assign `syntax-table' properties in current buffer." |
26225
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
974 (save-excursion |
78589
56d6a084bbb6
(ada-create-syntax-table): Move
Martin Rudalics <rudalics@gmx.at>
parents:
78234
diff
changeset
|
975 (save-restriction |
56d6a084bbb6
(ada-create-syntax-table): Move
Martin Rudalics <rudalics@gmx.at>
parents:
78234
diff
changeset
|
976 (widen) |
56d6a084bbb6
(ada-create-syntax-table): Move
Martin Rudalics <rudalics@gmx.at>
parents:
78234
diff
changeset
|
977 (save-match-data |
56d6a084bbb6
(ada-create-syntax-table): Move
Martin Rudalics <rudalics@gmx.at>
parents:
78234
diff
changeset
|
978 (ada-set-syntax-table-properties)))) |
56d6a084bbb6
(ada-create-syntax-table): Move
Martin Rudalics <rudalics@gmx.at>
parents:
78234
diff
changeset
|
979 (add-hook 'after-change-functions 'ada-after-change-function nil t)) |
56d6a084bbb6
(ada-create-syntax-table): Move
Martin Rudalics <rudalics@gmx.at>
parents:
78234
diff
changeset
|
980 |
56d6a084bbb6
(ada-create-syntax-table): Move
Martin Rudalics <rudalics@gmx.at>
parents:
78234
diff
changeset
|
981 (defun ada-handle-syntax-table-properties () |
56d6a084bbb6
(ada-create-syntax-table): Move
Martin Rudalics <rudalics@gmx.at>
parents:
78234
diff
changeset
|
982 "Handle `syntax-table' properties." |
56d6a084bbb6
(ada-create-syntax-table): Move
Martin Rudalics <rudalics@gmx.at>
parents:
78234
diff
changeset
|
983 (if font-lock-mode |
56d6a084bbb6
(ada-create-syntax-table): Move
Martin Rudalics <rudalics@gmx.at>
parents:
78234
diff
changeset
|
984 ;; `font-lock-mode' will take care of `syntax-table' properties. |
56d6a084bbb6
(ada-create-syntax-table): Move
Martin Rudalics <rudalics@gmx.at>
parents:
78234
diff
changeset
|
985 (remove-hook 'after-change-functions 'ada-after-change-function t) |
56d6a084bbb6
(ada-create-syntax-table): Move
Martin Rudalics <rudalics@gmx.at>
parents:
78234
diff
changeset
|
986 ;; Take care of `syntax-table' properties manually. |
56d6a084bbb6
(ada-create-syntax-table): Move
Martin Rudalics <rudalics@gmx.at>
parents:
78234
diff
changeset
|
987 (ada-initialize-syntax-table-properties))) |
26225
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
988 |
30411
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
989 ;;------------------------------------------------------------------ |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
990 ;; Testing the grammatical context |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
991 ;;------------------------------------------------------------------ |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
992 |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
993 (defsubst ada-in-comment-p (&optional parse-result) |
73531
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
994 "Return t if inside a comment. |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
995 If PARSE-RESULT is non-nil, use it instead of calling `parse-partial-sexp'." |
30411
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
996 (nth 4 (or parse-result |
73531
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
997 (parse-partial-sexp |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
998 (line-beginning-position) (point))))) |
30411
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
999 |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
1000 (defsubst ada-in-string-p (&optional parse-result) |
63528
d6d50a511d12
(ada-format-paramlist)
Juanma Barranquero <lekktu@gmail.com>
parents:
63425
diff
changeset
|
1001 "Return t if point is inside a string. |
73434
3586ad4a01a1
(ada-in-string-p): Doc fix.
Juanma Barranquero <lekktu@gmail.com>
parents:
73422
diff
changeset
|
1002 If PARSE-RESULT is non-nil, use it instead of calling `parse-partial-sexp'." |
30411
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
1003 (nth 3 (or parse-result |
73531
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
1004 (parse-partial-sexp |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
1005 (line-beginning-position) (point))))) |
30411
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
1006 |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
1007 (defsubst ada-in-string-or-comment-p (&optional parse-result) |
73531
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
1008 "Return t if inside a comment or string. |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
1009 If PARSE-RESULT is non-nil, use it instead of calling `parse-partial-sexp'." |
33716
c55ff055c68a
(ada-mode): `set '' -> `setq'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
32300
diff
changeset
|
1010 (setq parse-result (or parse-result |
73531
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
1011 (parse-partial-sexp |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
1012 (line-beginning-position) (point)))) |
30411
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
1013 (or (ada-in-string-p parse-result) (ada-in-comment-p parse-result))) |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
1014 |
26225
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
1015 |
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
1016 ;;------------------------------------------------------------------ |
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
1017 ;; Contextual menus |
71537
2a4ed80e93ba
(ada-which-compiler, ada-mode-menu, ada-compile-mouse-goto-error,
Juanma Barranquero <lekktu@gmail.com>
parents:
68764
diff
changeset
|
1018 ;; The Ada mode comes with contextual menus, bound by default to the right |
30411
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
1019 ;; mouse button. |
26225
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
1020 ;; Add items to this menu by modifying `ada-contextual-menu'. Note that the |
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
1021 ;; variable `ada-contextual-menu-on-identifier' is set automatically to t |
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
1022 ;; if the mouse button was pressed on an identifier. |
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
1023 ;;------------------------------------------------------------------ |
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
1024 |
30411
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
1025 (defun ada-call-from-contextual-menu (function) |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
1026 "Execute FUNCTION when called from the contextual menu. |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
1027 It forces Emacs to change the cursor position." |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
1028 (interactive) |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
1029 (funcall function) |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
1030 (setq ada-contextual-menu-last-point |
73531
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
1031 (list (point) (current-buffer)))) |
30411
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
1032 |
26225
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
1033 (defun ada-popup-menu (position) |
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
1034 "Pops up a contextual menu, depending on where the user clicked. |
30411
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
1035 POSITION is the location the mouse was clicked on. |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
1036 Sets `ada-contextual-menu-last-point' to the current position before |
63528
d6d50a511d12
(ada-format-paramlist)
Juanma Barranquero <lekktu@gmail.com>
parents:
63425
diff
changeset
|
1037 displaying the menu. When a function from the menu is called, the |
d6d50a511d12
(ada-format-paramlist)
Juanma Barranquero <lekktu@gmail.com>
parents:
63425
diff
changeset
|
1038 point is where the mouse button was clicked." |
26225
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
1039 (interactive "e") |
30411
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
1040 |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
1041 ;; declare this as a local variable, so that the function called |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
1042 ;; in the contextual menu does not hide the region in |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
1043 ;; transient-mark-mode. |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
1044 (let ((deactivate-mark nil)) |
33716
c55ff055c68a
(ada-mode): `set '' -> `setq'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
32300
diff
changeset
|
1045 (setq ada-contextual-menu-last-point |
73531
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
1046 (list (point) (current-buffer))) |
26225
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
1047 (mouse-set-point last-input-event) |
30411
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
1048 |
26225
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
1049 (setq ada-contextual-menu-on-identifier |
73531
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
1050 (and (char-after) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
1051 (or (= (char-syntax (char-after)) ?w) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
1052 (= (char-after) ?_)) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
1053 (not (ada-in-string-or-comment-p)) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
1054 (save-excursion (skip-syntax-forward "w") |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
1055 (not (ada-after-keyword-p))) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
1056 )) |
50736
b0ce71ab9c28
(ada-search-directories): Take into account ADA_INCLUDE_PATH for better
Juanma Barranquero <lekktu@gmail.com>
parents:
49598
diff
changeset
|
1057 (if (fboundp 'popup-menu) |
b0ce71ab9c28
(ada-search-directories): Take into account ADA_INCLUDE_PATH for better
Juanma Barranquero <lekktu@gmail.com>
parents:
49598
diff
changeset
|
1058 (funcall (symbol-function 'popup-menu) ada-contextual-menu) |
b0ce71ab9c28
(ada-search-directories): Take into account ADA_INCLUDE_PATH for better
Juanma Barranquero <lekktu@gmail.com>
parents:
49598
diff
changeset
|
1059 (let (choice) |
b0ce71ab9c28
(ada-search-directories): Take into account ADA_INCLUDE_PATH for better
Juanma Barranquero <lekktu@gmail.com>
parents:
49598
diff
changeset
|
1060 (setq choice (x-popup-menu position ada-contextual-menu)) |
73531
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
1061 (if choice |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
1062 (funcall (lookup-key ada-contextual-menu (vector (car choice))))))) |
50736
b0ce71ab9c28
(ada-search-directories): Take into account ADA_INCLUDE_PATH for better
Juanma Barranquero <lekktu@gmail.com>
parents:
49598
diff
changeset
|
1063 |
30411
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
1064 (set-buffer (cadr ada-contextual-menu-last-point)) |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
1065 (goto-char (car ada-contextual-menu-last-point)) |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
1066 )) |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
1067 |
26225
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
1068 |
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
1069 ;;------------------------------------------------------------------ |
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
1070 ;; Misc functions |
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
1071 ;;------------------------------------------------------------------ |
25903
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
1072 |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
1073 ;;;###autoload |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
1074 (defun ada-add-extensions (spec body) |
26225
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
1075 "Define SPEC and BODY as being valid extensions for Ada files. |
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
1076 Going from body to spec with `ff-find-other-file' used these |
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
1077 extensions. |
63528
d6d50a511d12
(ada-format-paramlist)
Juanma Barranquero <lekktu@gmail.com>
parents:
63425
diff
changeset
|
1078 SPEC and BODY are two regular expressions that must match against |
d6d50a511d12
(ada-format-paramlist)
Juanma Barranquero <lekktu@gmail.com>
parents:
63425
diff
changeset
|
1079 the file name." |
25903
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
1080 (let* ((reg (concat (regexp-quote body) "$")) |
73531
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
1081 (tmp (assoc reg ada-other-file-alist))) |
25903
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
1082 (if tmp |
73531
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
1083 (setcdr tmp (list (cons spec (cadr tmp)))) |
25903
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
1084 (add-to-list 'ada-other-file-alist (list reg (list spec))))) |
30411
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
1085 |
25903
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
1086 (let* ((reg (concat (regexp-quote spec) "$")) |
73531
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
1087 (tmp (assoc reg ada-other-file-alist))) |
25903
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
1088 (if tmp |
73531
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
1089 (setcdr tmp (list (cons body (cadr tmp)))) |
25903
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
1090 (add-to-list 'ada-other-file-alist (list reg (list body))))) |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
1091 |
41082
6204eb16d008
(ada-add-extensions): Quote regexp special
Andreas Schwab <schwab@suse.de>
parents:
41036
diff
changeset
|
1092 (add-to-list 'auto-mode-alist |
6204eb16d008
(ada-add-extensions): Quote regexp special
Andreas Schwab <schwab@suse.de>
parents:
41036
diff
changeset
|
1093 (cons (concat (regexp-quote spec) "\\'") 'ada-mode)) |
6204eb16d008
(ada-add-extensions): Quote regexp special
Andreas Schwab <schwab@suse.de>
parents:
41036
diff
changeset
|
1094 (add-to-list 'auto-mode-alist |
6204eb16d008
(ada-add-extensions): Quote regexp special
Andreas Schwab <schwab@suse.de>
parents:
41036
diff
changeset
|
1095 (cons (concat (regexp-quote body) "\\'") 'ada-mode)) |
25903
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
1096 |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
1097 (add-to-list 'ada-spec-suffixes spec) |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
1098 (add-to-list 'ada-body-suffixes body) |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
1099 |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
1100 ;; Support for speedbar (Specifies that we want to see these files in |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
1101 ;; speedbar) |
50736
b0ce71ab9c28
(ada-search-directories): Take into account ADA_INCLUDE_PATH for better
Juanma Barranquero <lekktu@gmail.com>
parents:
49598
diff
changeset
|
1102 (if (fboundp 'speedbar-add-supported-extension) |
25903
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
1103 (progn |
73531
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
1104 (funcall (symbol-function 'speedbar-add-supported-extension) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
1105 spec) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
1106 (funcall (symbol-function 'speedbar-add-supported-extension) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
1107 body))) |
25903
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
1108 ) |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
1109 |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
1110 |
10707 | 1111 ;;;###autoload |
10705 | 1112 (defun ada-mode () |
100891
e7407b3eef86
* progmodes/ada-mode.el (ada-mode): Simplify doc string.
Juanma Barranquero <lekktu@gmail.com>
parents:
98674
diff
changeset
|
1113 "Ada mode is the major mode for editing Ada code." |
10705 | 1114 |
1115 (interactive) | |
1116 (kill-all-local-variables) | |
84917
e52cb6ef60ec
(ada-save-exceptions-to-file): Use `mapc' rather than `mapcar'.
Juanma Barranquero <lekktu@gmail.com>
parents:
78601
diff
changeset
|
1117 |
78589
56d6a084bbb6
(ada-create-syntax-table): Move
Martin Rudalics <rudalics@gmx.at>
parents:
78234
diff
changeset
|
1118 (set-syntax-table ada-mode-syntax-table) |
10705 | 1119 |
59237
276072a4cd9d
(ada-mode): Use mode-require-final-newline.
Richard M. Stallman <rms@gnu.org>
parents:
55730
diff
changeset
|
1120 (set (make-local-variable 'require-final-newline) mode-require-final-newline) |
10705 | 1121 |
25903
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
1122 ;; Set the paragraph delimiters so that one can select a whole block |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
1123 ;; simply with M-h |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
1124 (set (make-local-variable 'paragraph-start) "[ \t\n\f]*$") |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
1125 (set (make-local-variable 'paragraph-separate) "[ \t\n\f]*$") |
10705 | 1126 |
1127 ;; comment end must be set because it may hold a wrong value if | |
1128 ;; this buffer had been in another mode before. RE | |
25903
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
1129 (set (make-local-variable 'comment-end) "") |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
1130 |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
1131 ;; used by autofill and indent-new-comment-line |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
1132 (set (make-local-variable 'comment-start-skip) "---*[ \t]*") |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
1133 |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
1134 ;; used by autofill to break a comment line and continue it on another line. |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
1135 ;; The reason we need this one is that the default behavior does not work |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
1136 ;; correctly with the definition of paragraph-start above when the comment |
26225
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
1137 ;; is right after a multi-line subprogram declaration (the comments are |
25903
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
1138 ;; aligned under the latest parameter, not under the declaration start). |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
1139 (set (make-local-variable 'comment-line-break-function) |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
1140 (lambda (&optional soft) (let ((fill-prefix nil)) |
73531
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
1141 (indent-new-comment-line soft)))) |
30411
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
1142 |
25903
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
1143 (set (make-local-variable 'indent-line-function) |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
1144 'ada-indent-current-function) |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
1145 |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
1146 (set (make-local-variable 'comment-column) 40) |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
1147 |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
1148 ;; Emacs 20.3 defines a comment-padding to insert spaces between |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
1149 ;; the comment and the text. We do not want any, this is already |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
1150 ;; included in comment-start |
50812
15929fed5553
(ada-xemacs): Variable removed, since it's better to use (featurep 'xemacs).
Juanma Barranquero <lekktu@gmail.com>
parents:
50736
diff
changeset
|
1151 (unless (featurep 'xemacs) |
78600
4f60c94dc647
Fix up comment style in header.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
78589
diff
changeset
|
1152 (set (make-local-variable 'parse-sexp-ignore-comments) t) |
4f60c94dc647
Fix up comment style in header.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
78589
diff
changeset
|
1153 (set (make-local-variable 'comment-padding) 0) |
4f60c94dc647
Fix up comment style in header.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
78589
diff
changeset
|
1154 (set (make-local-variable 'parse-sexp-lookup-properties) t)) |
44465
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
1155 |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
1156 (set 'case-fold-search t) |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
1157 (if (boundp 'imenu-case-fold-search) |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
1158 (set 'imenu-case-fold-search t)) |
25903
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
1159 |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
1160 (set (make-local-variable 'fill-paragraph-function) |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
1161 'ada-fill-comment-paragraph) |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
1162 |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
1163 ;; Support for compile.el |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
1164 ;; We just substitute our own functions to go to the error. |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
1165 (add-hook 'compilation-mode-hook |
73531
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
1166 (lambda() |
38446
f63fbebe03fb
(ada-mode): Avoid unneeded version checks.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
38422
diff
changeset
|
1167 ;; FIXME: This has global impact! -stef |
30411
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
1168 (define-key compilation-minor-mode-map [mouse-2] |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
1169 'ada-compile-mouse-goto-error) |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
1170 (define-key compilation-minor-mode-map "\C-c\C-c" |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
1171 'ada-compile-goto-error) |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
1172 (define-key compilation-minor-mode-map "\C-m" |
38446
f63fbebe03fb
(ada-mode): Avoid unneeded version checks.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
38422
diff
changeset
|
1173 'ada-compile-goto-error))) |
f63fbebe03fb
(ada-mode): Avoid unneeded version checks.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
38422
diff
changeset
|
1174 |
44465
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
1175 ;; font-lock support : |
97058
b6ac850e9d2b
Fix bug #272, and update Ada mode to version 4.0.
Juanma Barranquero <lekktu@gmail.com>
parents:
95268
diff
changeset
|
1176 |
b6ac850e9d2b
Fix bug #272, and update Ada mode to version 4.0.
Juanma Barranquero <lekktu@gmail.com>
parents:
95268
diff
changeset
|
1177 (set (make-local-variable 'font-lock-defaults) |
b6ac850e9d2b
Fix bug #272, and update Ada mode to version 4.0.
Juanma Barranquero <lekktu@gmail.com>
parents:
95268
diff
changeset
|
1178 '(ada-font-lock-keywords |
b6ac850e9d2b
Fix bug #272, and update Ada mode to version 4.0.
Juanma Barranquero <lekktu@gmail.com>
parents:
95268
diff
changeset
|
1179 nil t |
b6ac850e9d2b
Fix bug #272, and update Ada mode to version 4.0.
Juanma Barranquero <lekktu@gmail.com>
parents:
95268
diff
changeset
|
1180 ((?\_ . "w") (?# . ".")) |
b6ac850e9d2b
Fix bug #272, and update Ada mode to version 4.0.
Juanma Barranquero <lekktu@gmail.com>
parents:
95268
diff
changeset
|
1181 beginning-of-line |
b6ac850e9d2b
Fix bug #272, and update Ada mode to version 4.0.
Juanma Barranquero <lekktu@gmail.com>
parents:
95268
diff
changeset
|
1182 (font-lock-syntactic-keywords . ada-font-lock-syntactic-keywords))) |
30411
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
1183 |
25903
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
1184 ;; Set up support for find-file.el. |
38446
f63fbebe03fb
(ada-mode): Avoid unneeded version checks.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
38422
diff
changeset
|
1185 (set (make-local-variable 'ff-other-file-alist) |
25903
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
1186 'ada-other-file-alist) |
38446
f63fbebe03fb
(ada-mode): Avoid unneeded version checks.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
38422
diff
changeset
|
1187 (set (make-local-variable 'ff-search-directories) |
50812
15929fed5553
(ada-xemacs): Variable removed, since it's better to use (featurep 'xemacs).
Juanma Barranquero <lekktu@gmail.com>
parents:
50736
diff
changeset
|
1188 'ada-search-directories-internal) |
15929fed5553
(ada-xemacs): Variable removed, since it's better to use (featurep 'xemacs).
Juanma Barranquero <lekktu@gmail.com>
parents:
50736
diff
changeset
|
1189 (setq ff-post-load-hook 'ada-set-point-accordingly |
73531
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
1190 ff-file-created-hook 'ada-make-body) |
50812
15929fed5553
(ada-xemacs): Variable removed, since it's better to use (featurep 'xemacs).
Juanma Barranquero <lekktu@gmail.com>
parents:
50736
diff
changeset
|
1191 (add-hook 'ff-pre-load-hook 'ada-which-function-are-we-in) |
30411
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
1192 |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
1193 (make-local-variable 'ff-special-constructs) |
73932
242a56e8b2c0
Replace conditional (require 'ispell) with defvar.
Juanma Barranquero <lekktu@gmail.com>
parents:
73922
diff
changeset
|
1194 (mapc (lambda (pair) (add-to-list 'ff-special-constructs pair)) |
97058
b6ac850e9d2b
Fix bug #272, and update Ada mode to version 4.0.
Juanma Barranquero <lekktu@gmail.com>
parents:
95268
diff
changeset
|
1195 (list |
b6ac850e9d2b
Fix bug #272, and update Ada mode to version 4.0.
Juanma Barranquero <lekktu@gmail.com>
parents:
95268
diff
changeset
|
1196 ;; Top level child package declaration; go to the parent package. |
b6ac850e9d2b
Fix bug #272, and update Ada mode to version 4.0.
Juanma Barranquero <lekktu@gmail.com>
parents:
95268
diff
changeset
|
1197 (cons (eval-when-compile |
b6ac850e9d2b
Fix bug #272, and update Ada mode to version 4.0.
Juanma Barranquero <lekktu@gmail.com>
parents:
95268
diff
changeset
|
1198 (concat "^\\(private[ \t]\\)?[ \t]*package[ \t]+" |
b6ac850e9d2b
Fix bug #272, and update Ada mode to version 4.0.
Juanma Barranquero <lekktu@gmail.com>
parents:
95268
diff
changeset
|
1199 "\\(body[ \t]+\\)?" |
b6ac850e9d2b
Fix bug #272, and update Ada mode to version 4.0.
Juanma Barranquero <lekktu@gmail.com>
parents:
95268
diff
changeset
|
1200 "\\(\\(\\sw\\|[_.]\\)+\\)\\.\\(\\sw\\|_\\)+[ \t\n]+is")) |
b6ac850e9d2b
Fix bug #272, and update Ada mode to version 4.0.
Juanma Barranquero <lekktu@gmail.com>
parents:
95268
diff
changeset
|
1201 (lambda () |
b6ac850e9d2b
Fix bug #272, and update Ada mode to version 4.0.
Juanma Barranquero <lekktu@gmail.com>
parents:
95268
diff
changeset
|
1202 (ff-get-file |
b6ac850e9d2b
Fix bug #272, and update Ada mode to version 4.0.
Juanma Barranquero <lekktu@gmail.com>
parents:
95268
diff
changeset
|
1203 ada-search-directories-internal |
b6ac850e9d2b
Fix bug #272, and update Ada mode to version 4.0.
Juanma Barranquero <lekktu@gmail.com>
parents:
95268
diff
changeset
|
1204 (ada-make-filename-from-adaname (match-string 3)) |
b6ac850e9d2b
Fix bug #272, and update Ada mode to version 4.0.
Juanma Barranquero <lekktu@gmail.com>
parents:
95268
diff
changeset
|
1205 ada-spec-suffixes))) |
b6ac850e9d2b
Fix bug #272, and update Ada mode to version 4.0.
Juanma Barranquero <lekktu@gmail.com>
parents:
95268
diff
changeset
|
1206 |
b6ac850e9d2b
Fix bug #272, and update Ada mode to version 4.0.
Juanma Barranquero <lekktu@gmail.com>
parents:
95268
diff
changeset
|
1207 ;; A "separate" clause. |
b6ac850e9d2b
Fix bug #272, and update Ada mode to version 4.0.
Juanma Barranquero <lekktu@gmail.com>
parents:
95268
diff
changeset
|
1208 (cons "^separate[ \t\n]*(\\(\\(\\sw\\|[_.]\\)+\\))" |
b6ac850e9d2b
Fix bug #272, and update Ada mode to version 4.0.
Juanma Barranquero <lekktu@gmail.com>
parents:
95268
diff
changeset
|
1209 (lambda () |
b6ac850e9d2b
Fix bug #272, and update Ada mode to version 4.0.
Juanma Barranquero <lekktu@gmail.com>
parents:
95268
diff
changeset
|
1210 (ff-get-file |
b6ac850e9d2b
Fix bug #272, and update Ada mode to version 4.0.
Juanma Barranquero <lekktu@gmail.com>
parents:
95268
diff
changeset
|
1211 ada-search-directories-internal |
b6ac850e9d2b
Fix bug #272, and update Ada mode to version 4.0.
Juanma Barranquero <lekktu@gmail.com>
parents:
95268
diff
changeset
|
1212 (ada-make-filename-from-adaname (match-string 1)) |
b6ac850e9d2b
Fix bug #272, and update Ada mode to version 4.0.
Juanma Barranquero <lekktu@gmail.com>
parents:
95268
diff
changeset
|
1213 ada-spec-suffixes))) |
b6ac850e9d2b
Fix bug #272, and update Ada mode to version 4.0.
Juanma Barranquero <lekktu@gmail.com>
parents:
95268
diff
changeset
|
1214 |
b6ac850e9d2b
Fix bug #272, and update Ada mode to version 4.0.
Juanma Barranquero <lekktu@gmail.com>
parents:
95268
diff
changeset
|
1215 ;; A "with" clause. |
b6ac850e9d2b
Fix bug #272, and update Ada mode to version 4.0.
Juanma Barranquero <lekktu@gmail.com>
parents:
95268
diff
changeset
|
1216 (cons "^with[ \t]+\\([a-zA-Z0-9_\\.]+\\)" |
b6ac850e9d2b
Fix bug #272, and update Ada mode to version 4.0.
Juanma Barranquero <lekktu@gmail.com>
parents:
95268
diff
changeset
|
1217 (lambda () |
b6ac850e9d2b
Fix bug #272, and update Ada mode to version 4.0.
Juanma Barranquero <lekktu@gmail.com>
parents:
95268
diff
changeset
|
1218 (ff-get-file |
b6ac850e9d2b
Fix bug #272, and update Ada mode to version 4.0.
Juanma Barranquero <lekktu@gmail.com>
parents:
95268
diff
changeset
|
1219 ada-search-directories-internal |
b6ac850e9d2b
Fix bug #272, and update Ada mode to version 4.0.
Juanma Barranquero <lekktu@gmail.com>
parents:
95268
diff
changeset
|
1220 (ada-make-filename-from-adaname (match-string 1)) |
b6ac850e9d2b
Fix bug #272, and update Ada mode to version 4.0.
Juanma Barranquero <lekktu@gmail.com>
parents:
95268
diff
changeset
|
1221 ada-spec-suffixes))) |
b6ac850e9d2b
Fix bug #272, and update Ada mode to version 4.0.
Juanma Barranquero <lekktu@gmail.com>
parents:
95268
diff
changeset
|
1222 )) |
30411
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
1223 |
25903
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
1224 ;; Support for outline-minor-mode |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
1225 (set (make-local-variable 'outline-regexp) |
30411
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
1226 "\\([ \t]*\\(procedure\\|function\\|package\\|if\\|while\\|for\\|declare\\|case\\|end\\|begin\\|loop\\)\\|--\\)") |
25903
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
1227 (set (make-local-variable 'outline-level) 'ada-outline-level) |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
1228 |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
1229 ;; Support for imenu : We want a sorted index |
97058
b6ac850e9d2b
Fix bug #272, and update Ada mode to version 4.0.
Juanma Barranquero <lekktu@gmail.com>
parents:
95268
diff
changeset
|
1230 (setq imenu-generic-expression ada-imenu-generic-expression) |
b6ac850e9d2b
Fix bug #272, and update Ada mode to version 4.0.
Juanma Barranquero <lekktu@gmail.com>
parents:
95268
diff
changeset
|
1231 |
33716
c55ff055c68a
(ada-mode): `set '' -> `setq'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
32300
diff
changeset
|
1232 (setq imenu-sort-function 'imenu--sort-by-name) |
25903
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
1233 |
44465
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
1234 ;; Support for ispell : Check only comments |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
1235 (set (make-local-variable 'ispell-check-comments) 'exclusive) |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
1236 |
73932
242a56e8b2c0
Replace conditional (require 'ispell) with defvar.
Juanma Barranquero <lekktu@gmail.com>
parents:
73922
diff
changeset
|
1237 ;; Support for align |
242a56e8b2c0
Replace conditional (require 'ispell) with defvar.
Juanma Barranquero <lekktu@gmail.com>
parents:
73922
diff
changeset
|
1238 (add-to-list 'align-dq-string-modes 'ada-mode) |
242a56e8b2c0
Replace conditional (require 'ispell) with defvar.
Juanma Barranquero <lekktu@gmail.com>
parents:
73922
diff
changeset
|
1239 (add-to-list 'align-open-comment-modes 'ada-mode) |
242a56e8b2c0
Replace conditional (require 'ispell) with defvar.
Juanma Barranquero <lekktu@gmail.com>
parents:
73922
diff
changeset
|
1240 (set (make-local-variable 'align-region-separate) ada-align-region-separate) |
242a56e8b2c0
Replace conditional (require 'ispell) with defvar.
Juanma Barranquero <lekktu@gmail.com>
parents:
73922
diff
changeset
|
1241 |
242a56e8b2c0
Replace conditional (require 'ispell) with defvar.
Juanma Barranquero <lekktu@gmail.com>
parents:
73922
diff
changeset
|
1242 ;; Exclude comments alone on line from alignment. |
242a56e8b2c0
Replace conditional (require 'ispell) with defvar.
Juanma Barranquero <lekktu@gmail.com>
parents:
73922
diff
changeset
|
1243 (add-to-list 'align-exclude-rules-list |
97058
b6ac850e9d2b
Fix bug #272, and update Ada mode to version 4.0.
Juanma Barranquero <lekktu@gmail.com>
parents:
95268
diff
changeset
|
1244 '(ada-solo-comment |
b6ac850e9d2b
Fix bug #272, and update Ada mode to version 4.0.
Juanma Barranquero <lekktu@gmail.com>
parents:
95268
diff
changeset
|
1245 (regexp . "^\\(\\s-*\\)--") |
b6ac850e9d2b
Fix bug #272, and update Ada mode to version 4.0.
Juanma Barranquero <lekktu@gmail.com>
parents:
95268
diff
changeset
|
1246 (modes . '(ada-mode)))) |
73932
242a56e8b2c0
Replace conditional (require 'ispell) with defvar.
Juanma Barranquero <lekktu@gmail.com>
parents:
73922
diff
changeset
|
1247 (add-to-list 'align-exclude-rules-list |
97058
b6ac850e9d2b
Fix bug #272, and update Ada mode to version 4.0.
Juanma Barranquero <lekktu@gmail.com>
parents:
95268
diff
changeset
|
1248 '(ada-solo-use |
b6ac850e9d2b
Fix bug #272, and update Ada mode to version 4.0.
Juanma Barranquero <lekktu@gmail.com>
parents:
95268
diff
changeset
|
1249 (regexp . "^\\(\\s-*\\)\\<use\\>") |
b6ac850e9d2b
Fix bug #272, and update Ada mode to version 4.0.
Juanma Barranquero <lekktu@gmail.com>
parents:
95268
diff
changeset
|
1250 (modes . '(ada-mode)))) |
73932
242a56e8b2c0
Replace conditional (require 'ispell) with defvar.
Juanma Barranquero <lekktu@gmail.com>
parents:
73922
diff
changeset
|
1251 |
242a56e8b2c0
Replace conditional (require 'ispell) with defvar.
Juanma Barranquero <lekktu@gmail.com>
parents:
73922
diff
changeset
|
1252 (setq ada-align-modes nil) |
242a56e8b2c0
Replace conditional (require 'ispell) with defvar.
Juanma Barranquero <lekktu@gmail.com>
parents:
73922
diff
changeset
|
1253 |
242a56e8b2c0
Replace conditional (require 'ispell) with defvar.
Juanma Barranquero <lekktu@gmail.com>
parents:
73922
diff
changeset
|
1254 (add-to-list 'ada-align-modes |
97058
b6ac850e9d2b
Fix bug #272, and update Ada mode to version 4.0.
Juanma Barranquero <lekktu@gmail.com>
parents:
95268
diff
changeset
|
1255 '(ada-declaration-assign |
b6ac850e9d2b
Fix bug #272, and update Ada mode to version 4.0.
Juanma Barranquero <lekktu@gmail.com>
parents:
95268
diff
changeset
|
1256 (regexp . "[^:]\\(\\s-*\\):[^:]") |
b6ac850e9d2b
Fix bug #272, and update Ada mode to version 4.0.
Juanma Barranquero <lekktu@gmail.com>
parents:
95268
diff
changeset
|
1257 (valid . (lambda() (not (ada-in-comment-p)))) |
b6ac850e9d2b
Fix bug #272, and update Ada mode to version 4.0.
Juanma Barranquero <lekktu@gmail.com>
parents:
95268
diff
changeset
|
1258 (repeat . t) |
b6ac850e9d2b
Fix bug #272, and update Ada mode to version 4.0.
Juanma Barranquero <lekktu@gmail.com>
parents:
95268
diff
changeset
|
1259 (modes . '(ada-mode)))) |
73932
242a56e8b2c0
Replace conditional (require 'ispell) with defvar.
Juanma Barranquero <lekktu@gmail.com>
parents:
73922
diff
changeset
|
1260 (add-to-list 'ada-align-modes |
97058
b6ac850e9d2b
Fix bug #272, and update Ada mode to version 4.0.
Juanma Barranquero <lekktu@gmail.com>
parents:
95268
diff
changeset
|
1261 '(ada-associate |
b6ac850e9d2b
Fix bug #272, and update Ada mode to version 4.0.
Juanma Barranquero <lekktu@gmail.com>
parents:
95268
diff
changeset
|
1262 (regexp . "[^=]\\(\\s-*\\)=>") |
b6ac850e9d2b
Fix bug #272, and update Ada mode to version 4.0.
Juanma Barranquero <lekktu@gmail.com>
parents:
95268
diff
changeset
|
1263 (valid . (lambda() (not (ada-in-comment-p)))) |
b6ac850e9d2b
Fix bug #272, and update Ada mode to version 4.0.
Juanma Barranquero <lekktu@gmail.com>
parents:
95268
diff
changeset
|
1264 (modes . '(ada-mode)))) |
73932
242a56e8b2c0
Replace conditional (require 'ispell) with defvar.
Juanma Barranquero <lekktu@gmail.com>
parents:
73922
diff
changeset
|
1265 (add-to-list 'ada-align-modes |
97058
b6ac850e9d2b
Fix bug #272, and update Ada mode to version 4.0.
Juanma Barranquero <lekktu@gmail.com>
parents:
95268
diff
changeset
|
1266 '(ada-comment |
b6ac850e9d2b
Fix bug #272, and update Ada mode to version 4.0.
Juanma Barranquero <lekktu@gmail.com>
parents:
95268
diff
changeset
|
1267 (regexp . "\\(\\s-*\\)--") |
b6ac850e9d2b
Fix bug #272, and update Ada mode to version 4.0.
Juanma Barranquero <lekktu@gmail.com>
parents:
95268
diff
changeset
|
1268 (modes . '(ada-mode)))) |
73932
242a56e8b2c0
Replace conditional (require 'ispell) with defvar.
Juanma Barranquero <lekktu@gmail.com>
parents:
73922
diff
changeset
|
1269 (add-to-list 'ada-align-modes |
97058
b6ac850e9d2b
Fix bug #272, and update Ada mode to version 4.0.
Juanma Barranquero <lekktu@gmail.com>
parents:
95268
diff
changeset
|
1270 '(ada-use |
b6ac850e9d2b
Fix bug #272, and update Ada mode to version 4.0.
Juanma Barranquero <lekktu@gmail.com>
parents:
95268
diff
changeset
|
1271 (regexp . "\\(\\s-*\\)\\<use\\s-") |
b6ac850e9d2b
Fix bug #272, and update Ada mode to version 4.0.
Juanma Barranquero <lekktu@gmail.com>
parents:
95268
diff
changeset
|
1272 (valid . (lambda() (not (ada-in-comment-p)))) |
b6ac850e9d2b
Fix bug #272, and update Ada mode to version 4.0.
Juanma Barranquero <lekktu@gmail.com>
parents:
95268
diff
changeset
|
1273 (modes . '(ada-mode)))) |
73932
242a56e8b2c0
Replace conditional (require 'ispell) with defvar.
Juanma Barranquero <lekktu@gmail.com>
parents:
73922
diff
changeset
|
1274 (add-to-list 'ada-align-modes |
97058
b6ac850e9d2b
Fix bug #272, and update Ada mode to version 4.0.
Juanma Barranquero <lekktu@gmail.com>
parents:
95268
diff
changeset
|
1275 '(ada-at |
b6ac850e9d2b
Fix bug #272, and update Ada mode to version 4.0.
Juanma Barranquero <lekktu@gmail.com>
parents:
95268
diff
changeset
|
1276 (regexp . "\\(\\s-+\\)at\\>") |
b6ac850e9d2b
Fix bug #272, and update Ada mode to version 4.0.
Juanma Barranquero <lekktu@gmail.com>
parents:
95268
diff
changeset
|
1277 (modes . '(ada-mode)))) |
73932
242a56e8b2c0
Replace conditional (require 'ispell) with defvar.
Juanma Barranquero <lekktu@gmail.com>
parents:
73922
diff
changeset
|
1278 |
242a56e8b2c0
Replace conditional (require 'ispell) with defvar.
Juanma Barranquero <lekktu@gmail.com>
parents:
73922
diff
changeset
|
1279 (setq align-mode-rules-list ada-align-modes) |
49598
0d8b17d428b5
Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
45931
diff
changeset
|
1280 |
25903
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
1281 ;; Set up the contextual menu |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
1282 (if ada-popup-key |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
1283 (define-key ada-mode-map ada-popup-key 'ada-popup-menu)) |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
1284 |
30411
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
1285 ;; Support for Abbreviations (the user still need to "M-x abbrev-mode" |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
1286 (define-abbrev-table 'ada-mode-abbrev-table ()) |
33716
c55ff055c68a
(ada-mode): `set '' -> `setq'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
32300
diff
changeset
|
1287 (setq local-abbrev-table ada-mode-abbrev-table) |
30411
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
1288 |
45931
a4c8d672ccbe
* progmodes/ada-mode.el: Update copyright notice.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
44933
diff
changeset
|
1289 ;; Support for which-function mode |
52692
3ec76ef338f9
(ada-mode): Don't use advice. Instead, set which-func-functions.
Richard M. Stallman <rms@gnu.org>
parents:
52401
diff
changeset
|
1290 (make-local-variable 'which-func-functions) |
3ec76ef338f9
(ada-mode): Don't use advice. Instead, set which-func-functions.
Richard M. Stallman <rms@gnu.org>
parents:
52401
diff
changeset
|
1291 (setq which-func-functions '(ada-which-function)) |
45931
a4c8d672ccbe
* progmodes/ada-mode.el: Update copyright notice.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
44933
diff
changeset
|
1292 |
25903
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
1293 ;; Support for indent-new-comment-line (Especially for XEmacs) |
78589
56d6a084bbb6
(ada-create-syntax-table): Move
Martin Rudalics <rudalics@gmx.at>
parents:
78234
diff
changeset
|
1294 (set (make-local-variable 'comment-multi-line) nil) |
25903
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
1295 |
97058
b6ac850e9d2b
Fix bug #272, and update Ada mode to version 4.0.
Juanma Barranquero <lekktu@gmail.com>
parents:
95268
diff
changeset
|
1296 ;; Support for add-log |
b6ac850e9d2b
Fix bug #272, and update Ada mode to version 4.0.
Juanma Barranquero <lekktu@gmail.com>
parents:
95268
diff
changeset
|
1297 (set (make-local-variable 'add-log-current-defun-function) 'ada-which-function) |
b6ac850e9d2b
Fix bug #272, and update Ada mode to version 4.0.
Juanma Barranquero <lekktu@gmail.com>
parents:
95268
diff
changeset
|
1298 |
44465
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
1299 (setq major-mode 'ada-mode |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
1300 mode-name "Ada") |
10705 | 1301 |
1302 (use-local-map ada-mode-map) | |
1303 | |
38446
f63fbebe03fb
(ada-mode): Avoid unneeded version checks.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
38422
diff
changeset
|
1304 (easy-menu-add ada-mode-menu ada-mode-map) |
30411
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
1305 |
25903
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
1306 (set-syntax-table ada-mode-syntax-table) |
10705 | 1307 |
62213
39b445ca202b
(ada-adjust-case-skeleton): Moved from ada-stmt.el.
Richard M. Stallman <rms@gnu.org>
parents:
59237
diff
changeset
|
1308 (set (make-local-variable 'skeleton-further-elements) |
39b445ca202b
(ada-adjust-case-skeleton): Moved from ada-stmt.el.
Richard M. Stallman <rms@gnu.org>
parents:
59237
diff
changeset
|
1309 '((< '(backward-delete-char-untabify |
39b445ca202b
(ada-adjust-case-skeleton): Moved from ada-stmt.el.
Richard M. Stallman <rms@gnu.org>
parents:
59237
diff
changeset
|
1310 (min ada-indent (current-column)))))) |
39b445ca202b
(ada-adjust-case-skeleton): Moved from ada-stmt.el.
Richard M. Stallman <rms@gnu.org>
parents:
59237
diff
changeset
|
1311 (add-hook 'skeleton-end-hook 'ada-adjust-case-skeleton nil t) |
39b445ca202b
(ada-adjust-case-skeleton): Moved from ada-stmt.el.
Richard M. Stallman <rms@gnu.org>
parents:
59237
diff
changeset
|
1312 |
62772
f2892faa87d4
* progmodes/ada-mode.el (ada-mode):
Lute Kamstra <lute@gnu.org>
parents:
62213
diff
changeset
|
1313 (run-mode-hooks 'ada-mode-hook) |
10705 | 1314 |
44465
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
1315 ;; To be run after the hook, in case the user modified |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
1316 ;; ada-fill-comment-prefix |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
1317 (make-local-variable 'comment-start) |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
1318 (if ada-fill-comment-prefix |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
1319 (set 'comment-start ada-fill-comment-prefix) |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
1320 (set 'comment-start "-- ")) |
49598
0d8b17d428b5
Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
45931
diff
changeset
|
1321 |
25903
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
1322 ;; Run this after the hook to give the users a chance to activate |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
1323 ;; font-lock-mode |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
1324 |
50812
15929fed5553
(ada-xemacs): Variable removed, since it's better to use (featurep 'xemacs).
Juanma Barranquero <lekktu@gmail.com>
parents:
50736
diff
changeset
|
1325 (unless (featurep 'xemacs) |
78589
56d6a084bbb6
(ada-create-syntax-table): Move
Martin Rudalics <rudalics@gmx.at>
parents:
78234
diff
changeset
|
1326 (ada-initialize-syntax-table-properties) |
56d6a084bbb6
(ada-create-syntax-table): Move
Martin Rudalics <rudalics@gmx.at>
parents:
78234
diff
changeset
|
1327 (add-hook 'font-lock-mode-hook 'ada-handle-syntax-table-properties nil t)) |
25903
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
1328 |
10705 | 1329 ;; the following has to be done after running the ada-mode-hook |
1330 ;; because users might want to set the values of these variable | |
73531
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
1331 ;; inside the hook |
10705 | 1332 |
1333 (cond ((eq ada-language-version 'ada83) | |
73531
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
1334 (setq ada-keywords ada-83-keywords)) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
1335 ((eq ada-language-version 'ada95) |
73922
289cedd46cd8
Delete `eval-and-compile' around `require'.
Juanma Barranquero <lekktu@gmail.com>
parents:
73531
diff
changeset
|
1336 (setq ada-keywords ada-95-keywords)) |
73932
242a56e8b2c0
Replace conditional (require 'ispell) with defvar.
Juanma Barranquero <lekktu@gmail.com>
parents:
73922
diff
changeset
|
1337 ((eq ada-language-version 'ada2005) |
73922
289cedd46cd8
Delete `eval-and-compile' around `require'.
Juanma Barranquero <lekktu@gmail.com>
parents:
73531
diff
changeset
|
1338 (setq ada-keywords ada-2005-keywords))) |
10705 | 1339 |
1340 (if ada-auto-case | |
1341 (ada-activate-keys-for-case))) | |
1342 | |
62213
39b445ca202b
(ada-adjust-case-skeleton): Moved from ada-stmt.el.
Richard M. Stallman <rms@gnu.org>
parents:
59237
diff
changeset
|
1343 (defun ada-adjust-case-skeleton () |
39b445ca202b
(ada-adjust-case-skeleton): Moved from ada-stmt.el.
Richard M. Stallman <rms@gnu.org>
parents:
59237
diff
changeset
|
1344 "Adjust the case of the text inserted by a skeleton." |
39b445ca202b
(ada-adjust-case-skeleton): Moved from ada-stmt.el.
Richard M. Stallman <rms@gnu.org>
parents:
59237
diff
changeset
|
1345 (save-excursion |
39b445ca202b
(ada-adjust-case-skeleton): Moved from ada-stmt.el.
Richard M. Stallman <rms@gnu.org>
parents:
59237
diff
changeset
|
1346 (let ((aa-end (point))) |
39b445ca202b
(ada-adjust-case-skeleton): Moved from ada-stmt.el.
Richard M. Stallman <rms@gnu.org>
parents:
59237
diff
changeset
|
1347 (ada-adjust-case-region |
39b445ca202b
(ada-adjust-case-skeleton): Moved from ada-stmt.el.
Richard M. Stallman <rms@gnu.org>
parents:
59237
diff
changeset
|
1348 (progn (goto-char (symbol-value 'beg)) (forward-word -1) (point)) |
39b445ca202b
(ada-adjust-case-skeleton): Moved from ada-stmt.el.
Richard M. Stallman <rms@gnu.org>
parents:
59237
diff
changeset
|
1349 (goto-char aa-end))))) |
44465
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
1350 |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
1351 (defun ada-region-selected () |
87401
5c852af4e53c
(ada-region-selected): Use `use-region-p'.
Richard M. Stallman <rms@gnu.org>
parents:
84917
diff
changeset
|
1352 "Should we operate on an active region?" |
5c852af4e53c
(ada-region-selected): Use `use-region-p'.
Richard M. Stallman <rms@gnu.org>
parents:
84917
diff
changeset
|
1353 (if (fboundp 'use-region-p) |
5c852af4e53c
(ada-region-selected): Use `use-region-p'.
Richard M. Stallman <rms@gnu.org>
parents:
84917
diff
changeset
|
1354 (use-region-p) |
5c852af4e53c
(ada-region-selected): Use `use-region-p'.
Richard M. Stallman <rms@gnu.org>
parents:
84917
diff
changeset
|
1355 (region-active-p))) |
10705 | 1356 |
26225
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
1357 ;;----------------------------------------------------------------- |
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
1358 ;; auto-casing |
71537
2a4ed80e93ba
(ada-which-compiler, ada-mode-menu, ada-compile-mouse-goto-error,
Juanma Barranquero <lekktu@gmail.com>
parents:
68764
diff
changeset
|
1359 ;; Since Ada is case-insensitive, the Ada mode provides an extensive set of |
26225
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
1360 ;; functions to auto-case identifiers, keywords, ... |
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
1361 ;; The basic rules for autocasing are defined through the variables |
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
1362 ;; `ada-case-attribute', `ada-case-keyword' and `ada-case-identifier'. These |
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
1363 ;; are references to the functions that will do the actual casing. |
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
1364 ;; |
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
1365 ;; However, in most cases, the user will want to define some exceptions to |
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
1366 ;; these casing rules. This is done through a list of files, that contain |
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
1367 ;; one word per line. These files are stored in `ada-case-exception-file'. |
30411
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
1368 ;; For backward compatibility, this variable can also be a string. |
26225
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
1369 ;;----------------------------------------------------------------- |
25903
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
1370 |
44465
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
1371 (defun ada-save-exceptions-to-file (file-name) |
73531
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
1372 "Save the casing exception lists to the file FILE-NAME. |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
1373 Casing exception lists are `ada-case-exception' and `ada-case-exception-substring'." |
44465
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
1374 (find-file (expand-file-name file-name)) |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
1375 (erase-buffer) |
84917
e52cb6ef60ec
(ada-save-exceptions-to-file): Use `mapc' rather than `mapcar'.
Juanma Barranquero <lekktu@gmail.com>
parents:
78601
diff
changeset
|
1376 (mapc (lambda (x) (insert (car x) "\n")) |
e52cb6ef60ec
(ada-save-exceptions-to-file): Use `mapc' rather than `mapcar'.
Juanma Barranquero <lekktu@gmail.com>
parents:
78601
diff
changeset
|
1377 (sort (copy-sequence ada-case-exception) |
e52cb6ef60ec
(ada-save-exceptions-to-file): Use `mapc' rather than `mapcar'.
Juanma Barranquero <lekktu@gmail.com>
parents:
78601
diff
changeset
|
1378 (lambda(a b) (string< (car a) (car b))))) |
e52cb6ef60ec
(ada-save-exceptions-to-file): Use `mapc' rather than `mapcar'.
Juanma Barranquero <lekktu@gmail.com>
parents:
78601
diff
changeset
|
1379 (mapc (lambda (x) (insert "*" (car x) "\n")) |
e52cb6ef60ec
(ada-save-exceptions-to-file): Use `mapc' rather than `mapcar'.
Juanma Barranquero <lekktu@gmail.com>
parents:
78601
diff
changeset
|
1380 (sort (copy-sequence ada-case-exception-substring) |
e52cb6ef60ec
(ada-save-exceptions-to-file): Use `mapc' rather than `mapcar'.
Juanma Barranquero <lekktu@gmail.com>
parents:
78601
diff
changeset
|
1381 (lambda(a b) (string< (car a) (car b))))) |
44465
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
1382 (save-buffer) |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
1383 (kill-buffer nil) |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
1384 ) |
49598
0d8b17d428b5
Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
45931
diff
changeset
|
1385 |
25903
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
1386 (defun ada-create-case-exception (&optional word) |
63528
d6d50a511d12
(ada-format-paramlist)
Juanma Barranquero <lekktu@gmail.com>
parents:
63425
diff
changeset
|
1387 "Define WORD as an exception for the casing system. |
26225
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
1388 If WORD is not given, then the current word in the buffer is used instead. |
97078
2f3e251c6e3c
Typo fixes for Ada mode.
Juanma Barranquero <lekktu@gmail.com>
parents:
97058
diff
changeset
|
1389 The new word is added to the first file in `ada-case-exception-file'. |
26225
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
1390 The standard casing rules will no longer apply to this word." |
10705 | 1391 (interactive) |
25903
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
1392 (let ((previous-syntax-table (syntax-table)) |
73531
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
1393 file-name |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
1394 ) |
30411
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
1395 |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
1396 (cond ((stringp ada-case-exception-file) |
73531
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
1397 (setq file-name ada-case-exception-file)) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
1398 ((listp ada-case-exception-file) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
1399 (setq file-name (car ada-case-exception-file))) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
1400 (t |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
1401 (error (concat "No exception file specified. " |
63425
d6e1fdb10546
(ada-create-case-exception, ada-create-case-exception-substring,
Juanma Barranquero <lekktu@gmail.com>
parents:
62772
diff
changeset
|
1402 "See variable ada-case-exception-file")))) |
30411
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
1403 |
25903
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
1404 (set-syntax-table ada-mode-symbol-syntax-table) |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
1405 (unless word |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
1406 (save-excursion |
73531
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
1407 (skip-syntax-backward "w") |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
1408 (setq word (buffer-substring-no-properties |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
1409 (point) (save-excursion (forward-word 1) (point)))))) |
44465
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
1410 (set-syntax-table previous-syntax-table) |
25903
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
1411 |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
1412 ;; Reread the exceptions file, in case it was modified by some other, |
44465
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
1413 (ada-case-read-exceptions-from-file file-name) |
30411
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
1414 |
25903
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
1415 ;; If the word is already in the list, even with a different casing |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
1416 ;; we simply want to replace it. |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
1417 (if (and (not (equal ada-case-exception '())) |
73531
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
1418 (assoc-string word ada-case-exception t)) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
1419 (setcar (assoc-string word ada-case-exception t) word) |
25903
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
1420 (add-to-list 'ada-case-exception (cons word t)) |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
1421 ) |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
1422 |
44465
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
1423 (ada-save-exceptions-to-file file-name) |
25903
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
1424 )) |
30411
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
1425 |
44465
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
1426 (defun ada-create-case-exception-substring (&optional word) |
63528
d6d50a511d12
(ada-format-paramlist)
Juanma Barranquero <lekktu@gmail.com>
parents:
63425
diff
changeset
|
1427 "Define the substring WORD as an exception for the casing system. |
44465
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
1428 If WORD is not given, then the current word in the buffer is used instead, |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
1429 or the selected region if any is active. |
63528
d6d50a511d12
(ada-format-paramlist)
Juanma Barranquero <lekktu@gmail.com>
parents:
63425
diff
changeset
|
1430 The new word is added to the first file in `ada-case-exception-file'. |
44465
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
1431 When auto-casing a word, this substring will be special-cased, unless the |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
1432 word itself has a special casing." |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
1433 (interactive) |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
1434 (let ((file-name |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
1435 (cond ((stringp ada-case-exception-file) |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
1436 ada-case-exception-file) |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
1437 ((listp ada-case-exception-file) |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
1438 (car ada-case-exception-file)) |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
1439 (t |
73422
e1bac685e6a0
(ada-83-string-keywords, ada-last-which-function-line ada-no-auto-case,
Juanma Barranquero <lekktu@gmail.com>
parents:
71924
diff
changeset
|
1440 (error (concat "No exception file specified. " |
63425
d6e1fdb10546
(ada-create-case-exception, ada-create-case-exception-substring,
Juanma Barranquero <lekktu@gmail.com>
parents:
62772
diff
changeset
|
1441 "See variable ada-case-exception-file")))))) |
44465
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
1442 |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
1443 ;; Find the substring to define as an exception. Order is: the parameter, |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
1444 ;; if any, or the selected region, or the word under the cursor |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
1445 (cond |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
1446 (word nil) |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
1447 |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
1448 ((ada-region-selected) |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
1449 (setq word (buffer-substring-no-properties |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
1450 (region-beginning) (region-end)))) |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
1451 |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
1452 (t |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
1453 (let ((underscore-syntax (char-syntax ?_))) |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
1454 (unwind-protect |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
1455 (progn |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
1456 (modify-syntax-entry ?_ "." (syntax-table)) |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
1457 (save-excursion |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
1458 (skip-syntax-backward "w") |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
1459 (set 'word (buffer-substring-no-properties |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
1460 (point) |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
1461 (save-excursion (forward-word 1) (point)))))) |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
1462 (modify-syntax-entry ?_ (make-string 1 underscore-syntax) |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
1463 (syntax-table)))))) |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
1464 |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
1465 ;; Reread the exceptions file, in case it was modified by some other, |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
1466 (ada-case-read-exceptions-from-file file-name) |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
1467 |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
1468 ;; If the word is already in the list, even with a different casing |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
1469 ;; we simply want to replace it. |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
1470 (if (and (not (equal ada-case-exception-substring '())) |
73531
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
1471 (assoc-string word ada-case-exception-substring t)) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
1472 (setcar (assoc-string word ada-case-exception-substring t) word) |
44465
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
1473 (add-to-list 'ada-case-exception-substring (cons word t)) |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
1474 ) |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
1475 |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
1476 (ada-save-exceptions-to-file file-name) |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
1477 |
65584
6dbba0bd58df
Message format fixes, commit no. 3
Deepak Goel <deego@gnufans.org>
parents:
65223
diff
changeset
|
1478 (message "%s" (concat "Defining " word " as a casing exception")))) |
44465
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
1479 |
30411
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
1480 (defun ada-case-read-exceptions-from-file (file-name) |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
1481 "Read the content of the casing exception file FILE-NAME." |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
1482 (if (file-readable-p (expand-file-name file-name)) |
25903
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
1483 (let ((buffer (current-buffer))) |
73531
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
1484 (find-file (expand-file-name file-name)) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
1485 (set-syntax-table ada-mode-symbol-syntax-table) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
1486 (widen) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
1487 (goto-char (point-min)) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
1488 (while (not (eobp)) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
1489 |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
1490 ;; If the item is already in the list, even with an other casing, |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
1491 ;; do not add it again. This way, the user can easily decide which |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
1492 ;; priority should be applied to each casing exception |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
1493 (let ((word (buffer-substring-no-properties |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
1494 (point) (save-excursion (forward-word 1) (point))))) |
44465
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
1495 |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
1496 ;; Handling a substring ? |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
1497 (if (char-equal (string-to-char word) ?*) |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
1498 (progn |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
1499 (setq word (substring word 1)) |
55730
b4eeb441c089
Use assoc-string, not assoc-ignore-case.
Richard M. Stallman <rms@gnu.org>
parents:
54889
diff
changeset
|
1500 (unless (assoc-string word ada-case-exception-substring t) |
44465
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
1501 (add-to-list 'ada-case-exception-substring (cons word t)))) |
55730
b4eeb441c089
Use assoc-string, not assoc-ignore-case.
Richard M. Stallman <rms@gnu.org>
parents:
54889
diff
changeset
|
1502 (unless (assoc-string word ada-case-exception t) |
44465
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
1503 (add-to-list 'ada-case-exception (cons word t))))) |
30411
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
1504 |
73531
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
1505 (forward-line 1)) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
1506 (kill-buffer nil) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
1507 (set-buffer buffer))) |
30411
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
1508 ) |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
1509 |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
1510 (defun ada-case-read-exceptions () |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
1511 "Read all the casing exception files from `ada-case-exception-file'." |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
1512 (interactive) |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
1513 |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
1514 ;; Reinitialize the casing exception list |
44465
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
1515 (setq ada-case-exception '() |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
1516 ada-case-exception-substring '()) |
30411
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
1517 |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
1518 (cond ((stringp ada-case-exception-file) |
73531
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
1519 (ada-case-read-exceptions-from-file ada-case-exception-file)) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
1520 |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
1521 ((listp ada-case-exception-file) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
1522 (mapcar 'ada-case-read-exceptions-from-file |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
1523 ada-case-exception-file)))) |
25903
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
1524 |
44465
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
1525 (defun ada-adjust-case-substring () |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
1526 "Adjust case of substrings in the previous word." |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
1527 (interactive) |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
1528 (let ((substrings ada-case-exception-substring) |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
1529 (max (point)) |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
1530 (case-fold-search t) |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
1531 (underscore-syntax (char-syntax ?_)) |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
1532 re) |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
1533 |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
1534 (save-excursion |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
1535 (forward-word -1) |
49598
0d8b17d428b5
Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
45931
diff
changeset
|
1536 |
44465
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
1537 (unwind-protect |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
1538 (progn |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
1539 (modify-syntax-entry ?_ "." (syntax-table)) |
49598
0d8b17d428b5
Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
45931
diff
changeset
|
1540 |
44465
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
1541 (while substrings |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
1542 (setq re (concat "\\b" (regexp-quote (caar substrings)) "\\b")) |
49598
0d8b17d428b5
Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
45931
diff
changeset
|
1543 |
44465
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
1544 (save-excursion |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
1545 (while (re-search-forward re max t) |
50736
b0ce71ab9c28
(ada-search-directories): Take into account ADA_INCLUDE_PATH for better
Juanma Barranquero <lekktu@gmail.com>
parents:
49598
diff
changeset
|
1546 (replace-match (caar substrings) t))) |
44465
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
1547 (setq substrings (cdr substrings)) |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
1548 ) |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
1549 ) |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
1550 (modify-syntax-entry ?_ (make-string 1 underscore-syntax) (syntax-table))) |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
1551 ))) |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
1552 |
25903
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
1553 (defun ada-adjust-case-identifier () |
26225
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
1554 "Adjust case of the previous identifier. |
73422
e1bac685e6a0
(ada-83-string-keywords, ada-last-which-function-line ada-no-auto-case,
Juanma Barranquero <lekktu@gmail.com>
parents:
71924
diff
changeset
|
1555 The auto-casing is done according to the value of `ada-case-identifier' |
e1bac685e6a0
(ada-83-string-keywords, ada-last-which-function-line ada-no-auto-case,
Juanma Barranquero <lekktu@gmail.com>
parents:
71924
diff
changeset
|
1556 and the exceptions defined in `ada-case-exception-file'." |
30411
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
1557 (interactive) |
25903
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
1558 (if (or (equal ada-case-exception '()) |
73531
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
1559 (equal (char-after) ?_)) |
44465
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
1560 (progn |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
1561 (funcall ada-case-identifier -1) |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
1562 (ada-adjust-case-substring)) |
25903
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
1563 |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
1564 (progn |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
1565 (let ((end (point)) |
73531
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
1566 (start (save-excursion (skip-syntax-backward "w") |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
1567 (point))) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
1568 match) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
1569 ;; If we have an exception, replace the word by the correct casing |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
1570 (if (setq match (assoc-string (buffer-substring start end) |
55730
b4eeb441c089
Use assoc-string, not assoc-ignore-case.
Richard M. Stallman <rms@gnu.org>
parents:
54889
diff
changeset
|
1571 ada-case-exception t)) |
25903
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
1572 |
73531
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
1573 (progn |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
1574 (delete-region start end) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
1575 (insert (car match))) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
1576 |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
1577 ;; Else simply re-case the word |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
1578 (funcall ada-case-identifier -1) |
44465
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
1579 (ada-adjust-case-substring)))))) |
10705 | 1580 |
1581 (defun ada-after-keyword-p () | |
63528
d6d50a511d12
(ada-format-paramlist)
Juanma Barranquero <lekktu@gmail.com>
parents:
63425
diff
changeset
|
1582 "Return t if cursor is after a keyword that is not an attribute." |
10705 | 1583 (save-excursion |
1584 (forward-word -1) | |
30411
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
1585 (and (not (and (char-before) |
73531
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
1586 (or (= (char-before) ?_) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
1587 (= (char-before) ?'))));; unless we have a _ or ' |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
1588 (looking-at (concat ada-keywords "[^_]"))))) |
10705 | 1589 |
1590 (defun ada-adjust-case (&optional force-identifier) | |
63528
d6d50a511d12
(ada-format-paramlist)
Juanma Barranquero <lekktu@gmail.com>
parents:
63425
diff
changeset
|
1591 "Adjust the case of the word before the character just typed. |
26225
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
1592 If FORCE-IDENTIFIER is non-nil then also adjust keyword as identifier." |
44465
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
1593 (if (not (bobp)) |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
1594 (progn |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
1595 (forward-char -1) |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
1596 (if (and (not (bobp)) |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
1597 ;; or if at the end of a character constant |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
1598 (not (and (eq (following-char) ?') |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
1599 (eq (char-before (1- (point))) ?'))) |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
1600 ;; or if the previous character was not part of a word |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
1601 (eq (char-syntax (char-before)) ?w) |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
1602 ;; if in a string or a comment |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
1603 (not (ada-in-string-or-comment-p)) |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
1604 ) |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
1605 (if (save-excursion |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
1606 (forward-word -1) |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
1607 (or (= (point) (point-min)) |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
1608 (backward-char 1)) |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
1609 (= (following-char) ?')) |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
1610 (funcall ada-case-attribute -1) |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
1611 (if (and |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
1612 (not force-identifier) ; (MH) |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
1613 (ada-after-keyword-p)) |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
1614 (funcall ada-case-keyword -1) |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
1615 (ada-adjust-case-identifier)))) |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
1616 (forward-char 1) |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
1617 )) |
25903
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
1618 ) |
10705 | 1619 |
1620 (defun ada-adjust-case-interactive (arg) | |
26225
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
1621 "Adjust the case of the previous word, and process the character just typed. |
63528
d6d50a511d12
(ada-format-paramlist)
Juanma Barranquero <lekktu@gmail.com>
parents:
63425
diff
changeset
|
1622 ARG is the prefix the user entered with \\[universal-argument]." |
10705 | 1623 (interactive "P") |
30411
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
1624 |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
1625 (if ada-auto-case |
101002
3b3c7e10cd97
Replace last-command-char with last-command-event.
Glenn Morris <rgm@gnu.org>
parents:
100891
diff
changeset
|
1626 (let ((lastk last-command-event) |
73531
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
1627 (previous-syntax-table (syntax-table))) |
30411
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
1628 |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
1629 (unwind-protect |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
1630 (progn |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
1631 (set-syntax-table ada-mode-symbol-syntax-table) |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
1632 (cond ((or (eq lastk ?\n) |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
1633 (eq lastk ?\r)) |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
1634 ;; horrible kludge |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
1635 (insert " ") |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
1636 (ada-adjust-case) |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
1637 ;; horrible dekludge |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
1638 (delete-backward-char 1) |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
1639 ;; some special keys and their bindings |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
1640 (cond |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
1641 ((eq lastk ?\n) |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
1642 (funcall ada-lfd-binding)) |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
1643 ((eq lastk ?\r) |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
1644 (funcall ada-ret-binding)))) |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
1645 ((eq lastk ?\C-i) (ada-tab)) |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
1646 ;; Else just insert the character |
73531
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
1647 ((self-insert-command (prefix-numeric-value arg)))) |
30411
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
1648 ;; if there is a keyword in front of the underscore |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
1649 ;; then it should be part of an identifier (MH) |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
1650 (if (eq lastk ?_) |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
1651 (ada-adjust-case t) |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
1652 (ada-adjust-case)) |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
1653 ) |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
1654 ;; Restore the syntax table |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
1655 (set-syntax-table previous-syntax-table)) |
73531
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
1656 ) |
30411
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
1657 |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
1658 ;; Else, no auto-casing |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
1659 (cond |
101002
3b3c7e10cd97
Replace last-command-char with last-command-event.
Glenn Morris <rgm@gnu.org>
parents:
100891
diff
changeset
|
1660 ((eq last-command-event ?\n) |
30411
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
1661 (funcall ada-lfd-binding)) |
101002
3b3c7e10cd97
Replace last-command-char with last-command-event.
Glenn Morris <rgm@gnu.org>
parents:
100891
diff
changeset
|
1662 ((eq last-command-event ?\r) |
30411
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
1663 (funcall ada-ret-binding)) |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
1664 (t |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
1665 (self-insert-command (prefix-numeric-value arg)))) |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
1666 )) |
10705 | 1667 |
1668 (defun ada-activate-keys-for-case () | |
63528
d6d50a511d12
(ada-format-paramlist)
Juanma Barranquero <lekktu@gmail.com>
parents:
63425
diff
changeset
|
1669 "Modify the key bindings for all the keys that should readjust the casing." |
25903
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
1670 (interactive) |
30411
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
1671 ;; Save original key-bindings to allow swapping ret/lfd |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
1672 ;; when casing is activated. |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
1673 ;; The 'or ...' is there to be sure that the value will not |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
1674 ;; be changed again when Ada mode is called more than once |
33716
c55ff055c68a
(ada-mode): `set '' -> `setq'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
32300
diff
changeset
|
1675 (or ada-ret-binding (setq ada-ret-binding (key-binding "\C-M"))) |
c55ff055c68a
(ada-mode): `set '' -> `setq'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
32300
diff
changeset
|
1676 (or ada-lfd-binding (setq ada-lfd-binding (key-binding "\C-j"))) |
30411
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
1677 |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
1678 ;; Call case modifying function after certain keys. |
10705 | 1679 (mapcar (function (lambda(key) (define-key |
73531
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
1680 ada-mode-map |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
1681 (char-to-string key) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
1682 'ada-adjust-case-interactive))) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
1683 '( ?` ?_ ?# ?% ?& ?* ?( ?) ?- ?= ?+ |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
1684 ?| ?\; ?: ?' ?\" ?< ?, ?. ?> ?/ ?\n 32 ?\r ))) |
10705 | 1685 |
1686 (defun ada-loose-case-word (&optional arg) | |
26225
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
1687 "Upcase first letter and letters following `_' in the following word. |
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
1688 No other letter is modified. |
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
1689 ARG is ignored, and is there for compatibility with `capitalize-word' only." |
25903
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
1690 (interactive) |
30411
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
1691 (save-excursion |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
1692 (let ((end (save-excursion (skip-syntax-forward "w") (point))) |
73531
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
1693 (first t)) |
30411
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
1694 (skip-syntax-backward "w") |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
1695 (while (and (or first (search-forward "_" end t)) |
73531
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
1696 (< (point) end)) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
1697 (and first |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
1698 (setq first nil)) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
1699 (insert-char (upcase (following-char)) 1) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
1700 (delete-char 1))))) |
30411
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
1701 |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
1702 (defun ada-no-auto-case (&optional arg) |
73531
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
1703 "Do nothing. ARG is ignored. |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
1704 This function can be used for the auto-casing variables in Ada mode, to |
73422
e1bac685e6a0
(ada-83-string-keywords, ada-last-which-function-line ada-no-auto-case,
Juanma Barranquero <lekktu@gmail.com>
parents:
71924
diff
changeset
|
1705 adapt to unusal auto-casing schemes. Since it does nothing, you can for |
30411
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
1706 instance use it for `ada-case-identifier' if you don't want any special |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
1707 auto-casing for identifiers, whereas keywords have to be lower-cased. |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
1708 See also `ada-auto-case' to disable auto casing altogether." |
97078
2f3e251c6e3c
Typo fixes for Ada mode.
Juanma Barranquero <lekktu@gmail.com>
parents:
97058
diff
changeset
|
1709 nil) |
10705 | 1710 |
25903
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
1711 (defun ada-capitalize-word (&optional arg) |
26225
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
1712 "Upcase first letter and letters following '_', lower case other letters. |
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
1713 ARG is ignored, and is there for compatibility with `capitalize-word' only." |
25903
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
1714 (interactive) |
30411
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
1715 (let ((end (save-excursion (skip-syntax-forward "w") (point))) |
73531
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
1716 (begin (save-excursion (skip-syntax-backward "w") (point)))) |
25903
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
1717 (modify-syntax-entry ?_ "_") |
30411
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
1718 (capitalize-region begin end) |
25903
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
1719 (modify-syntax-entry ?_ "w"))) |
10705 | 1720 |
1721 (defun ada-adjust-case-region (from to) | |
63528
d6d50a511d12
(ada-format-paramlist)
Juanma Barranquero <lekktu@gmail.com>
parents:
63425
diff
changeset
|
1722 "Adjust the case of all words in the region between FROM and TO. |
d6d50a511d12
(ada-format-paramlist)
Juanma Barranquero <lekktu@gmail.com>
parents:
63425
diff
changeset
|
1723 Attention: This function might take very long for big regions!" |
10705 | 1724 (interactive "*r") |
1725 (let ((begin nil) | |
73531
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
1726 (end nil) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
1727 (keywordp nil) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
1728 (attribp nil) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
1729 (previous-syntax-table (syntax-table))) |
25903
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
1730 (message "Adjusting case ...") |
12039
a75524689022
(initial comments): Copyright 1995; don't speak
Karl Heuer <kwzh@gnu.org>
parents:
11869
diff
changeset
|
1731 (unwind-protect |
73531
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
1732 (save-excursion |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
1733 (set-syntax-table ada-mode-symbol-syntax-table) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
1734 (goto-char to) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
1735 ;; |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
1736 ;; loop: look for all identifiers, keywords, and attributes |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
1737 ;; |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
1738 (while (re-search-backward "\\<\\(\\sw+\\)\\>" from t) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
1739 (setq end (match-end 1)) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
1740 (setq attribp |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
1741 (and (> (point) from) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
1742 (save-excursion |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
1743 (forward-char -1) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
1744 (setq attribp (looking-at "'.[^']"))))) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
1745 (or |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
1746 ;; do nothing if it is a string or comment |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
1747 (ada-in-string-or-comment-p) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
1748 (progn |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
1749 ;; |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
1750 ;; get the identifier or keyword or attribute |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
1751 ;; |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
1752 (setq begin (point)) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
1753 (setq keywordp (looking-at ada-keywords)) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
1754 (goto-char end) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
1755 ;; |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
1756 ;; casing according to user-option |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
1757 ;; |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
1758 (if attribp |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
1759 (funcall ada-case-attribute -1) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
1760 (if keywordp |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
1761 (funcall ada-case-keyword -1) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
1762 (ada-adjust-case-identifier))) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
1763 (goto-char begin)))) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
1764 (message "Adjusting case ... Done")) |
25903
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
1765 (set-syntax-table previous-syntax-table)))) |
10705 | 1766 |
1767 (defun ada-adjust-case-buffer () | |
73422
e1bac685e6a0
(ada-83-string-keywords, ada-last-which-function-line ada-no-auto-case,
Juanma Barranquero <lekktu@gmail.com>
parents:
71924
diff
changeset
|
1768 "Adjust the case of all words in the whole buffer. |
63528
d6d50a511d12
(ada-format-paramlist)
Juanma Barranquero <lekktu@gmail.com>
parents:
63425
diff
changeset
|
1769 ATTENTION: This function might take very long for big buffers!" |
12039
a75524689022
(initial comments): Copyright 1995; don't speak
Karl Heuer <kwzh@gnu.org>
parents:
11869
diff
changeset
|
1770 (interactive "*") |
10705 | 1771 (ada-adjust-case-region (point-min) (point-max))) |
1772 | |
1773 | |
26225
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
1774 ;;-------------------------------------------------------------- |
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
1775 ;; Format Parameter Lists |
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
1776 ;; Some special algorithms are provided to indent the parameter lists in |
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
1777 ;; subprogram declarations. This is done in two steps: |
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
1778 ;; - First parses the parameter list. The returned list has the following |
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
1779 ;; format: |
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
1780 ;; ( (<Param_Name> in? out? access? <Type_Name> <Default_Expression>) |
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
1781 ;; ... ) |
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
1782 ;; This is done in `ada-scan-paramlist'. |
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
1783 ;; - Delete and recreate the parameter list in function |
30411
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
1784 ;; `ada-insert-paramlist'. |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
1785 ;; Both steps are called from `ada-format-paramlist'. |
26225
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
1786 ;; Note: Comments inside the parameter list are lost. |
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
1787 ;; The syntax has to be correct, or the reformating will fail. |
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
1788 ;;-------------------------------------------------------------- |
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
1789 |
10705 | 1790 (defun ada-format-paramlist () |
63528
d6d50a511d12
(ada-format-paramlist)
Juanma Barranquero <lekktu@gmail.com>
parents:
63425
diff
changeset
|
1791 "Reformat the parameter list point is in." |
10705 | 1792 (interactive) |
1793 (let ((begin nil) | |
73531
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
1794 (end nil) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
1795 (delend nil) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
1796 (paramlist nil) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
1797 (previous-syntax-table (syntax-table))) |
12039
a75524689022
(initial comments): Copyright 1995; don't speak
Karl Heuer <kwzh@gnu.org>
parents:
11869
diff
changeset
|
1798 (unwind-protect |
73531
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
1799 (progn |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
1800 (set-syntax-table ada-mode-symbol-syntax-table) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
1801 |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
1802 ;; check if really inside parameter list |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
1803 (or (ada-in-paramlist-p) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
1804 (error "Not in parameter list")) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
1805 |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
1806 ;; find start of current parameter-list |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
1807 (ada-search-ignore-string-comment |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
1808 (concat ada-subprog-start-re "\\|\\<body\\>" ) t nil) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
1809 (down-list 1) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
1810 (backward-char 1) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
1811 (setq begin (point)) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
1812 |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
1813 ;; find end of parameter-list |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
1814 (forward-sexp 1) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
1815 (setq delend (point)) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
1816 (delete-char -1) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
1817 (insert "\n") |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
1818 |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
1819 ;; find end of last parameter-declaration |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
1820 (forward-comment -1000) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
1821 (setq end (point)) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
1822 |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
1823 ;; build a list of all elements of the parameter-list |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
1824 (setq paramlist (ada-scan-paramlist (1+ begin) end)) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
1825 |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
1826 ;; delete the original parameter-list |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
1827 (delete-region begin delend) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
1828 |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
1829 ;; insert the new parameter-list |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
1830 (goto-char begin) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
1831 (ada-insert-paramlist paramlist)) |
12039
a75524689022
(initial comments): Copyright 1995; don't speak
Karl Heuer <kwzh@gnu.org>
parents:
11869
diff
changeset
|
1832 |
a75524689022
(initial comments): Copyright 1995; don't speak
Karl Heuer <kwzh@gnu.org>
parents:
11869
diff
changeset
|
1833 ;; restore syntax-table |
25903
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
1834 (set-syntax-table previous-syntax-table) |
12039
a75524689022
(initial comments): Copyright 1995; don't speak
Karl Heuer <kwzh@gnu.org>
parents:
11869
diff
changeset
|
1835 ))) |
10705 | 1836 |
1837 (defun ada-scan-paramlist (begin end) | |
26225
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
1838 "Scan the parameter list found in between BEGIN and END. |
63528
d6d50a511d12
(ada-format-paramlist)
Juanma Barranquero <lekktu@gmail.com>
parents:
63425
diff
changeset
|
1839 Return the equivalent internal parameter list." |
10705 | 1840 (let ((paramlist (list)) |
73531
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
1841 (param (list)) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
1842 (notend t) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
1843 (apos nil) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
1844 (epos nil) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
1845 (semipos nil) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
1846 (match-cons nil)) |
10705 | 1847 |
1848 (goto-char begin) | |
26225
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
1849 |
10705 | 1850 ;; loop until end of last parameter |
1851 (while notend | |
1852 | |
1853 ;; find first character of parameter-declaration | |
1854 (ada-goto-next-non-ws) | |
33716
c55ff055c68a
(ada-mode): `set '' -> `setq'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
32300
diff
changeset
|
1855 (setq apos (point)) |
10705 | 1856 |
1857 ;; find last character of parameter-declaration | |
33716
c55ff055c68a
(ada-mode): `set '' -> `setq'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
32300
diff
changeset
|
1858 (if (setq match-cons |
73531
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
1859 (ada-search-ignore-string-comment "[ \t\n]*;" nil end t)) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
1860 (progn |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
1861 (setq epos (car match-cons)) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
1862 (setq semipos (cdr match-cons))) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
1863 (setq epos end)) |
10705 | 1864 |
1865 ;; read name(s) of parameter(s) | |
1866 (goto-char apos) | |
25903
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
1867 (looking-at "\\(\\(\\sw\\|[_, \t\n]\\)*\\(\\sw\\|_\\)\\)[ \t\n]*:[^=]") |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
1868 |
33716
c55ff055c68a
(ada-mode): `set '' -> `setq'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
32300
diff
changeset
|
1869 (setq param (list (match-string 1))) |
25903
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
1870 (ada-search-ignore-string-comment ":" nil epos t 'search-forward) |
10705 | 1871 |
1872 ;; look for 'in' | |
33716
c55ff055c68a
(ada-mode): `set '' -> `setq'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
32300
diff
changeset
|
1873 (setq apos (point)) |
c55ff055c68a
(ada-mode): `set '' -> `setq'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
32300
diff
changeset
|
1874 (setq param |
73531
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
1875 (append param |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
1876 (list |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
1877 (consp |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
1878 (ada-search-ignore-string-comment |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
1879 "in" nil epos t 'word-search-forward))))) |
10705 | 1880 |
1881 ;; look for 'out' | |
1882 (goto-char apos) | |
33716
c55ff055c68a
(ada-mode): `set '' -> `setq'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
32300
diff
changeset
|
1883 (setq param |
73531
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
1884 (append param |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
1885 (list |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
1886 (consp |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
1887 (ada-search-ignore-string-comment |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
1888 "out" nil epos t 'word-search-forward))))) |
10705 | 1889 |
13231
fb78cec8e440
All doc strings changed to comply with standard Emacs conventions.
Richard M. Stallman <rms@gnu.org>
parents:
13160
diff
changeset
|
1890 ;; look for 'access' |
10705 | 1891 (goto-char apos) |
33716
c55ff055c68a
(ada-mode): `set '' -> `setq'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
32300
diff
changeset
|
1892 (setq param |
73531
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
1893 (append param |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
1894 (list |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
1895 (consp |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
1896 (ada-search-ignore-string-comment |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
1897 "access" nil epos t 'word-search-forward))))) |
10705 | 1898 |
13231
fb78cec8e440
All doc strings changed to comply with standard Emacs conventions.
Richard M. Stallman <rms@gnu.org>
parents:
13160
diff
changeset
|
1899 ;; skip 'in'/'out'/'access' |
10705 | 1900 (goto-char apos) |
1901 (ada-goto-next-non-ws) | |
13231
fb78cec8e440
All doc strings changed to comply with standard Emacs conventions.
Richard M. Stallman <rms@gnu.org>
parents:
13160
diff
changeset
|
1902 (while (looking-at "\\<\\(in\\|out\\|access\\)\\>") |
73531
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
1903 (forward-word 1) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
1904 (ada-goto-next-non-ws)) |
10705 | 1905 |
25903
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
1906 ;; read type of parameter |
30411
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
1907 ;; We accept spaces in the name, since some software like Rose |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
1908 ;; generates something like: "A : B 'Class" |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
1909 (looking-at "\\<\\(\\sw\\|[_.' \t]\\)+\\>") |
33716
c55ff055c68a
(ada-mode): `set '' -> `setq'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
32300
diff
changeset
|
1910 (setq param |
73531
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
1911 (append param |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
1912 (list (match-string 0)))) |
10705 | 1913 |
1914 ;; read default-expression, if there is one | |
33716
c55ff055c68a
(ada-mode): `set '' -> `setq'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
32300
diff
changeset
|
1915 (goto-char (setq apos (match-end 0))) |
c55ff055c68a
(ada-mode): `set '' -> `setq'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
32300
diff
changeset
|
1916 (setq param |
73531
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
1917 (append param |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
1918 (list |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
1919 (if (setq match-cons |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
1920 (ada-search-ignore-string-comment |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
1921 ":=" nil epos t 'search-forward)) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
1922 (buffer-substring (car match-cons) epos) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
1923 nil)))) |
26225
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
1924 |
10705 | 1925 ;; add this parameter-declaration to the list |
33716
c55ff055c68a
(ada-mode): `set '' -> `setq'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
32300
diff
changeset
|
1926 (setq paramlist (append paramlist (list param))) |
10705 | 1927 |
1928 ;; check if it was the last parameter | |
1929 (if (eq epos end) | |
73531
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
1930 (setq notend nil) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
1931 (goto-char semipos)) |
26225
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
1932 ) |
10705 | 1933 (reverse paramlist))) |
1934 | |
1935 (defun ada-insert-paramlist (paramlist) | |
63528
d6d50a511d12
(ada-format-paramlist)
Juanma Barranquero <lekktu@gmail.com>
parents:
63425
diff
changeset
|
1936 "Insert a formatted PARAMLIST in the buffer." |
10705 | 1937 (let ((i (length paramlist)) |
73531
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
1938 (parlen 0) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
1939 (typlen 0) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
1940 (inp nil) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
1941 (outp nil) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
1942 (accessp nil) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
1943 (column nil) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
1944 (firstcol nil)) |
10705 | 1945 |
1946 ;; loop until last parameter | |
1947 (while (not (zerop i)) | |
33716
c55ff055c68a
(ada-mode): `set '' -> `setq'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
32300
diff
changeset
|
1948 (setq i (1- i)) |
10705 | 1949 |
1950 ;; get max length of parameter-name | |
33716
c55ff055c68a
(ada-mode): `set '' -> `setq'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
32300
diff
changeset
|
1951 (setq parlen (max parlen (length (nth 0 (nth i paramlist))))) |
26225
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
1952 |
10705 | 1953 ;; get max length of type-name |
33716
c55ff055c68a
(ada-mode): `set '' -> `setq'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
32300
diff
changeset
|
1954 (setq typlen (max typlen (length (nth 4 (nth i paramlist))))) |
26225
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
1955 |
10705 | 1956 ;; is there any 'in' ? |
33716
c55ff055c68a
(ada-mode): `set '' -> `setq'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
32300
diff
changeset
|
1957 (setq inp (or inp (nth 1 (nth i paramlist)))) |
26225
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
1958 |
10705 | 1959 ;; is there any 'out' ? |
33716
c55ff055c68a
(ada-mode): `set '' -> `setq'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
32300
diff
changeset
|
1960 (setq outp (or outp (nth 2 (nth i paramlist)))) |
26225
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
1961 |
13231
fb78cec8e440
All doc strings changed to comply with standard Emacs conventions.
Richard M. Stallman <rms@gnu.org>
parents:
13160
diff
changeset
|
1962 ;; is there any 'access' ? |
33716
c55ff055c68a
(ada-mode): `set '' -> `setq'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
32300
diff
changeset
|
1963 (setq accessp (or accessp (nth 3 (nth i paramlist)))) |
26225
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
1964 ) |
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
1965 |
10705 | 1966 ;; does paramlist already start on a separate line ? |
1967 (if (save-excursion | |
73531
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
1968 (re-search-backward "^.\\|[^ \t]" nil t) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
1969 (looking-at "^.")) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
1970 ;; yes => re-indent it |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
1971 (progn |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
1972 (ada-indent-current) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
1973 (save-excursion |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
1974 (if (looking-at "\\(is\\|return\\)") |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
1975 (replace-match " \\1")))) |
26225
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
1976 |
25903
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
1977 ;; no => insert it where we are after removing any whitespace |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
1978 (fixup-whitespace) |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
1979 (save-excursion |
73531
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
1980 (cond |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
1981 ((looking-at "[ \t]*\\(\n\\|;\\)") |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
1982 (replace-match "\\1")) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
1983 ((looking-at "[ \t]*\\(is\\|return\\)") |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
1984 (replace-match " \\1")))) |
25903
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
1985 (insert " ")) |
10705 | 1986 |
1987 (insert "(") | |
25903
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
1988 (ada-indent-current) |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
1989 |
33716
c55ff055c68a
(ada-mode): `set '' -> `setq'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
32300
diff
changeset
|
1990 (setq firstcol (current-column)) |
c55ff055c68a
(ada-mode): `set '' -> `setq'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
32300
diff
changeset
|
1991 (setq i (length paramlist)) |
10705 | 1992 |
1993 ;; loop until last parameter | |
1994 (while (not (zerop i)) | |
33716
c55ff055c68a
(ada-mode): `set '' -> `setq'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
32300
diff
changeset
|
1995 (setq i (1- i)) |
c55ff055c68a
(ada-mode): `set '' -> `setq'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
32300
diff
changeset
|
1996 (setq column firstcol) |
10705 | 1997 |
1998 ;; insert parameter-name, space and colon | |
1999 (insert (nth 0 (nth i paramlist))) | |
2000 (indent-to (+ column parlen 1)) | |
2001 (insert ": ") | |
33716
c55ff055c68a
(ada-mode): `set '' -> `setq'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
32300
diff
changeset
|
2002 (setq column (current-column)) |
10705 | 2003 |
2004 ;; insert 'in' or space | |
2005 (if (nth 1 (nth i paramlist)) | |
73531
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
2006 (insert "in ") |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
2007 (if (and |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
2008 (or inp |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
2009 accessp) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
2010 (not (nth 3 (nth i paramlist)))) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
2011 (insert " "))) |
10705 | 2012 |
2013 ;; insert 'out' or space | |
2014 (if (nth 2 (nth i paramlist)) | |
73531
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
2015 (insert "out ") |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
2016 (if (and |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
2017 (or outp |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
2018 accessp) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
2019 (not (nth 3 (nth i paramlist)))) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
2020 (insert " "))) |
10705 | 2021 |
13231
fb78cec8e440
All doc strings changed to comply with standard Emacs conventions.
Richard M. Stallman <rms@gnu.org>
parents:
13160
diff
changeset
|
2022 ;; insert 'access' |
10705 | 2023 (if (nth 3 (nth i paramlist)) |
73531
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
2024 (insert "access ")) |
10705 | 2025 |
33716
c55ff055c68a
(ada-mode): `set '' -> `setq'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
32300
diff
changeset
|
2026 (setq column (current-column)) |
10705 | 2027 |
2028 ;; insert type-name and, if necessary, space and default-expression | |
2029 (insert (nth 4 (nth i paramlist))) | |
2030 (if (nth 5 (nth i paramlist)) | |
73531
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
2031 (progn |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
2032 (indent-to (+ column typlen 1)) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
2033 (insert (nth 5 (nth i paramlist))))) |
10705 | 2034 |
2035 ;; check if it was the last parameter | |
25903
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
2036 (if (zerop i) |
73531
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
2037 (insert ")") |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
2038 ;; no => insert ';' and newline and indent |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
2039 (insert ";") |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
2040 (newline) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
2041 (indent-to firstcol)) |
26225
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
2042 ) |
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
2043 |
25903
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
2044 ;; if anything follows, except semicolon, newline, is or return |
10705 | 2045 ;; put it in a new line and indent it |
25903
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
2046 (unless (looking-at "[ \t]*\\(;\\|\n\\|is\\|return\\)") |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
2047 (ada-indent-newline-indent)) |
10705 | 2048 )) |
2049 | |
2050 | |
2051 | |
26225
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
2052 ;;;---------------------------------------------------------------- |
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
2053 ;; Indentation Engine |
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
2054 ;; All indentations are indicated as a two-element string: |
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
2055 ;; - position of reference in the buffer |
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
2056 ;; - offset to indent from this position (can also be a symbol or a list |
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
2057 ;; that are evaluated) |
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
2058 ;; Thus the total indentation for a line is the column number of the reference |
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
2059 ;; position plus whatever value the evaluation of the second element provides. |
71537
2a4ed80e93ba
(ada-which-compiler, ada-mode-menu, ada-compile-mouse-goto-error,
Juanma Barranquero <lekktu@gmail.com>
parents:
68764
diff
changeset
|
2060 ;; This mechanism is used so that the Ada mode can "explain" how the |
26225
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
2061 ;; indentation was calculated, by showing which variables were used. |
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
2062 ;; |
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
2063 ;; The indentation itself is done in only one pass: first we try to guess in |
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
2064 ;; what context we are by looking at the following keyword or punctuation |
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
2065 ;; sign. If nothing remarkable is found, just try to guess the indentation |
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
2066 ;; based on previous lines. |
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
2067 ;; |
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
2068 ;; The relevant functions for indentation are: |
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
2069 ;; - `ada-indent-region': Re-indent a region of text |
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
2070 ;; - `ada-justified-indent-current': Re-indent the current line and shows the |
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
2071 ;; calculation that were done |
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
2072 ;; - `ada-indent-current': Re-indent the current line |
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
2073 ;; - `ada-get-current-indent': Calculate the indentation for the current line, |
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
2074 ;; based on the context (see above). |
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
2075 ;; - `ada-get-indent-*': Calculate the indentation in a specific context. |
30411
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
2076 ;; For efficiency, these functions do not check they are in the correct |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
2077 ;; context. |
26225
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
2078 ;;;---------------------------------------------------------------- |
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
2079 |
10705 | 2080 (defun ada-indent-region (beg end) |
30411
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
2081 "Indent the region between BEG end END." |
10705 | 2082 (interactive "*r") |
2083 (goto-char beg) | |
12039
a75524689022
(initial comments): Copyright 1995; don't speak
Karl Heuer <kwzh@gnu.org>
parents:
11869
diff
changeset
|
2084 (let ((block-done 0) |
73531
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
2085 (lines-remaining (count-lines beg end)) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
2086 (msg (format "%%4d out of %4d lines remaining ..." |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
2087 (count-lines beg end))) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
2088 (endmark (copy-marker end))) |
12039
a75524689022
(initial comments): Copyright 1995; don't speak
Karl Heuer <kwzh@gnu.org>
parents:
11869
diff
changeset
|
2089 ;; catch errors while indenting |
25903
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
2090 (while (< (point) endmark) |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
2091 (if (> block-done 39) |
73531
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
2092 (progn |
30411
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
2093 (setq lines-remaining (- lines-remaining block-done) |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
2094 block-done 0) |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
2095 (message msg lines-remaining))) |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
2096 (if (= (char-after) ?\n) nil |
73531
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
2097 (ada-indent-current)) |
25903
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
2098 (forward-line 1) |
30411
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
2099 (setq block-done (1+ block-done))) |
73422
e1bac685e6a0
(ada-83-string-keywords, ada-last-which-function-line ada-no-auto-case,
Juanma Barranquero <lekktu@gmail.com>
parents:
71924
diff
changeset
|
2100 (message "Indenting ... done"))) |
10705 | 2101 |
2102 (defun ada-indent-newline-indent () | |
63528
d6d50a511d12
(ada-format-paramlist)
Juanma Barranquero <lekktu@gmail.com>
parents:
63425
diff
changeset
|
2103 "Indent the current line, insert a newline and then indent the new line." |
10705 | 2104 (interactive "*") |
17914
e5e2ef0dd5ab
(ada-krunch-args): Use gnatkr instead of gnatk8.
Richard M. Stallman <rms@gnu.org>
parents:
14415
diff
changeset
|
2105 (ada-indent-current) |
e5e2ef0dd5ab
(ada-krunch-args): Use gnatkr instead of gnatk8.
Richard M. Stallman <rms@gnu.org>
parents:
14415
diff
changeset
|
2106 (newline) |
e5e2ef0dd5ab
(ada-krunch-args): Use gnatkr instead of gnatk8.
Richard M. Stallman <rms@gnu.org>
parents:
14415
diff
changeset
|
2107 (ada-indent-current)) |
10705 | 2108 |
25903
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
2109 (defun ada-indent-newline-indent-conditional () |
26225
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
2110 "Insert a newline and indent it. |
73531
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
2111 The original line is indented first if `ada-indent-after-return' is non-nil." |
25903
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
2112 (interactive "*") |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
2113 (if ada-indent-after-return (ada-indent-current)) |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
2114 (newline) |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
2115 (ada-indent-current)) |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
2116 |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
2117 (defun ada-justified-indent-current () |
63528
d6d50a511d12
(ada-format-paramlist)
Juanma Barranquero <lekktu@gmail.com>
parents:
63425
diff
changeset
|
2118 "Indent the current line and explain how the calculation was done." |
25903
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
2119 (interactive) |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
2120 |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
2121 (let ((cur-indent (ada-indent-current))) |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
2122 |
44465
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
2123 (let ((line (save-excursion |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
2124 (goto-char (car cur-indent)) |
45931
a4c8d672ccbe
* progmodes/ada-mode.el: Update copyright notice.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
44933
diff
changeset
|
2125 (count-lines 1 (point))))) |
44465
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
2126 |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
2127 (if (equal (cdr cur-indent) '(0)) |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
2128 (message (concat "same indentation as line " (number-to-string line))) |
65584
6dbba0bd58df
Message format fixes, commit no. 3
Deepak Goel <deego@gnufans.org>
parents:
65223
diff
changeset
|
2129 (message "%s" (mapconcat (lambda(x) |
6dbba0bd58df
Message format fixes, commit no. 3
Deepak Goel <deego@gnufans.org>
parents:
65223
diff
changeset
|
2130 (cond |
6dbba0bd58df
Message format fixes, commit no. 3
Deepak Goel <deego@gnufans.org>
parents:
65223
diff
changeset
|
2131 ((symbolp x) |
6dbba0bd58df
Message format fixes, commit no. 3
Deepak Goel <deego@gnufans.org>
parents:
65223
diff
changeset
|
2132 (symbol-name x)) |
6dbba0bd58df
Message format fixes, commit no. 3
Deepak Goel <deego@gnufans.org>
parents:
65223
diff
changeset
|
2133 ((numberp x) |
6dbba0bd58df
Message format fixes, commit no. 3
Deepak Goel <deego@gnufans.org>
parents:
65223
diff
changeset
|
2134 (number-to-string x)) |
6dbba0bd58df
Message format fixes, commit no. 3
Deepak Goel <deego@gnufans.org>
parents:
65223
diff
changeset
|
2135 ((listp x) |
6dbba0bd58df
Message format fixes, commit no. 3
Deepak Goel <deego@gnufans.org>
parents:
65223
diff
changeset
|
2136 (concat "- " (symbol-name (cadr x)))) |
6dbba0bd58df
Message format fixes, commit no. 3
Deepak Goel <deego@gnufans.org>
parents:
65223
diff
changeset
|
2137 )) |
6dbba0bd58df
Message format fixes, commit no. 3
Deepak Goel <deego@gnufans.org>
parents:
65223
diff
changeset
|
2138 (cdr cur-indent) |
6dbba0bd58df
Message format fixes, commit no. 3
Deepak Goel <deego@gnufans.org>
parents:
65223
diff
changeset
|
2139 " + ")))) |
25903
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
2140 (save-excursion |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
2141 (goto-char (car cur-indent)) |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
2142 (sit-for 1)))) |
10705 | 2143 |
30411
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
2144 (defun ada-batch-reformat () |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
2145 "Re-indent and re-case all the files found on the command line. |
97078
2f3e251c6e3c
Typo fixes for Ada mode.
Juanma Barranquero <lekktu@gmail.com>
parents:
97058
diff
changeset
|
2146 This function should be used from the command line, with a |
30411
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
2147 command like: |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
2148 emacs -batch -l ada-mode -f ada-batch-reformat file1 file2 ..." |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
2149 |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
2150 (while command-line-args-left |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
2151 (let ((source (car command-line-args-left))) |
65584
6dbba0bd58df
Message format fixes, commit no. 3
Deepak Goel <deego@gnufans.org>
parents:
65223
diff
changeset
|
2152 (message "Formating %s" source) |
30411
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
2153 (find-file source) |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
2154 (ada-indent-region (point-min) (point-max)) |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
2155 (ada-adjust-case-buffer) |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
2156 (write-file source)) |
33716
c55ff055c68a
(ada-mode): `set '' -> `setq'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
32300
diff
changeset
|
2157 (setq command-line-args-left (cdr command-line-args-left))) |
30411
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
2158 (message "Done") |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
2159 (kill-emacs 0)) |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
2160 |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
2161 (defsubst ada-goto-previous-word () |
63528
d6d50a511d12
(ada-format-paramlist)
Juanma Barranquero <lekktu@gmail.com>
parents:
63425
diff
changeset
|
2162 "Move point to the beginning of the previous word of Ada code. |
d6d50a511d12
(ada-format-paramlist)
Juanma Barranquero <lekktu@gmail.com>
parents:
63425
diff
changeset
|
2163 Return the new position of point or nil if not found." |
30411
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
2164 (ada-goto-next-word t)) |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
2165 |
10705 | 2166 (defun ada-indent-current () |
26225
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
2167 "Indent current line as Ada code. |
97078
2f3e251c6e3c
Typo fixes for Ada mode.
Juanma Barranquero <lekktu@gmail.com>
parents:
97058
diff
changeset
|
2168 Return the calculation that was done, including the reference point |
2f3e251c6e3c
Typo fixes for Ada mode.
Juanma Barranquero <lekktu@gmail.com>
parents:
97058
diff
changeset
|
2169 and the offset." |
10705 | 2170 (interactive) |
25903
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
2171 (let ((previous-syntax-table (syntax-table)) |
73531
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
2172 (orgpoint (point-marker)) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
2173 cur-indent tmp-indent |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
2174 prev-indent) |
25903
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
2175 |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
2176 (unwind-protect |
73531
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
2177 (progn |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
2178 (set-syntax-table ada-mode-symbol-syntax-table) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
2179 |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
2180 ;; This need to be done here so that the advice is not always |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
2181 ;; activated (this might interact badly with other modes) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
2182 (if (featurep 'xemacs) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
2183 (ad-activate 'parse-partial-sexp t)) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
2184 |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
2185 (save-excursion |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
2186 (setq cur-indent |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
2187 |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
2188 ;; Not First line in the buffer ? |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
2189 (if (save-excursion (zerop (forward-line -1))) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
2190 (progn |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
2191 (back-to-indentation) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
2192 (ada-get-current-indent)) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
2193 |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
2194 ;; first line in the buffer |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
2195 (list (point-min) 0)))) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
2196 |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
2197 ;; Evaluate the list to get the column to indent to |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
2198 ;; prev-indent contains the column to indent to |
30411
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
2199 (if cur-indent |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
2200 (setq prev-indent (save-excursion (goto-char (car cur-indent)) |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
2201 (current-column)) |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
2202 tmp-indent (cdr cur-indent)) |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
2203 (setq prev-indent 0 tmp-indent '())) |
33786
9f63b158eb6b
* simple.el (delete-trailing-whitespace): New interactive function.
Sam Steingold <sds@gnu.org>
parents:
33716
diff
changeset
|
2204 |
73531
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
2205 (while (not (null tmp-indent)) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
2206 (cond |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
2207 ((numberp (car tmp-indent)) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
2208 (setq prev-indent (+ prev-indent (car tmp-indent)))) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
2209 (t |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
2210 (setq prev-indent (+ prev-indent (eval (car tmp-indent))))) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
2211 ) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
2212 (setq tmp-indent (cdr tmp-indent))) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
2213 |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
2214 ;; only re-indent if indentation is different then the current |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
2215 (if (= (save-excursion (back-to-indentation) (current-column)) prev-indent) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
2216 nil |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
2217 (beginning-of-line) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
2218 (delete-horizontal-space) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
2219 (indent-to prev-indent)) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
2220 ;; |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
2221 ;; restore position of point |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
2222 ;; |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
2223 (goto-char orgpoint) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
2224 (if (< (current-column) (current-indentation)) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
2225 (back-to-indentation))) |
30411
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
2226 |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
2227 ;; restore syntax-table |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
2228 (set-syntax-table previous-syntax-table) |
50812
15929fed5553
(ada-xemacs): Variable removed, since it's better to use (featurep 'xemacs).
Juanma Barranquero <lekktu@gmail.com>
parents:
50736
diff
changeset
|
2229 (if (featurep 'xemacs) |
73531
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
2230 (ad-deactivate 'parse-partial-sexp)) |
30411
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
2231 ) |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
2232 |
25903
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
2233 cur-indent |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
2234 )) |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
2235 |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
2236 (defun ada-get-current-indent () |
30411
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
2237 "Return the indentation to use for the current line." |
25903
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
2238 (let (column |
73531
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
2239 pos |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
2240 match-cons |
30411
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
2241 result |
73531
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
2242 (orgpoint (save-excursion |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
2243 (beginning-of-line) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
2244 (forward-comment -10000) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
2245 (forward-line 1) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
2246 (point)))) |
30411
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
2247 |
33716
c55ff055c68a
(ada-mode): `set '' -> `setq'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
32300
diff
changeset
|
2248 (setq result |
10705 | 2249 (cond |
30411
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
2250 |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
2251 ;;----------------------------- |
10705 | 2252 ;; in open parenthesis, but not in parameter-list |
30411
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
2253 ;;----------------------------- |
33786
9f63b158eb6b
* simple.el (delete-trailing-whitespace): New interactive function.
Sam Steingold <sds@gnu.org>
parents:
33716
diff
changeset
|
2254 |
30411
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
2255 ((and ada-indent-to-open-paren |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
2256 (not (ada-in-paramlist-p)) |
33716
c55ff055c68a
(ada-mode): `set '' -> `setq'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
32300
diff
changeset
|
2257 (setq column (ada-in-open-paren-p))) |
33786
9f63b158eb6b
* simple.el (delete-trailing-whitespace): New interactive function.
Sam Steingold <sds@gnu.org>
parents:
33716
diff
changeset
|
2258 |
10705 | 2259 ;; check if we have something like this (Table_Component_Type => |
25903
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
2260 ;; Source_File_Record) |
10705 | 2261 (save-excursion |
44465
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
2262 |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
2263 ;; Align the closing parenthesis on the opening one |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
2264 (if (= (following-char) ?\)) |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
2265 (save-excursion |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
2266 (goto-char column) |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
2267 (skip-chars-backward " \t") |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
2268 (list (1- (point)) 0)) |
49598
0d8b17d428b5
Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
45931
diff
changeset
|
2269 |
44465
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
2270 (if (and (skip-chars-backward " \t") |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
2271 (= (char-before) ?\n) |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
2272 (not (forward-comment -10000)) |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
2273 (= (char-before) ?>)) |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
2274 ;; ??? Could use a different variable |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
2275 (list column 'ada-broken-indent) |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
2276 |
45931
a4c8d672ccbe
* progmodes/ada-mode.el: Update copyright notice.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
44933
diff
changeset
|
2277 ;; We want all continuation lines to be indented the same |
a4c8d672ccbe
* progmodes/ada-mode.el: Update copyright notice.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
44933
diff
changeset
|
2278 ;; (ada-broken-line from the opening parenthesis. However, in |
a4c8d672ccbe
* progmodes/ada-mode.el: Update copyright notice.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
44933
diff
changeset
|
2279 ;; parameter list, each new parameter should be indented at the |
a4c8d672ccbe
* progmodes/ada-mode.el: Update copyright notice.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
44933
diff
changeset
|
2280 ;; column as the opening parenthesis. |
a4c8d672ccbe
* progmodes/ada-mode.el: Update copyright notice.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
44933
diff
changeset
|
2281 |
a4c8d672ccbe
* progmodes/ada-mode.el: Update copyright notice.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
44933
diff
changeset
|
2282 ;; A special case to handle nested boolean expressions, as in |
a4c8d672ccbe
* progmodes/ada-mode.el: Update copyright notice.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
44933
diff
changeset
|
2283 ;; ((B |
a4c8d672ccbe
* progmodes/ada-mode.el: Update copyright notice.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
44933
diff
changeset
|
2284 ;; and then C) -- indented by ada-broken-indent |
a4c8d672ccbe
* progmodes/ada-mode.el: Update copyright notice.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
44933
diff
changeset
|
2285 ;; or else D) -- indenting this line. |
a4c8d672ccbe
* progmodes/ada-mode.el: Update copyright notice.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
44933
diff
changeset
|
2286 ;; ??? This is really a hack, we should have a proper way to go to |
a4c8d672ccbe
* progmodes/ada-mode.el: Update copyright notice.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
44933
diff
changeset
|
2287 ;; ??? the beginning of the statement |
49598
0d8b17d428b5
Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
45931
diff
changeset
|
2288 |
45931
a4c8d672ccbe
* progmodes/ada-mode.el: Update copyright notice.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
44933
diff
changeset
|
2289 (if (= (char-before) ?\)) |
a4c8d672ccbe
* progmodes/ada-mode.el: Update copyright notice.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
44933
diff
changeset
|
2290 (backward-sexp)) |
49598
0d8b17d428b5
Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
45931
diff
changeset
|
2291 |
45931
a4c8d672ccbe
* progmodes/ada-mode.el: Update copyright notice.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
44933
diff
changeset
|
2292 (if (memq (char-before) '(?, ?\; ?\( ?\))) |
a4c8d672ccbe
* progmodes/ada-mode.el: Update copyright notice.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
44933
diff
changeset
|
2293 (list column 0) |
a4c8d672ccbe
* progmodes/ada-mode.el: Update copyright notice.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
44933
diff
changeset
|
2294 (list column 'ada-continuation-indent) |
a4c8d672ccbe
* progmodes/ada-mode.el: Update copyright notice.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
44933
diff
changeset
|
2295 ))))) |
30411
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
2296 |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
2297 ;;--------------------------- |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
2298 ;; at end of buffer |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
2299 ;;--------------------------- |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
2300 |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
2301 ((not (char-after)) |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
2302 (ada-indent-on-previous-lines nil orgpoint orgpoint)) |
33786
9f63b158eb6b
* simple.el (delete-trailing-whitespace): New interactive function.
Sam Steingold <sds@gnu.org>
parents:
33716
diff
changeset
|
2303 |
30411
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
2304 ;;--------------------------- |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
2305 ;; starting with e |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
2306 ;;--------------------------- |
33786
9f63b158eb6b
* simple.el (delete-trailing-whitespace): New interactive function.
Sam Steingold <sds@gnu.org>
parents:
33716
diff
changeset
|
2307 |
44465
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
2308 ((= (downcase (char-after)) ?e) |
30411
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
2309 (cond |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
2310 |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
2311 ;; ------- end ------ |
33786
9f63b158eb6b
* simple.el (delete-trailing-whitespace): New interactive function.
Sam Steingold <sds@gnu.org>
parents:
33716
diff
changeset
|
2312 |
30411
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
2313 ((looking-at "end\\>") |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
2314 (let ((label 0) |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
2315 limit) |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
2316 (save-excursion |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
2317 (ada-goto-matching-start 1) |
33786
9f63b158eb6b
* simple.el (delete-trailing-whitespace): New interactive function.
Sam Steingold <sds@gnu.org>
parents:
33716
diff
changeset
|
2318 |
30411
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
2319 ;; |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
2320 ;; found 'loop' => skip back to 'while' or 'for' |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
2321 ;; if 'loop' is not on a separate line |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
2322 ;; Stop the search for 'while' and 'for' when a ';' is encountered. |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
2323 ;; |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
2324 (if (save-excursion |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
2325 (beginning-of-line) |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
2326 (looking-at ".+\\<loop\\>")) |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
2327 (progn |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
2328 (save-excursion |
33716
c55ff055c68a
(ada-mode): `set '' -> `setq'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
32300
diff
changeset
|
2329 (setq limit (car (ada-search-ignore-string-comment ";" t)))) |
30411
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
2330 (if (save-excursion |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
2331 (and |
33716
c55ff055c68a
(ada-mode): `set '' -> `setq'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
32300
diff
changeset
|
2332 (setq match-cons |
30411
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
2333 (ada-search-ignore-string-comment ada-loop-start-re t limit)) |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
2334 (not (looking-at "\\<loop\\>")))) |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
2335 (progn |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
2336 (goto-char (car match-cons)) |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
2337 (save-excursion |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
2338 (beginning-of-line) |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
2339 (if (looking-at ada-named-block-re) |
33716
c55ff055c68a
(ada-mode): `set '' -> `setq'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
32300
diff
changeset
|
2340 (setq label (- ada-label-indent)))))))) |
49598
0d8b17d428b5
Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
45931
diff
changeset
|
2341 |
44465
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
2342 ;; found 'record' => |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
2343 ;; if the keyword is found at the beginning of a line (or just |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
2344 ;; after limited, we indent on it, otherwise we indent on the |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
2345 ;; beginning of the type declaration) |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
2346 ;; type A is (B : Integer; |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
2347 ;; C : Integer) is record |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
2348 ;; end record; -- This is badly indented otherwise |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
2349 (if (looking-at "record") |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
2350 (if (save-excursion |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
2351 (beginning-of-line) |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
2352 (looking-at "^[ \t]*\\(record\\|limited record\\)")) |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
2353 (list (save-excursion (back-to-indentation) (point)) 0) |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
2354 (list (save-excursion |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
2355 (car (ada-search-ignore-string-comment "\\<type\\>" t))) |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
2356 0)) |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
2357 |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
2358 ;; Else keep the same indentation as the beginning statement |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
2359 (list (+ (save-excursion (back-to-indentation) (point)) label) 0))))) |
30411
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
2360 |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
2361 ;; ------ exception ---- |
33786
9f63b158eb6b
* simple.el (delete-trailing-whitespace): New interactive function.
Sam Steingold <sds@gnu.org>
parents:
33716
diff
changeset
|
2362 |
30411
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
2363 ((looking-at "exception\\>") |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
2364 (save-excursion |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
2365 (ada-goto-matching-start 1) |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
2366 (list (save-excursion (back-to-indentation) (point)) 0))) |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
2367 |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
2368 ;; else |
33786
9f63b158eb6b
* simple.el (delete-trailing-whitespace): New interactive function.
Sam Steingold <sds@gnu.org>
parents:
33716
diff
changeset
|
2369 |
30411
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
2370 ((looking-at "else\\>") |
73434
3586ad4a01a1
(ada-in-string-p): Doc fix.
Juanma Barranquero <lekktu@gmail.com>
parents:
73422
diff
changeset
|
2371 (if (save-excursion (ada-goto-previous-word) |
73531
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
2372 (looking-at "\\<or\\>")) |
30411
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
2373 (ada-indent-on-previous-lines nil orgpoint orgpoint) |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
2374 (save-excursion |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
2375 (ada-goto-matching-start 1 nil t) |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
2376 (list (progn (back-to-indentation) (point)) 0)))) |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
2377 |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
2378 ;; elsif |
49598
0d8b17d428b5
Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
45931
diff
changeset
|
2379 |
30411
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
2380 ((looking-at "elsif\\>") |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
2381 (save-excursion |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
2382 (ada-goto-matching-start 1 nil t) |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
2383 (list (progn (back-to-indentation) (point)) 0))) |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
2384 |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
2385 )) |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
2386 |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
2387 ;;--------------------------- |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
2388 ;; starting with w (when) |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
2389 ;;--------------------------- |
49598
0d8b17d428b5
Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
45931
diff
changeset
|
2390 |
44465
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
2391 ((and (= (downcase (char-after)) ?w) |
30411
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
2392 (looking-at "when\\>")) |
10705 | 2393 (save-excursion |
30411
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
2394 (ada-goto-matching-start 1) |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
2395 (list (save-excursion (back-to-indentation) (point)) |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
2396 'ada-when-indent))) |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
2397 |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
2398 ;;--------------------------- |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
2399 ;; starting with t (then) |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
2400 ;;--------------------------- |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
2401 |
44465
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
2402 ((and (= (downcase (char-after)) ?t) |
30411
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
2403 (looking-at "then\\>")) |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
2404 (if (save-excursion (ada-goto-previous-word) |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
2405 (looking-at "and\\>")) |
25903
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
2406 (ada-indent-on-previous-lines nil orgpoint orgpoint) |
30411
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
2407 (save-excursion |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
2408 ;; Select has been added for the statement: "select ... then abort" |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
2409 (ada-search-ignore-string-comment |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
2410 "\\<\\(elsif\\|if\\|select\\)\\>" t nil) |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
2411 (list (progn (back-to-indentation) (point)) |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
2412 'ada-stmt-end-indent)))) |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
2413 |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
2414 ;;--------------------------- |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
2415 ;; starting with l (loop) |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
2416 ;;--------------------------- |
49598
0d8b17d428b5
Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
45931
diff
changeset
|
2417 |
44465
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
2418 ((and (= (downcase (char-after)) ?l) |
30411
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
2419 (looking-at "loop\\>")) |
33716
c55ff055c68a
(ada-mode): `set '' -> `setq'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
32300
diff
changeset
|
2420 (setq pos (point)) |
10705 | 2421 (save-excursion |
73531
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
2422 (goto-char (match-end 0)) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
2423 (ada-goto-stmt-start) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
2424 (if (looking-at "\\<\\(loop\\|if\\)\\>") |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
2425 (ada-indent-on-previous-lines nil orgpoint orgpoint) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
2426 (unless (looking-at ada-loop-start-re) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
2427 (ada-search-ignore-string-comment ada-loop-start-re |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
2428 nil pos)) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
2429 (if (looking-at "\\<loop\\>") |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
2430 (ada-indent-on-previous-lines nil orgpoint orgpoint) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
2431 (list (progn (back-to-indentation) (point)) 'ada-stmt-end-indent))))) |
30411
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
2432 |
44465
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
2433 ;;---------------------------- |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
2434 ;; starting with l (limited) or r (record) |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
2435 ;;---------------------------- |
49598
0d8b17d428b5
Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
45931
diff
changeset
|
2436 |
44465
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
2437 ((or (and (= (downcase (char-after)) ?l) |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
2438 (looking-at "limited\\>")) |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
2439 (and (= (downcase (char-after)) ?r) |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
2440 (looking-at "record\\>"))) |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
2441 |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
2442 (save-excursion |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
2443 (ada-search-ignore-string-comment |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
2444 "\\<\\(type\\|use\\)\\>" t nil) |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
2445 (if (looking-at "\\<use\\>") |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
2446 (ada-search-ignore-string-comment "for" t nil nil |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
2447 'word-search-backward)) |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
2448 (list (progn (back-to-indentation) (point)) |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
2449 'ada-indent-record-rel-type))) |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
2450 |
30411
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
2451 ;;--------------------------- |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
2452 ;; starting with b (begin) |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
2453 ;;--------------------------- |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
2454 |
44465
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
2455 ((and (= (downcase (char-after)) ?b) |
30411
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
2456 (looking-at "begin\\>")) |
10705 | 2457 (save-excursion |
73531
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
2458 (if (ada-goto-matching-decl-start t) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
2459 (list (progn (back-to-indentation) (point)) 0) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
2460 (ada-indent-on-previous-lines nil orgpoint orgpoint)))) |
30411
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
2461 |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
2462 ;;--------------------------- |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
2463 ;; starting with i (is) |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
2464 ;;--------------------------- |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
2465 |
44465
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
2466 ((and (= (downcase (char-after)) ?i) |
30411
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
2467 (looking-at "is\\>")) |
33786
9f63b158eb6b
* simple.el (delete-trailing-whitespace): New interactive function.
Sam Steingold <sds@gnu.org>
parents:
33716
diff
changeset
|
2468 |
25903
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
2469 (if (and ada-indent-is-separate |
73531
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
2470 (save-excursion |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
2471 (goto-char (match-end 0)) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
2472 (ada-goto-next-non-ws (save-excursion (end-of-line) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
2473 (point))) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
2474 (looking-at "\\<abstract\\>\\|\\<separate\\>"))) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
2475 (save-excursion |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
2476 (ada-goto-stmt-start) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
2477 (list (progn (back-to-indentation) (point)) 'ada-indent)) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
2478 (save-excursion |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
2479 (ada-goto-stmt-start) |
106830
4ff0e607507d
* progmodes/ada-mode.el: Deal with Ada 2005 "overriding" keyword.
Juanma Barranquero <lekktu@gmail.com>
parents:
106829
diff
changeset
|
2480 (if (looking-at "\\<overriding\\|package\\|procedure\\|function\\>") |
45931
a4c8d672ccbe
* progmodes/ada-mode.el: Update copyright notice.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
44933
diff
changeset
|
2481 (list (progn (back-to-indentation) (point)) 0) |
a4c8d672ccbe
* progmodes/ada-mode.el: Update copyright notice.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
44933
diff
changeset
|
2482 (list (progn (back-to-indentation) (point)) 'ada-indent))))) |
30411
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
2483 |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
2484 ;;--------------------------- |
44465
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
2485 ;; starting with r (return, renames) |
30411
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
2486 ;;--------------------------- |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
2487 |
44465
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
2488 ((and (= (downcase (char-after)) ?r) |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
2489 (looking-at "re\\(turn\\|names\\)\\>")) |
49598
0d8b17d428b5
Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
45931
diff
changeset
|
2490 |
44465
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
2491 (save-excursion |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
2492 (let ((var 'ada-indent-return)) |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
2493 ;; If looking at a renames, skip the 'return' statement too |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
2494 (if (looking-at "renames") |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
2495 (let (pos) |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
2496 (save-excursion |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
2497 (set 'pos (ada-search-ignore-string-comment ";\\|return\\>" t))) |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
2498 (if (and pos |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
2499 (= (downcase (char-after (car pos))) ?r)) |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
2500 (goto-char (car pos))) |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
2501 (set 'var 'ada-indent-renames))) |
49598
0d8b17d428b5
Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
45931
diff
changeset
|
2502 |
44465
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
2503 (forward-comment -1000) |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
2504 (if (= (char-before) ?\)) |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
2505 (forward-sexp -1) |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
2506 (forward-word -1)) |
49598
0d8b17d428b5
Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
45931
diff
changeset
|
2507 |
44465
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
2508 ;; If there is a parameter list, and we have a function declaration |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
2509 ;; or a access to subprogram declaration |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
2510 (let ((num-back 1)) |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
2511 (if (and (= (following-char) ?\() |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
2512 (save-excursion |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
2513 (or (progn |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
2514 (backward-word 1) |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
2515 (looking-at "\\(function\\|procedure\\)\\>")) |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
2516 (progn |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
2517 (backward-word 1) |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
2518 (set 'num-back 2) |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
2519 (looking-at "\\(function\\|procedure\\)\\>"))))) |
49598
0d8b17d428b5
Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
45931
diff
changeset
|
2520 |
44465
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
2521 ;; The indentation depends of the value of ada-indent-return |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
2522 (if (<= (eval var) 0) |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
2523 (list (point) (list '- var)) |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
2524 (list (progn (backward-word num-back) (point)) |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
2525 var)) |
49598
0d8b17d428b5
Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
45931
diff
changeset
|
2526 |
44465
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
2527 ;; Else there is no parameter list, but we have a function |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
2528 ;; Only do something special if the user want to indent |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
2529 ;; relative to the "function" keyword |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
2530 (if (and (> (eval var) 0) |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
2531 (save-excursion (forward-word -1) |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
2532 (looking-at "function\\>"))) |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
2533 (list (progn (forward-word -1) (point)) var) |
49598
0d8b17d428b5
Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
45931
diff
changeset
|
2534 |
44465
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
2535 ;; Else... |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
2536 (ada-indent-on-previous-lines nil orgpoint orgpoint))))))) |
49598
0d8b17d428b5
Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
45931
diff
changeset
|
2537 |
30411
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
2538 ;;-------------------------------- |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
2539 ;; starting with 'o' or 'p' |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
2540 ;; 'or' as statement-start |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
2541 ;; 'private' as statement-start |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
2542 ;;-------------------------------- |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
2543 |
44465
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
2544 ((and (or (= (downcase (char-after)) ?o) |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
2545 (= (downcase (char-after)) ?p)) |
30411
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
2546 (or (ada-looking-at-semi-or) |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
2547 (ada-looking-at-semi-private))) |
10705 | 2548 (save-excursion |
44465
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
2549 ;; ??? Wasn't this done already in ada-looking-at-semi-or ? |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
2550 (ada-goto-matching-start 1) |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
2551 (list (progn (back-to-indentation) (point)) 0))) |
30411
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
2552 |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
2553 ;;-------------------------------- |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
2554 ;; starting with 'd' (do) |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
2555 ;;-------------------------------- |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
2556 |
44465
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
2557 ((and (= (downcase (char-after)) ?d) |
30411
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
2558 (looking-at "do\\>")) |
10705 | 2559 (save-excursion |
73531
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
2560 (ada-goto-stmt-start) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
2561 (list (progn (back-to-indentation) (point)) 'ada-stmt-end-indent))) |
30411
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
2562 |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
2563 ;;-------------------------------- |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
2564 ;; starting with '-' (comment) |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
2565 ;;-------------------------------- |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
2566 |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
2567 ((= (char-after) ?-) |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
2568 (if ada-indent-comment-as-code |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
2569 |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
2570 ;; Indent comments on previous line comments if required |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
2571 ;; We must use a search-forward (even if the code is more complex), |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
2572 ;; since we want to find the beginning of the comment. |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
2573 (let (pos) |
33786
9f63b158eb6b
* simple.el (delete-trailing-whitespace): New interactive function.
Sam Steingold <sds@gnu.org>
parents:
33716
diff
changeset
|
2574 |
30411
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
2575 (if (and ada-indent-align-comments |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
2576 (save-excursion |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
2577 (forward-line -1) |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
2578 (beginning-of-line) |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
2579 (while (and (not pos) |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
2580 (search-forward "--" |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
2581 (save-excursion |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
2582 (end-of-line) (point)) |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
2583 t)) |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
2584 (unless (ada-in-string-p) |
33716
c55ff055c68a
(ada-mode): `set '' -> `setq'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
32300
diff
changeset
|
2585 (setq pos (point)))) |
30411
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
2586 pos)) |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
2587 (list (- pos 2) 0) |
33786
9f63b158eb6b
* simple.el (delete-trailing-whitespace): New interactive function.
Sam Steingold <sds@gnu.org>
parents:
33716
diff
changeset
|
2588 |
30411
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
2589 ;; Else always on previous line |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
2590 (ada-indent-on-previous-lines nil orgpoint orgpoint))) |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
2591 |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
2592 ;; Else same indentation as the previous line |
73531
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
2593 (list (save-excursion (back-to-indentation) (point)) 0))) |
30411
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
2594 |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
2595 ;;-------------------------------- |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
2596 ;; starting with '#' (preprocessor line) |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
2597 ;;-------------------------------- |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
2598 |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
2599 ((and (= (char-after) ?#) |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
2600 (equal ada-which-compiler 'gnat) |
73531
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
2601 (looking-at "#[ \t]*\\(if\\|els\\(e\\|if\\)\\|end[ \t]*if\\)")) |
30411
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
2602 (list (save-excursion (beginning-of-line) (point)) 0)) |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
2603 |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
2604 ;;-------------------------------- |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
2605 ;; starting with ')' (end of a parameter list) |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
2606 ;;-------------------------------- |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
2607 |
25903
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
2608 ((and (not (eobp)) (= (char-after) ?\))) |
10705 | 2609 (save-excursion |
73531
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
2610 (forward-char 1) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
2611 (backward-sexp 1) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
2612 (list (point) 0))) |
30411
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
2613 |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
2614 ;;--------------------------------- |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
2615 ;; new/abstract/separate |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
2616 ;;--------------------------------- |
33786
9f63b158eb6b
* simple.el (delete-trailing-whitespace): New interactive function.
Sam Steingold <sds@gnu.org>
parents:
33716
diff
changeset
|
2617 |
30411
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
2618 ((looking-at "\\(new\\|abstract\\|separate\\)\\>") |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
2619 (ada-indent-on-previous-lines nil orgpoint orgpoint)) |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
2620 |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
2621 ;;--------------------------------- |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
2622 ;; package/function/procedure |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
2623 ;;--------------------------------- |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
2624 |
44465
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
2625 ((and (or (= (downcase (char-after)) ?p) (= (downcase (char-after)) ?f)) |
30411
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
2626 (looking-at "\\<\\(package\\|function\\|procedure\\)\\>")) |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
2627 (save-excursion |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
2628 ;; Go up until we find either a generic section, or the end of the |
106830
4ff0e607507d
* progmodes/ada-mode.el: Deal with Ada 2005 "overriding" keyword.
Juanma Barranquero <lekktu@gmail.com>
parents:
106829
diff
changeset
|
2629 ;; previous subprogram/package, or 'overriding' for this function/procedure |
30411
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
2630 (let (found) |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
2631 (while (and (not found) |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
2632 (ada-search-ignore-string-comment |
106830
4ff0e607507d
* progmodes/ada-mode.el: Deal with Ada 2005 "overriding" keyword.
Juanma Barranquero <lekktu@gmail.com>
parents:
106829
diff
changeset
|
2633 "\\<\\(generic\\|end\\|begin\\|overriding\\|package\\|procedure\\|function\\)\\>" t)) |
33786
9f63b158eb6b
* simple.el (delete-trailing-whitespace): New interactive function.
Sam Steingold <sds@gnu.org>
parents:
33716
diff
changeset
|
2634 |
30411
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
2635 ;; avoid "with procedure"... in generic parts |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
2636 (save-excursion |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
2637 (forward-word -1) |
33716
c55ff055c68a
(ada-mode): `set '' -> `setq'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
32300
diff
changeset
|
2638 (setq found (not (looking-at "with")))))) |
33786
9f63b158eb6b
* simple.el (delete-trailing-whitespace): New interactive function.
Sam Steingold <sds@gnu.org>
parents:
33716
diff
changeset
|
2639 |
106830
4ff0e607507d
* progmodes/ada-mode.el: Deal with Ada 2005 "overriding" keyword.
Juanma Barranquero <lekktu@gmail.com>
parents:
106829
diff
changeset
|
2640 (cond |
4ff0e607507d
* progmodes/ada-mode.el: Deal with Ada 2005 "overriding" keyword.
Juanma Barranquero <lekktu@gmail.com>
parents:
106829
diff
changeset
|
2641 ((looking-at "\\<generic\\|overriding\\>") |
4ff0e607507d
* progmodes/ada-mode.el: Deal with Ada 2005 "overriding" keyword.
Juanma Barranquero <lekktu@gmail.com>
parents:
106829
diff
changeset
|
2642 (list (progn (back-to-indentation) (point)) 0)) |
4ff0e607507d
* progmodes/ada-mode.el: Deal with Ada 2005 "overriding" keyword.
Juanma Barranquero <lekktu@gmail.com>
parents:
106829
diff
changeset
|
2643 |
4ff0e607507d
* progmodes/ada-mode.el: Deal with Ada 2005 "overriding" keyword.
Juanma Barranquero <lekktu@gmail.com>
parents:
106829
diff
changeset
|
2644 (t |
4ff0e607507d
* progmodes/ada-mode.el: Deal with Ada 2005 "overriding" keyword.
Juanma Barranquero <lekktu@gmail.com>
parents:
106829
diff
changeset
|
2645 (ada-indent-on-previous-lines nil orgpoint orgpoint))))) |
33786
9f63b158eb6b
* simple.el (delete-trailing-whitespace): New interactive function.
Sam Steingold <sds@gnu.org>
parents:
33716
diff
changeset
|
2646 |
30411
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
2647 ;;--------------------------------- |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
2648 ;; label |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
2649 ;;--------------------------------- |
33786
9f63b158eb6b
* simple.el (delete-trailing-whitespace): New interactive function.
Sam Steingold <sds@gnu.org>
parents:
33716
diff
changeset
|
2650 |
30411
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
2651 ((looking-at "\\(\\sw\\|_\\)+[ \t\n]*:[^=]") |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
2652 (if (ada-in-decl-p) |
73531
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
2653 (ada-indent-on-previous-lines nil orgpoint orgpoint) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
2654 (append (ada-indent-on-previous-lines nil orgpoint orgpoint) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
2655 '(ada-label-indent)))) |
30411
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
2656 |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
2657 )) |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
2658 |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
2659 ;;--------------------------------- |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
2660 ;; Other syntaxes |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
2661 ;;--------------------------------- |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
2662 (or result (ada-indent-on-previous-lines nil orgpoint orgpoint)))) |
25903
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
2663 |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
2664 (defun ada-indent-on-previous-lines (&optional nomove orgpoint initial-pos) |
26225
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
2665 "Calculate the indentation for the new line after ORGPOINT. |
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
2666 The result list is based on the previous lines in the buffer. |
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
2667 If NOMOVE is nil, moves point to the beginning of the current statement. |
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
2668 if INITIAL-POS is non-nil, moves point to INITIAL-POS before calculation." |
25903
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
2669 (if initial-pos |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
2670 (goto-char initial-pos)) |
30411
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
2671 (let ((oldpoint (point))) |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
2672 |
25903
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
2673 ;; Is inside a parameter-list ? |
10705 | 2674 (if (ada-in-paramlist-p) |
73531
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
2675 (ada-get-indent-paramlist) |
30411
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
2676 |
25903
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
2677 ;; move to beginning of current statement |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
2678 (unless nomove |
73531
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
2679 (ada-goto-stmt-start)) |
25903
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
2680 |
30411
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
2681 ;; no beginning found => don't change indentation |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
2682 (if (and (eq oldpoint (point)) |
73531
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
2683 (not nomove)) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
2684 (ada-get-indent-nochange) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
2685 |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
2686 (cond |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
2687 ;; |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
2688 ((and |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
2689 ada-indent-to-open-paren |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
2690 (ada-in-open-paren-p)) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
2691 (ada-get-indent-open-paren)) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
2692 ;; |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
2693 ((looking-at "end\\>") |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
2694 (ada-get-indent-end orgpoint)) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
2695 ;; |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
2696 ((looking-at ada-loop-start-re) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
2697 (ada-get-indent-loop orgpoint)) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
2698 ;; |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
2699 ((looking-at ada-subprog-start-re) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
2700 (ada-get-indent-subprog orgpoint)) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
2701 ;; |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
2702 ((looking-at ada-block-start-re) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
2703 (ada-get-indent-block-start orgpoint)) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
2704 ;; |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
2705 ((looking-at "\\(sub\\)?type\\>") |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
2706 (ada-get-indent-type orgpoint)) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
2707 ;; |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
2708 ;; "then" has to be included in the case of "select...then abort" |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
2709 ;; statements, since (goto-stmt-start) at the beginning of |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
2710 ;; the current function would leave the cursor on that position |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
2711 ((looking-at "\\(\\(els\\)?if\\>\\)\\|then abort\\\>") |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
2712 (ada-get-indent-if orgpoint)) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
2713 ;; |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
2714 ((looking-at "case\\>") |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
2715 (ada-get-indent-case orgpoint)) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
2716 ;; |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
2717 ((looking-at "when\\>") |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
2718 (ada-get-indent-when orgpoint)) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
2719 ;; |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
2720 ((looking-at "\\(\\sw\\|_\\)+[ \t\n]*:[^=]") |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
2721 (ada-get-indent-label orgpoint)) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
2722 ;; |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
2723 ((looking-at "separate\\>") |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
2724 (ada-get-indent-nochange)) |
45931
a4c8d672ccbe
* progmodes/ada-mode.el: Update copyright notice.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
44933
diff
changeset
|
2725 |
a4c8d672ccbe
* progmodes/ada-mode.el: Update copyright notice.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
44933
diff
changeset
|
2726 ;; A label |
a4c8d672ccbe
* progmodes/ada-mode.el: Update copyright notice.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
44933
diff
changeset
|
2727 ((looking-at "<<") |
73531
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
2728 (list (+ (save-excursion (back-to-indentation) (point)) |
45931
a4c8d672ccbe
* progmodes/ada-mode.el: Update copyright notice.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
44933
diff
changeset
|
2729 (- ada-label-indent)))) |
49598
0d8b17d428b5
Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
45931
diff
changeset
|
2730 |
30411
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
2731 ;; |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
2732 ((looking-at "with\\>\\|use\\>") |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
2733 ;; Are we still in that statement, or are we in fact looking at |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
2734 ;; the previous one ? |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
2735 (if (save-excursion (search-forward ";" oldpoint t)) |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
2736 (list (progn (back-to-indentation) (point)) 0) |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
2737 (list (point) (if (looking-at "with") |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
2738 'ada-with-indent |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
2739 'ada-use-indent)))) |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
2740 ;; |
73531
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
2741 (t |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
2742 (ada-get-indent-noindent orgpoint))))) |
30411
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
2743 )) |
10705 | 2744 |
26225
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
2745 (defun ada-get-indent-open-paren () |
63528
d6d50a511d12
(ada-format-paramlist)
Juanma Barranquero <lekktu@gmail.com>
parents:
63425
diff
changeset
|
2746 "Calculate the indentation when point is behind an unclosed parenthesis." |
25903
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
2747 (list (ada-in-open-paren-p) 0)) |
10705 | 2748 |
26225
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
2749 (defun ada-get-indent-nochange () |
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
2750 "Return the current indentation of the previous line." |
10705 | 2751 (save-excursion |
2752 (forward-line -1) | |
26225
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
2753 (back-to-indentation) |
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
2754 (list (point) 0))) |
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
2755 |
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
2756 (defun ada-get-indent-paramlist () |
63528
d6d50a511d12
(ada-format-paramlist)
Juanma Barranquero <lekktu@gmail.com>
parents:
63425
diff
changeset
|
2757 "Calculate the indentation when point is inside a parameter list." |
10705 | 2758 (save-excursion |
2759 (ada-search-ignore-string-comment "[^ \t\n]" t nil t) | |
2760 (cond | |
2761 ;; in front of the first parameter | |
25903
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
2762 ((= (char-after) ?\() |
10705 | 2763 (goto-char (match-end 0)) |
25903
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
2764 (list (point) 0)) |
26225
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
2765 |
10705 | 2766 ;; in front of another parameter |
25903
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
2767 ((= (char-after) ?\;) |
10705 | 2768 (goto-char (cdr (ada-search-ignore-string-comment "(\\|;" t nil t))) |
2769 (ada-goto-next-non-ws) | |
25903
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
2770 (list (point) 0)) |
26225
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
2771 |
44465
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
2772 ;; After an affectation (default parameter value in subprogram |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
2773 ;; declaration) |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
2774 ((and (= (following-char) ?=) (= (preceding-char) ?:)) |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
2775 (back-to-indentation) |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
2776 (list (point) 'ada-broken-indent)) |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
2777 |
10705 | 2778 ;; inside a parameter declaration |
2779 (t | |
2780 (goto-char (cdr (ada-search-ignore-string-comment "(\\|;" t nil t))) | |
2781 (ada-goto-next-non-ws) | |
100891
e7407b3eef86
* progmodes/ada-mode.el (ada-mode): Simplify doc string.
Juanma Barranquero <lekktu@gmail.com>
parents:
98674
diff
changeset
|
2782 (list (point) 'ada-broken-indent))))) |
25903
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
2783 |
26225
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
2784 (defun ada-get-indent-end (orgpoint) |
63528
d6d50a511d12
(ada-format-paramlist)
Juanma Barranquero <lekktu@gmail.com>
parents:
63425
diff
changeset
|
2785 "Calculate the indentation when point is just before an end statement. |
26225
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
2786 ORGPOINT is the limit position used in the calculation." |
10705 | 2787 (let ((defun-name nil) |
73531
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
2788 (indent nil)) |
30411
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
2789 |
10705 | 2790 ;; is the line already terminated by ';' ? |
2791 (if (save-excursion | |
73531
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
2792 (ada-search-ignore-string-comment ";" nil orgpoint nil |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
2793 'search-forward)) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
2794 |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
2795 ;; yes, look what's following 'end' |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
2796 (progn |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
2797 (forward-word 1) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
2798 (ada-goto-next-non-ws) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
2799 (cond |
98674
bde81f3667cd
* progmodes/ada-mode.el (ada-get-indent-end, ada-goto-matching-start):
Juanma Barranquero <lekktu@gmail.com>
parents:
97078
diff
changeset
|
2800 ;; |
bde81f3667cd
* progmodes/ada-mode.el (ada-get-indent-end, ada-goto-matching-start):
Juanma Barranquero <lekktu@gmail.com>
parents:
97078
diff
changeset
|
2801 ;; loop/select/if/case/return |
bde81f3667cd
* progmodes/ada-mode.el (ada-get-indent-end, ada-goto-matching-start):
Juanma Barranquero <lekktu@gmail.com>
parents:
97078
diff
changeset
|
2802 ;; |
bde81f3667cd
* progmodes/ada-mode.el (ada-get-indent-end, ada-goto-matching-start):
Juanma Barranquero <lekktu@gmail.com>
parents:
97078
diff
changeset
|
2803 ((looking-at "\\<\\(loop\\|select\\|if\\|case\\|return\\)\\>") |
73531
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
2804 (save-excursion (ada-check-matching-start (match-string 0))) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
2805 (list (save-excursion (back-to-indentation) (point)) 0)) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
2806 |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
2807 ;; |
98674
bde81f3667cd
* progmodes/ada-mode.el (ada-get-indent-end, ada-goto-matching-start):
Juanma Barranquero <lekktu@gmail.com>
parents:
97078
diff
changeset
|
2808 ;; record |
73531
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
2809 ;; |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
2810 ((looking-at "\\<record\\>") |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
2811 (save-excursion |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
2812 (ada-check-matching-start (match-string 0)) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
2813 ;; we are now looking at the matching "record" statement |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
2814 (forward-word 1) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
2815 (ada-goto-stmt-start) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
2816 ;; now on the matching type declaration, or use clause |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
2817 (unless (looking-at "\\(for\\|type\\)\\>") |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
2818 (ada-search-ignore-string-comment "\\<type\\>" t)) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
2819 (list (progn (back-to-indentation) (point)) 0))) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
2820 ;; |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
2821 ;; a named block end |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
2822 ;; |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
2823 ((looking-at ada-ident-re) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
2824 (setq defun-name (match-string 0)) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
2825 (save-excursion |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
2826 (ada-goto-matching-start 0) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
2827 (ada-check-defun-name defun-name)) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
2828 (list (progn (back-to-indentation) (point)) 0)) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
2829 ;; |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
2830 ;; a block-end without name |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
2831 ;; |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
2832 ((= (char-after) ?\;) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
2833 (save-excursion |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
2834 (ada-goto-matching-start 0) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
2835 (if (looking-at "\\<begin\\>") |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
2836 (progn |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
2837 (setq indent (list (point) 0)) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
2838 (if (ada-goto-matching-decl-start t) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
2839 (list (progn (back-to-indentation) (point)) 0) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
2840 indent)) |
44465
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
2841 (list (progn (back-to-indentation) (point)) 0) |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
2842 ))) |
73531
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
2843 ;; |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
2844 ;; anything else - should maybe signal an error ? |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
2845 ;; |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
2846 (t |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
2847 (list (save-excursion (back-to-indentation) (point)) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
2848 'ada-broken-indent)))) |
26225
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
2849 |
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
2850 (list (save-excursion (back-to-indentation) (point)) |
73531
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
2851 'ada-broken-indent)))) |
10705 | 2852 |
2853 (defun ada-get-indent-case (orgpoint) | |
63528
d6d50a511d12
(ada-format-paramlist)
Juanma Barranquero <lekktu@gmail.com>
parents:
63425
diff
changeset
|
2854 "Calculate the indentation when point is just before a case statement. |
26225
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
2855 ORGPOINT is the limit position used in the calculation." |
25903
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
2856 (let ((match-cons nil) |
73531
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
2857 (opos (point))) |
10705 | 2858 (cond |
2859 ;; | |
2860 ;; case..is..when..=> | |
2861 ;; | |
2862 ((save-excursion | |
73531
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
2863 (setq match-cons (and |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
2864 ;; the `=>' must be after the keyword `is'. |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
2865 (ada-search-ignore-string-comment |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
2866 "is" nil orgpoint nil 'word-search-forward) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
2867 (ada-search-ignore-string-comment |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
2868 "[ \t\n]+=>" nil orgpoint)))) |
10705 | 2869 (save-excursion |
73531
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
2870 (goto-char (car match-cons)) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
2871 (unless (ada-search-ignore-string-comment "when" t opos) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
2872 (error "Missing 'when' between 'case' and '=>'")) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
2873 (list (save-excursion (back-to-indentation) (point)) 'ada-indent))) |
10705 | 2874 ;; |
2875 ;; case..is..when | |
2876 ;; | |
2877 ((save-excursion | |
73531
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
2878 (setq match-cons (ada-search-ignore-string-comment |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
2879 "when" nil orgpoint nil 'word-search-forward))) |
10705 | 2880 (goto-char (cdr match-cons)) |
25903
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
2881 (list (save-excursion (back-to-indentation) (point)) 'ada-broken-indent)) |
10705 | 2882 ;; |
2883 ;; case..is | |
2884 ;; | |
2885 ((save-excursion | |
73531
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
2886 (setq match-cons (ada-search-ignore-string-comment |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
2887 "is" nil orgpoint nil 'word-search-forward))) |
25903
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
2888 (list (save-excursion (back-to-indentation) (point)) 'ada-when-indent)) |
10705 | 2889 ;; |
2890 ;; incomplete case | |
2891 ;; | |
2892 (t | |
26225
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
2893 (list (save-excursion (back-to-indentation) (point)) |
73531
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
2894 'ada-broken-indent))))) |
10705 | 2895 |
2896 (defun ada-get-indent-when (orgpoint) | |
63528
d6d50a511d12
(ada-format-paramlist)
Juanma Barranquero <lekktu@gmail.com>
parents:
63425
diff
changeset
|
2897 "Calculate the indentation when point is just before a when statement. |
26225
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
2898 ORGPOINT is the limit position used in the calculation." |
25903
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
2899 (let ((cur-indent (save-excursion (back-to-indentation) (point)))) |
26225
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
2900 (if (ada-search-ignore-string-comment "[ \t\n]*=>" nil orgpoint) |
73531
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
2901 (list cur-indent 'ada-indent) |
25903
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
2902 (list cur-indent 'ada-broken-indent)))) |
10705 | 2903 |
2904 (defun ada-get-indent-if (orgpoint) | |
63528
d6d50a511d12
(ada-format-paramlist)
Juanma Barranquero <lekktu@gmail.com>
parents:
63425
diff
changeset
|
2905 "Calculate the indentation when point is just before an if statement. |
26225
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
2906 ORGPOINT is the limit position used in the calculation." |
25903
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
2907 (let ((cur-indent (save-excursion (back-to-indentation) (point))) |
73531
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
2908 (match-cons nil)) |
10705 | 2909 ;; |
25903
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
2910 ;; Move to the correct then (ignore all "and then") |
10705 | 2911 ;; |
33716
c55ff055c68a
(ada-mode): `set '' -> `setq'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
32300
diff
changeset
|
2912 (while (and (setq match-cons (ada-search-ignore-string-comment |
73531
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
2913 "\\<\\(then\\|and[ \t]*then\\)\\>" |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
2914 nil orgpoint)) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
2915 (= (downcase (char-after (car match-cons))) ?a))) |
25903
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
2916 ;; If "then" was found (we are looking at it) |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
2917 (if match-cons |
73531
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
2918 (progn |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
2919 ;; |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
2920 ;; 'then' first in separate line ? |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
2921 ;; => indent according to 'then', |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
2922 ;; => else indent according to 'if' |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
2923 ;; |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
2924 (if (save-excursion |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
2925 (back-to-indentation) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
2926 (looking-at "\\<then\\>")) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
2927 (setq cur-indent (save-excursion (back-to-indentation) (point)))) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
2928 ;; skip 'then' |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
2929 (forward-word 1) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
2930 (list cur-indent 'ada-indent)) |
25903
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
2931 |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
2932 (list cur-indent 'ada-broken-indent)))) |
10705 | 2933 |
2934 (defun ada-get-indent-block-start (orgpoint) | |
63528
d6d50a511d12
(ada-format-paramlist)
Juanma Barranquero <lekktu@gmail.com>
parents:
63425
diff
changeset
|
2935 "Calculate the indentation when point is at the start of a block. |
26225
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
2936 ORGPOINT is the limit position used in the calculation." |
25903
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
2937 (let ((pos nil)) |
10705 | 2938 (cond |
2939 ((save-excursion | |
73531
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
2940 (forward-word 1) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
2941 (setq pos (ada-goto-next-non-ws orgpoint))) |
10705 | 2942 (goto-char pos) |
2943 (save-excursion | |
73531
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
2944 (ada-indent-on-previous-lines t orgpoint))) |
26225
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
2945 |
44465
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
2946 ;; Special case for record types, for instance for: |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
2947 ;; type A is (B : Integer; |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
2948 ;; C : Integer) is record |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
2949 ;; null; -- This is badly indented otherwise |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
2950 ((looking-at "record") |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
2951 |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
2952 ;; If record is at the beginning of the line, indent from there |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
2953 (if (save-excursion |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
2954 (beginning-of-line) |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
2955 (looking-at "^[ \t]*\\(record\\|limited record\\)")) |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
2956 (list (save-excursion (back-to-indentation) (point)) 'ada-indent) |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
2957 |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
2958 ;; else indent relative to the type command |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
2959 (list (save-excursion |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
2960 (car (ada-search-ignore-string-comment "\\<type\\>" t))) |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
2961 'ada-indent))) |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
2962 |
10705 | 2963 ;; nothing follows the block-start |
2964 (t | |
25903
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
2965 (list (save-excursion (back-to-indentation) (point)) 'ada-indent))))) |
10705 | 2966 |
2967 (defun ada-get-indent-subprog (orgpoint) | |
63528
d6d50a511d12
(ada-format-paramlist)
Juanma Barranquero <lekktu@gmail.com>
parents:
63425
diff
changeset
|
2968 "Calculate the indentation when point is just before a subprogram. |
26225
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
2969 ORGPOINT is the limit position used in the calculation." |
10705 | 2970 (let ((match-cons nil) |
73531
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
2971 (cur-indent (save-excursion (back-to-indentation) (point))) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
2972 (foundis nil)) |
10705 | 2973 ;; |
2974 ;; is there an 'is' in front of point ? | |
2975 ;; | |
2976 (if (save-excursion | |
73531
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
2977 (setq match-cons |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
2978 (ada-search-ignore-string-comment |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
2979 "\\<\\(is\\|do\\)\\>" nil orgpoint))) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
2980 ;; |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
2981 ;; yes, then skip to its end |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
2982 ;; |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
2983 (progn |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
2984 (setq foundis t) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
2985 (goto-char (cdr match-cons))) |
10705 | 2986 ;; |
2987 ;; no, then goto next non-ws, if there is one in front of point | |
2988 ;; | |
2989 (progn | |
73531
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
2990 (unless (ada-goto-next-non-ws orgpoint) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
2991 (goto-char orgpoint)))) |
10705 | 2992 |
2993 (cond | |
2994 ;; | |
2995 ;; nothing follows 'is' | |
2996 ;; | |
2997 ((and | |
2998 foundis | |
2999 (save-excursion | |
73531
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3000 (not (ada-search-ignore-string-comment |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3001 "[^ \t\n]" nil orgpoint t)))) |
25903
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
3002 (list cur-indent 'ada-indent)) |
10705 | 3003 ;; |
3004 ;; is abstract/separate/new ... | |
3005 ;; | |
3006 ((and | |
3007 foundis | |
3008 (save-excursion | |
73531
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3009 (setq match-cons |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3010 (ada-search-ignore-string-comment |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3011 "\\<\\(separate\\|new\\|abstract\\)\\>" |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3012 nil orgpoint)))) |
10705 | 3013 (goto-char (car match-cons)) |
12586
f8bbc7a3b87a
(ada-ident-re): Doc fix.
Richard M. Stallman <rms@gnu.org>
parents:
12053
diff
changeset
|
3014 (ada-search-ignore-string-comment ada-subprog-start-re t) |
10705 | 3015 (ada-get-indent-noindent orgpoint)) |
3016 ;; | |
3017 ;; something follows 'is' | |
3018 ;; | |
3019 ((and | |
3020 foundis | |
33716
c55ff055c68a
(ada-mode): `set '' -> `setq'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
32300
diff
changeset
|
3021 (save-excursion (setq match-cons (ada-goto-next-non-ws orgpoint))) |
25903
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
3022 (goto-char match-cons) |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
3023 (ada-indent-on-previous-lines t orgpoint))) |
10705 | 3024 ;; |
3025 ;; no 'is' but ';' | |
3026 ;; | |
3027 ((save-excursion | |
73531
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3028 (ada-search-ignore-string-comment ";" nil orgpoint nil 'search-forward)) |
25903
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
3029 (list cur-indent 0)) |
10705 | 3030 ;; |
3031 ;; no 'is' or ';' | |
3032 ;; | |
3033 (t | |
25903
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
3034 (list cur-indent 'ada-broken-indent))))) |
10705 | 3035 |
3036 (defun ada-get-indent-noindent (orgpoint) | |
63528
d6d50a511d12
(ada-format-paramlist)
Juanma Barranquero <lekktu@gmail.com>
parents:
63425
diff
changeset
|
3037 "Calculate the indentation when point is just before a 'noindent stmt'. |
26225
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
3038 ORGPOINT is the limit position used in the calculation." |
17914
e5e2ef0dd5ab
(ada-krunch-args): Use gnatkr instead of gnatk8.
Richard M. Stallman <rms@gnu.org>
parents:
14415
diff
changeset
|
3039 (let ((label 0)) |
e5e2ef0dd5ab
(ada-krunch-args): Use gnatkr instead of gnatk8.
Richard M. Stallman <rms@gnu.org>
parents:
14415
diff
changeset
|
3040 (save-excursion |
e5e2ef0dd5ab
(ada-krunch-args): Use gnatkr instead of gnatk8.
Richard M. Stallman <rms@gnu.org>
parents:
14415
diff
changeset
|
3041 (beginning-of-line) |
25903
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
3042 |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
3043 (cond |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
3044 |
30411
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
3045 ;; This one is called when indenting a line preceded by a multi-line |
25903
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
3046 ;; subprogram declaration (in that case, we are at this point inside |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
3047 ;; the parameter declaration list) |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
3048 ((ada-in-paramlist-p) |
73531
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3049 (ada-previous-procedure) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3050 (list (save-excursion (back-to-indentation) (point)) 0)) |
25903
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
3051 |
26225
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
3052 ;; This one is called when indenting the second line of a multi-line |
25903
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
3053 ;; declaration section, in a declare block or a record declaration |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
3054 ((looking-at "[ \t]*\\(\\sw\\|_\\)*[ \t]*,[ \t]*$") |
73531
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3055 (list (save-excursion (back-to-indentation) (point)) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3056 'ada-broken-decl-indent)) |
25903
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
3057 |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
3058 ;; This one is called in every over case when indenting a line at the |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
3059 ;; top level |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
3060 (t |
73531
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3061 (if (looking-at ada-named-block-re) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3062 (setq label (- ada-label-indent)) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3063 |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3064 (let (p) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3065 |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3066 ;; "with private" or "null record" cases |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3067 (if (or (save-excursion |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3068 (and (ada-search-ignore-string-comment "\\<private\\>" nil orgpoint) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3069 (setq p (point)) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3070 (save-excursion (forward-char -7);; skip back "private" |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3071 (ada-goto-previous-word) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3072 (looking-at "with")))) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3073 (save-excursion |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3074 (and (ada-search-ignore-string-comment "\\<record\\>" nil orgpoint) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3075 (setq p (point)) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3076 (save-excursion (forward-char -6);; skip back "record" |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3077 (ada-goto-previous-word) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3078 (looking-at "null"))))) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3079 (progn |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3080 (goto-char p) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3081 (re-search-backward "\\<\\(type\\|subtype\\)\\>" nil t) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3082 (list (save-excursion (back-to-indentation) (point)) 0))))) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3083 (if (save-excursion |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3084 (ada-search-ignore-string-comment ";" nil orgpoint nil |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3085 'search-forward)) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3086 (list (+ (save-excursion (back-to-indentation) (point)) label) 0) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3087 (list (+ (save-excursion (back-to-indentation) (point)) label) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3088 'ada-broken-indent))))))) |
10705 | 3089 |
3090 (defun ada-get-indent-label (orgpoint) | |
63528
d6d50a511d12
(ada-format-paramlist)
Juanma Barranquero <lekktu@gmail.com>
parents:
63425
diff
changeset
|
3091 "Calculate the indentation when before a label or variable declaration. |
26225
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
3092 ORGPOINT is the limit position used in the calculation." |
10705 | 3093 (let ((match-cons nil) |
73531
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3094 (cur-indent (save-excursion (back-to-indentation) (point)))) |
25903
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
3095 (ada-search-ignore-string-comment ":" nil) |
10705 | 3096 (cond |
3097 ;; loop label | |
3098 ((save-excursion | |
73531
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3099 (setq match-cons (ada-search-ignore-string-comment |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3100 ada-loop-start-re nil orgpoint))) |
10705 | 3101 (goto-char (car match-cons)) |
3102 (ada-get-indent-loop orgpoint)) | |
25903
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
3103 |
10705 | 3104 ;; declare label |
3105 ((save-excursion | |
73531
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3106 (setq match-cons (ada-search-ignore-string-comment |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3107 "\\<declare\\|begin\\>" nil orgpoint))) |
25903
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
3108 (goto-char (car match-cons)) |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
3109 (list (save-excursion (back-to-indentation) (point)) 'ada-indent)) |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
3110 |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
3111 ;; variable declaration |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
3112 ((ada-in-decl-p) |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
3113 (if (save-excursion |
73531
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3114 (ada-search-ignore-string-comment ";" nil orgpoint)) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3115 (list cur-indent 0) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3116 (list cur-indent 'ada-broken-indent))) |
25903
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
3117 |
10705 | 3118 ;; nothing follows colon |
3119 (t | |
25903
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
3120 (list cur-indent '(- ada-label-indent)))))) |
10705 | 3121 |
3122 (defun ada-get-indent-loop (orgpoint) | |
63528
d6d50a511d12
(ada-format-paramlist)
Juanma Barranquero <lekktu@gmail.com>
parents:
63425
diff
changeset
|
3123 "Calculate the indentation when just before a loop or a for ... use. |
26225
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
3124 ORGPOINT is the limit position used in the calculation." |
10705 | 3125 (let ((match-cons nil) |
73531
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3126 (pos (point)) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3127 |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3128 ;; If looking at a named block, skip the label |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3129 (label (save-excursion |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3130 (beginning-of-line) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3131 (if (looking-at ada-named-block-re) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3132 (- ada-label-indent) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3133 0)))) |
25903
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
3134 |
10705 | 3135 (cond |
3136 | |
3137 ;; | |
3138 ;; statement complete | |
3139 ;; | |
3140 ((save-excursion | |
73531
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3141 (ada-search-ignore-string-comment ";" nil orgpoint nil |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3142 'search-forward)) |
25903
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
3143 (list (+ (save-excursion (back-to-indentation) (point)) label) 0)) |
10705 | 3144 ;; |
3145 ;; simple loop | |
3146 ;; | |
3147 ((looking-at "loop\\>") | |
33716
c55ff055c68a
(ada-mode): `set '' -> `setq'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
32300
diff
changeset
|
3148 (setq pos (ada-get-indent-block-start orgpoint)) |
25903
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
3149 (if (equal label 0) |
73531
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3150 pos |
100891
e7407b3eef86
* progmodes/ada-mode.el (ada-mode): Simplify doc string.
Juanma Barranquero <lekktu@gmail.com>
parents:
98674
diff
changeset
|
3151 (list (+ (car pos) label) (cadr pos)))) |
10705 | 3152 |
3153 ;; | |
3154 ;; 'for'- loop (or also a for ... use statement) | |
3155 ;; | |
3156 ((looking-at "for\\>") | |
3157 (cond | |
3158 ;; | |
3159 ;; for ... use | |
3160 ;; | |
3161 ((save-excursion | |
73531
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3162 (and |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3163 (goto-char (match-end 0)) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3164 (ada-goto-next-non-ws orgpoint) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3165 (forward-word 1) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3166 (if (= (char-after) ?') (forward-word 1) t) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3167 (ada-goto-next-non-ws orgpoint) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3168 (looking-at "\\<use\\>") |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3169 ;; |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3170 ;; check if there is a 'record' before point |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3171 ;; |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3172 (progn |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3173 (setq match-cons (ada-search-ignore-string-comment |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3174 "record" nil orgpoint nil 'word-search-forward)) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3175 t))) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3176 (if match-cons |
50736
b0ce71ab9c28
(ada-search-directories): Take into account ADA_INCLUDE_PATH for better
Juanma Barranquero <lekktu@gmail.com>
parents:
49598
diff
changeset
|
3177 (progn |
b0ce71ab9c28
(ada-search-directories): Take into account ADA_INCLUDE_PATH for better
Juanma Barranquero <lekktu@gmail.com>
parents:
49598
diff
changeset
|
3178 (goto-char (car match-cons)) |
b0ce71ab9c28
(ada-search-directories): Take into account ADA_INCLUDE_PATH for better
Juanma Barranquero <lekktu@gmail.com>
parents:
49598
diff
changeset
|
3179 (list (save-excursion (back-to-indentation) (point)) 'ada-indent)) |
b0ce71ab9c28
(ada-search-directories): Take into account ADA_INCLUDE_PATH for better
Juanma Barranquero <lekktu@gmail.com>
parents:
49598
diff
changeset
|
3180 (list (save-excursion (back-to-indentation) (point)) 'ada-broken-indent)) |
b0ce71ab9c28
(ada-search-directories): Take into account ADA_INCLUDE_PATH for better
Juanma Barranquero <lekktu@gmail.com>
parents:
49598
diff
changeset
|
3181 ) |
b0ce71ab9c28
(ada-search-directories): Take into account ADA_INCLUDE_PATH for better
Juanma Barranquero <lekktu@gmail.com>
parents:
49598
diff
changeset
|
3182 |
10705 | 3183 ;; |
3184 ;; for..loop | |
3185 ;; | |
3186 ((save-excursion | |
73531
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3187 (setq match-cons (ada-search-ignore-string-comment |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3188 "loop" nil orgpoint nil 'word-search-forward))) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3189 (goto-char (car match-cons)) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3190 ;; |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3191 ;; indent according to 'loop', if it's first in the line; |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3192 ;; otherwise to 'for' |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3193 ;; |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3194 (unless (save-excursion |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3195 (back-to-indentation) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3196 (looking-at "\\<loop\\>")) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3197 (goto-char pos)) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3198 (list (+ (save-excursion (back-to-indentation) (point)) label) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3199 'ada-indent)) |
10705 | 3200 ;; |
3201 ;; for-statement is broken | |
3202 ;; | |
3203 (t | |
73531
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3204 (list (+ (save-excursion (back-to-indentation) (point)) label) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3205 'ada-broken-indent)))) |
10705 | 3206 |
3207 ;; | |
3208 ;; 'while'-loop | |
3209 ;; | |
3210 ((looking-at "while\\>") | |
3211 ;; | |
3212 ;; while..loop ? | |
3213 ;; | |
3214 (if (save-excursion | |
73531
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3215 (setq match-cons (ada-search-ignore-string-comment |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3216 "loop" nil orgpoint nil 'word-search-forward))) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3217 |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3218 (progn |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3219 (goto-char (car match-cons)) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3220 ;; |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3221 ;; indent according to 'loop', if it's first in the line; |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3222 ;; otherwise to 'while'. |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3223 ;; |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3224 (unless (save-excursion |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3225 (back-to-indentation) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3226 (looking-at "\\<loop\\>")) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3227 (goto-char pos)) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3228 (list (+ (save-excursion (back-to-indentation) (point)) label) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3229 'ada-indent)) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3230 |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3231 (list (+ (save-excursion (back-to-indentation) (point)) label) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3232 'ada-broken-indent)))))) |
10705 | 3233 |
3234 (defun ada-get-indent-type (orgpoint) | |
63528
d6d50a511d12
(ada-format-paramlist)
Juanma Barranquero <lekktu@gmail.com>
parents:
63425
diff
changeset
|
3235 "Calculate the indentation when before a type statement. |
26225
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
3236 ORGPOINT is the limit position used in the calculation." |
10705 | 3237 (let ((match-dat nil)) |
3238 (cond | |
3239 ;; | |
3240 ;; complete record declaration | |
3241 ;; | |
3242 ((save-excursion | |
73531
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3243 (and |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3244 (setq match-dat (ada-search-ignore-string-comment |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3245 "end" nil orgpoint nil 'word-search-forward)) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3246 (ada-goto-next-non-ws) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3247 (looking-at "\\<record\\>") |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3248 (forward-word 1) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3249 (ada-goto-next-non-ws) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3250 (= (char-after) ?\;))) |
10705 | 3251 (goto-char (car match-dat)) |
25903
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
3252 (list (save-excursion (back-to-indentation) (point)) 0)) |
10705 | 3253 ;; |
3254 ;; record type | |
3255 ;; | |
3256 ((save-excursion | |
73531
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3257 (setq match-dat (ada-search-ignore-string-comment |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3258 "record" nil orgpoint nil 'word-search-forward))) |
10705 | 3259 (goto-char (car match-dat)) |
25903
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
3260 (list (save-excursion (back-to-indentation) (point)) 'ada-indent)) |
10705 | 3261 ;; |
3262 ;; complete type declaration | |
3263 ;; | |
3264 ((save-excursion | |
73531
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3265 (ada-search-ignore-string-comment ";" nil orgpoint nil |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3266 'search-forward)) |
25903
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
3267 (list (save-excursion (back-to-indentation) (point)) 0)) |
10705 | 3268 ;; |
12039
a75524689022
(initial comments): Copyright 1995; don't speak
Karl Heuer <kwzh@gnu.org>
parents:
11869
diff
changeset
|
3269 ;; "type ... is", but not "type ... is ...", which is broken |
10705 | 3270 ;; |
3271 ((save-excursion | |
73531
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3272 (and |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3273 (ada-search-ignore-string-comment "is" nil orgpoint nil |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3274 'word-search-forward) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3275 (not (ada-goto-next-non-ws orgpoint)))) |
25903
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
3276 (list (save-excursion (back-to-indentation) (point)) 'ada-broken-indent)) |
10705 | 3277 ;; |
3278 ;; broken statement | |
3279 ;; | |
3280 (t | |
26225
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
3281 (list (save-excursion (back-to-indentation) (point)) |
73531
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3282 'ada-broken-indent))))) |
10705 | 3283 |
3284 | |
26225
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
3285 ;; ----------------------------------------------------------- |
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
3286 ;; -- searching and matching |
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
3287 ;; ----------------------------------------------------------- |
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
3288 |
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
3289 (defun ada-goto-stmt-start () |
63528
d6d50a511d12
(ada-format-paramlist)
Juanma Barranquero <lekktu@gmail.com>
parents:
63425
diff
changeset
|
3290 "Move point to the beginning of the statement that point is in or after. |
d6d50a511d12
(ada-format-paramlist)
Juanma Barranquero <lekktu@gmail.com>
parents:
63425
diff
changeset
|
3291 Return the new position of point. |
26225
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
3292 As a special case, if we are looking at a closing parenthesis, skip to the |
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
3293 open parenthesis." |
10705 | 3294 (let ((match-dat nil) |
73531
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3295 (orgpoint (point))) |
10705 | 3296 |
33716
c55ff055c68a
(ada-mode): `set '' -> `setq'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
32300
diff
changeset
|
3297 (setq match-dat (ada-search-prev-end-stmt)) |
10705 | 3298 (if match-dat |
33786
9f63b158eb6b
* simple.el (delete-trailing-whitespace): New interactive function.
Sam Steingold <sds@gnu.org>
parents:
33716
diff
changeset
|
3299 |
30411
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
3300 ;; |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
3301 ;; found a previous end-statement => check if anything follows |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
3302 ;; |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
3303 (unless (looking-at "declare") |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
3304 (progn |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
3305 (unless (save-excursion |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
3306 (goto-char (cdr match-dat)) |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
3307 (ada-goto-next-non-ws orgpoint)) |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
3308 ;; |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
3309 ;; nothing follows => it's the end-statement directly in |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
3310 ;; front of point => search again |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
3311 ;; |
33716
c55ff055c68a
(ada-mode): `set '' -> `setq'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
32300
diff
changeset
|
3312 (setq match-dat (ada-search-prev-end-stmt))) |
30411
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
3313 ;; |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
3314 ;; if found the correct end-statement => goto next non-ws |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
3315 ;; |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
3316 (if match-dat |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
3317 (goto-char (cdr match-dat))) |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
3318 (ada-goto-next-non-ws) |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
3319 )) |
33786
9f63b158eb6b
* simple.el (delete-trailing-whitespace): New interactive function.
Sam Steingold <sds@gnu.org>
parents:
33716
diff
changeset
|
3320 |
10705 | 3321 ;; |
3322 ;; no previous end-statement => we are at the beginning of the | |
3323 ;; accessible part of the buffer | |
3324 ;; | |
3325 (progn | |
30411
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
3326 (goto-char (point-min)) |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
3327 ;; |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
3328 ;; skip to the very first statement, if there is one |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
3329 ;; |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
3330 (unless (ada-goto-next-non-ws orgpoint) |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
3331 (goto-char orgpoint)))) |
10705 | 3332 (point))) |
3333 | |
3334 | |
26225
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
3335 (defun ada-search-prev-end-stmt () |
63528
d6d50a511d12
(ada-format-paramlist)
Juanma Barranquero <lekktu@gmail.com>
parents:
63425
diff
changeset
|
3336 "Move point to previous end statement. |
d6d50a511d12
(ada-format-paramlist)
Juanma Barranquero <lekktu@gmail.com>
parents:
63425
diff
changeset
|
3337 Return a cons cell whose car is the beginning and whose cdr |
d6d50a511d12
(ada-format-paramlist)
Juanma Barranquero <lekktu@gmail.com>
parents:
63425
diff
changeset
|
3338 is the end of the match." |
10705 | 3339 (let ((match-dat nil) |
73531
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3340 (found nil)) |
30411
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
3341 |
10705 | 3342 ;; search until found or beginning-of-buffer |
3343 (while | |
73531
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3344 (and |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3345 (not found) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3346 (setq match-dat (ada-search-ignore-string-comment |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3347 ada-end-stmt-re t))) |
10705 | 3348 |
3349 (goto-char (car match-dat)) | |
25903
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
3350 (unless (ada-in-open-paren-p) |
45931
a4c8d672ccbe
* progmodes/ada-mode.el: Update copyright notice.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
44933
diff
changeset
|
3351 (cond |
49598
0d8b17d428b5
Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
45931
diff
changeset
|
3352 |
45931
a4c8d672ccbe
* progmodes/ada-mode.el: Update copyright notice.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
44933
diff
changeset
|
3353 ((and (looking-at |
a4c8d672ccbe
* progmodes/ada-mode.el: Update copyright notice.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
44933
diff
changeset
|
3354 "\\<\\(record\\|loop\\|select\\|else\\|then\\)\\>") |
a4c8d672ccbe
* progmodes/ada-mode.el: Update copyright notice.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
44933
diff
changeset
|
3355 (save-excursion |
a4c8d672ccbe
* progmodes/ada-mode.el: Update copyright notice.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
44933
diff
changeset
|
3356 (ada-goto-previous-word) |
a4c8d672ccbe
* progmodes/ada-mode.el: Update copyright notice.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
44933
diff
changeset
|
3357 (looking-at "\\<\\(end\\|or\\|and\\)\\>[ \t]*[^;]"))) |
a4c8d672ccbe
* progmodes/ada-mode.el: Update copyright notice.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
44933
diff
changeset
|
3358 (forward-word -1)) |
a4c8d672ccbe
* progmodes/ada-mode.el: Update copyright notice.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
44933
diff
changeset
|
3359 |
a4c8d672ccbe
* progmodes/ada-mode.el: Update copyright notice.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
44933
diff
changeset
|
3360 ((looking-at "is") |
a4c8d672ccbe
* progmodes/ada-mode.el: Update copyright notice.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
44933
diff
changeset
|
3361 (setq found |
73531
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3362 (and (save-excursion (ada-goto-previous-word) |
45931
a4c8d672ccbe
* progmodes/ada-mode.el: Update copyright notice.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
44933
diff
changeset
|
3363 (ada-goto-previous-word) |
a4c8d672ccbe
* progmodes/ada-mode.el: Update copyright notice.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
44933
diff
changeset
|
3364 (not (looking-at "subtype"))) |
49598
0d8b17d428b5
Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
45931
diff
changeset
|
3365 |
73531
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3366 (save-excursion (goto-char (cdr match-dat)) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3367 (ada-goto-next-non-ws) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3368 ;; words that can go after an 'is' |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3369 (not (looking-at |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3370 (eval-when-compile |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3371 (concat "\\<" |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3372 (regexp-opt |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3373 '("separate" "access" "array" |
73932
242a56e8b2c0
Replace conditional (require 'ispell) with defvar.
Juanma Barranquero <lekktu@gmail.com>
parents:
73922
diff
changeset
|
3374 "private" "abstract" "new") t) |
73531
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3375 "\\>\\|(")))))))) |
49598
0d8b17d428b5
Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
45931
diff
changeset
|
3376 |
73932
242a56e8b2c0
Replace conditional (require 'ispell) with defvar.
Juanma Barranquero <lekktu@gmail.com>
parents:
73922
diff
changeset
|
3377 ((looking-at "private") |
242a56e8b2c0
Replace conditional (require 'ispell) with defvar.
Juanma Barranquero <lekktu@gmail.com>
parents:
73922
diff
changeset
|
3378 (save-excursion |
242a56e8b2c0
Replace conditional (require 'ispell) with defvar.
Juanma Barranquero <lekktu@gmail.com>
parents:
73922
diff
changeset
|
3379 (backward-word 1) |
242a56e8b2c0
Replace conditional (require 'ispell) with defvar.
Juanma Barranquero <lekktu@gmail.com>
parents:
73922
diff
changeset
|
3380 (setq found (not (looking-at "is"))))) |
242a56e8b2c0
Replace conditional (require 'ispell) with defvar.
Juanma Barranquero <lekktu@gmail.com>
parents:
73922
diff
changeset
|
3381 |
45931
a4c8d672ccbe
* progmodes/ada-mode.el: Update copyright notice.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
44933
diff
changeset
|
3382 (t |
a4c8d672ccbe
* progmodes/ada-mode.el: Update copyright notice.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
44933
diff
changeset
|
3383 (setq found t)) |
73531
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3384 ))) |
10705 | 3385 |
3386 (if found | |
73531
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3387 match-dat |
10705 | 3388 nil))) |
3389 | |
3390 | |
3391 (defun ada-goto-next-non-ws (&optional limit) | |
63528
d6d50a511d12
(ada-format-paramlist)
Juanma Barranquero <lekktu@gmail.com>
parents:
63425
diff
changeset
|
3392 "Skip white spaces, newlines and comments to next non-ws character. |
26225
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
3393 Stop the search at LIMIT. |
25903
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
3394 Do not call this function from within a string." |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
3395 (unless limit |
33716
c55ff055c68a
(ada-mode): `set '' -> `setq'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
32300
diff
changeset
|
3396 (setq limit (point-max))) |
25903
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
3397 (while (and (<= (point) limit) |
73531
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3398 (progn (forward-comment 10000) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3399 (if (and (not (eobp)) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3400 (save-excursion (forward-char 1) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3401 (ada-in-string-p))) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3402 (progn (forward-sexp 1) t))))) |
25903
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
3403 (if (< (point) limit) |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
3404 (point) |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
3405 nil) |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
3406 ) |
10705 | 3407 |
3408 | |
3409 (defun ada-goto-stmt-end (&optional limit) | |
63528
d6d50a511d12
(ada-format-paramlist)
Juanma Barranquero <lekktu@gmail.com>
parents:
63425
diff
changeset
|
3410 "Move point to the end of the statement that point is in or before. |
d6d50a511d12
(ada-format-paramlist)
Juanma Barranquero <lekktu@gmail.com>
parents:
63425
diff
changeset
|
3411 Return the new position of point or nil if not found. |
26225
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
3412 Stop the search at LIMIT." |
10705 | 3413 (if (ada-search-ignore-string-comment ada-end-stmt-re nil limit) |
3414 (point) | |
3415 nil)) | |
3416 | |
3417 | |
17914
e5e2ef0dd5ab
(ada-krunch-args): Use gnatkr instead of gnatk8.
Richard M. Stallman <rms@gnu.org>
parents:
14415
diff
changeset
|
3418 (defun ada-goto-next-word (&optional backward) |
63528
d6d50a511d12
(ada-format-paramlist)
Juanma Barranquero <lekktu@gmail.com>
parents:
63425
diff
changeset
|
3419 "Move point to the beginning of the next word of Ada code. |
26225
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
3420 If BACKWARD is non-nil, jump to the beginning of the previous word. |
63528
d6d50a511d12
(ada-format-paramlist)
Juanma Barranquero <lekktu@gmail.com>
parents:
63425
diff
changeset
|
3421 Return the new position of point or nil if not found." |
10705 | 3422 (let ((match-cons nil) |
73531
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3423 (orgpoint (point)) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3424 (old-syntax (char-to-string (char-syntax ?_)))) |
25903
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
3425 (modify-syntax-entry ?_ "w") |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
3426 (unless backward |
30411
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
3427 (skip-syntax-forward "w")) |
33716
c55ff055c68a
(ada-mode): `set '' -> `setq'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
32300
diff
changeset
|
3428 (if (setq match-cons |
73531
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3429 (if backward |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3430 (ada-search-ignore-string-comment "\\w" t nil t) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3431 (ada-search-ignore-string-comment "\\w" nil nil t))) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3432 ;; |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3433 ;; move to the beginning of the word found |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3434 ;; |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3435 (progn |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3436 (goto-char (car match-cons)) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3437 (skip-syntax-backward "w") |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3438 (point)) |
10705 | 3439 ;; |
3440 ;; if not found, restore old position of point | |
3441 ;; | |
25903
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
3442 (goto-char orgpoint) |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
3443 'nil) |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
3444 (modify-syntax-entry ?_ old-syntax)) |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
3445 ) |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
3446 |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
3447 |
10705 | 3448 (defun ada-check-matching-start (keyword) |
63528
d6d50a511d12
(ada-format-paramlist)
Juanma Barranquero <lekktu@gmail.com>
parents:
63425
diff
changeset
|
3449 "Signal an error if matching block start is not KEYWORD. |
26225
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
3450 Moves point to the matching block start." |
10705 | 3451 (ada-goto-matching-start 0) |
25903
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
3452 (unless (looking-at (concat "\\<" keyword "\\>")) |
63528
d6d50a511d12
(ada-format-paramlist)
Juanma Barranquero <lekktu@gmail.com>
parents:
63425
diff
changeset
|
3453 (error "Matching start is not '%s'" keyword))) |
10705 | 3454 |
3455 | |
3456 (defun ada-check-defun-name (defun-name) | |
63528
d6d50a511d12
(ada-format-paramlist)
Juanma Barranquero <lekktu@gmail.com>
parents:
63425
diff
changeset
|
3457 "Check if the name of the matching defun really is DEFUN-NAME. |
d6d50a511d12
(ada-format-paramlist)
Juanma Barranquero <lekktu@gmail.com>
parents:
63425
diff
changeset
|
3458 Assumes point to be already positioned by `ada-goto-matching-start'. |
26225
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
3459 Moves point to the beginning of the declaration." |
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
3460 |
97058
b6ac850e9d2b
Fix bug #272, and update Ada mode to version 4.0.
Juanma Barranquero <lekktu@gmail.com>
parents:
95268
diff
changeset
|
3461 ;; named block without a `declare'; ada-goto-matching-start leaves |
b6ac850e9d2b
Fix bug #272, and update Ada mode to version 4.0.
Juanma Barranquero <lekktu@gmail.com>
parents:
95268
diff
changeset
|
3462 ;; point at start of 'begin' for a block. |
17914
e5e2ef0dd5ab
(ada-krunch-args): Use gnatkr instead of gnatk8.
Richard M. Stallman <rms@gnu.org>
parents:
14415
diff
changeset
|
3463 (if (save-excursion |
73531
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3464 (ada-goto-previous-word) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3465 (looking-at (concat "\\<" defun-name "\\> *:"))) |
25903
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
3466 t ; do nothing |
97058
b6ac850e9d2b
Fix bug #272, and update Ada mode to version 4.0.
Juanma Barranquero <lekktu@gmail.com>
parents:
95268
diff
changeset
|
3467 ;; else |
10705 | 3468 ;; |
17914
e5e2ef0dd5ab
(ada-krunch-args): Use gnatkr instead of gnatk8.
Richard M. Stallman <rms@gnu.org>
parents:
14415
diff
changeset
|
3469 ;; 'accept' or 'package' ? |
10705 | 3470 ;; |
30411
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
3471 (unless (looking-at ada-subprog-start-re) |
25903
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
3472 (ada-goto-matching-decl-start)) |
17914
e5e2ef0dd5ab
(ada-krunch-args): Use gnatkr instead of gnatk8.
Richard M. Stallman <rms@gnu.org>
parents:
14415
diff
changeset
|
3473 ;; |
e5e2ef0dd5ab
(ada-krunch-args): Use gnatkr instead of gnatk8.
Richard M. Stallman <rms@gnu.org>
parents:
14415
diff
changeset
|
3474 ;; 'begin' of 'procedure'/'function'/'task' or 'declare' |
e5e2ef0dd5ab
(ada-krunch-args): Use gnatkr instead of gnatk8.
Richard M. Stallman <rms@gnu.org>
parents:
14415
diff
changeset
|
3475 ;; |
e5e2ef0dd5ab
(ada-krunch-args): Use gnatkr instead of gnatk8.
Richard M. Stallman <rms@gnu.org>
parents:
14415
diff
changeset
|
3476 (save-excursion |
10705 | 3477 ;; |
73932
242a56e8b2c0
Replace conditional (require 'ispell) with defvar.
Juanma Barranquero <lekktu@gmail.com>
parents:
73922
diff
changeset
|
3478 ;; a named 'declare'-block ? => jump to the label |
10705 | 3479 ;; |
17914
e5e2ef0dd5ab
(ada-krunch-args): Use gnatkr instead of gnatk8.
Richard M. Stallman <rms@gnu.org>
parents:
14415
diff
changeset
|
3480 (if (looking-at "\\<declare\\>") |
97058
b6ac850e9d2b
Fix bug #272, and update Ada mode to version 4.0.
Juanma Barranquero <lekktu@gmail.com>
parents:
95268
diff
changeset
|
3481 (progn |
b6ac850e9d2b
Fix bug #272, and update Ada mode to version 4.0.
Juanma Barranquero <lekktu@gmail.com>
parents:
95268
diff
changeset
|
3482 (forward-comment -1) |
b6ac850e9d2b
Fix bug #272, and update Ada mode to version 4.0.
Juanma Barranquero <lekktu@gmail.com>
parents:
95268
diff
changeset
|
3483 (backward-word 1)) |
73531
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3484 ;; |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3485 ;; no, => 'procedure'/'function'/'task'/'protected' |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3486 ;; |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3487 (progn |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3488 (forward-word 2) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3489 (backward-word 1) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3490 ;; |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3491 ;; skip 'body' 'type' |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3492 ;; |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3493 (if (looking-at "\\<\\(body\\|type\\)\\>") |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3494 (forward-word 1)) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3495 (forward-sexp 1) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3496 (backward-sexp 1))) |
17914
e5e2ef0dd5ab
(ada-krunch-args): Use gnatkr instead of gnatk8.
Richard M. Stallman <rms@gnu.org>
parents:
14415
diff
changeset
|
3497 ;; |
e5e2ef0dd5ab
(ada-krunch-args): Use gnatkr instead of gnatk8.
Richard M. Stallman <rms@gnu.org>
parents:
14415
diff
changeset
|
3498 ;; should be looking-at the correct name |
e5e2ef0dd5ab
(ada-krunch-args): Use gnatkr instead of gnatk8.
Richard M. Stallman <rms@gnu.org>
parents:
14415
diff
changeset
|
3499 ;; |
25903
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
3500 (unless (looking-at (concat "\\<" defun-name "\\>")) |
73531
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3501 (error "Matching defun has different name: %s" |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3502 (buffer-substring (point) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3503 (progn (forward-sexp 1) (point)))))))) |
10705 | 3504 |
30411
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
3505 (defun ada-goto-matching-decl-start (&optional noerror recursive) |
63528
d6d50a511d12
(ada-format-paramlist)
Juanma Barranquero <lekktu@gmail.com>
parents:
63425
diff
changeset
|
3506 "Move point to the matching declaration start of the current 'begin'. |
26225
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
3507 If NOERROR is non-nil, it only returns nil if no match was found." |
10705 | 3508 (let ((nest-count 1) |
44465
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
3509 |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
3510 ;; first should be set to t if we should stop at the first |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
3511 ;; "begin" we encounter. |
73531
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3512 (first (not recursive)) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3513 (count-generic nil) |
50812
15929fed5553
(ada-xemacs): Variable removed, since it's better to use (featurep 'xemacs).
Juanma Barranquero <lekktu@gmail.com>
parents:
50736
diff
changeset
|
3514 (stop-at-when nil) |
73531
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3515 ) |
25903
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
3516 |
30411
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
3517 ;; Ignore "when" most of the time, except if we are looking at the |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
3518 ;; beginning of a block (structure: case .. is |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
3519 ;; when ... => |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
3520 ;; begin ... |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
3521 ;; exception ... ) |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
3522 (if (looking-at "begin") |
73531
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3523 (setq stop-at-when t)) |
30411
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
3524 |
25903
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
3525 (if (or |
73531
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3526 (looking-at "\\<\\(package\\|procedure\\|function\\)\\>") |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3527 (save-excursion |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3528 (ada-search-ignore-string-comment |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3529 "\\<\\(package\\|procedure\\|function\\|generic\\)\\>" t) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3530 (looking-at "generic"))) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3531 (setq count-generic t)) |
25903
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
3532 |
10705 | 3533 ;; search backward for interesting keywords |
3534 (while (and | |
73531
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3535 (not (zerop nest-count)) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3536 (ada-search-ignore-string-comment ada-matching-decl-start-re t)) |
10705 | 3537 ;; |
3538 ;; calculate nest-depth | |
3539 ;; | |
3540 (cond | |
3541 ;; | |
3542 ((looking-at "end") | |
73531
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3543 (ada-goto-matching-start 1 noerror) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3544 |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3545 ;; In some case, two begin..end block can follow each other closely, |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3546 ;; which we have to detect, as in |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3547 ;; procedure P is |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3548 ;; procedure Q is |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3549 ;; begin |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3550 ;; end; |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3551 ;; begin -- here we should go to procedure, not begin |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3552 ;; end |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3553 |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3554 (if (looking-at "begin") |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3555 (let ((loop-again t)) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3556 (save-excursion |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3557 (while loop-again |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3558 ;; If begin was just there as the beginning of a block |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3559 ;; (with no declare) then do nothing, otherwise just |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3560 ;; register that we have to find the statement that |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3561 ;; required the begin |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3562 |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3563 (ada-search-ignore-string-comment |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3564 "\\<\\(declare\\|begin\\|end\\|procedure\\|function\\|task\\|package\\)\\>" |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3565 t) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3566 |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3567 (if (looking-at "end") |
44465
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
3568 (ada-goto-matching-start 1 noerror t) |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
3569 ;; (ada-goto-matching-decl-start noerror t) |
30411
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
3570 |
73531
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3571 (setq loop-again nil) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3572 (unless (looking-at "begin") |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3573 (setq nest-count (1+ nest-count)))) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3574 )) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3575 ))) |
10705 | 3576 ;; |
25903
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
3577 ((looking-at "generic") |
73531
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3578 (if count-generic |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3579 (progn |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3580 (setq first nil) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3581 (setq nest-count (1- nest-count))))) |
25903
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
3582 ;; |
30411
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
3583 ((looking-at "if") |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
3584 (save-excursion |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
3585 (forward-word -1) |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
3586 (unless (looking-at "\\<end[ \t\n]*if\\>") |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
3587 (progn |
33716
c55ff055c68a
(ada-mode): `set '' -> `setq'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
32300
diff
changeset
|
3588 (setq nest-count (1- nest-count)) |
c55ff055c68a
(ada-mode): `set '' -> `setq'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
32300
diff
changeset
|
3589 (setq first nil))))) |
33786
9f63b158eb6b
* simple.el (delete-trailing-whitespace): New interactive function.
Sam Steingold <sds@gnu.org>
parents:
33716
diff
changeset
|
3590 |
30411
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
3591 ;; |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
3592 ((looking-at "declare\\|generic") |
73531
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3593 (setq nest-count (1- nest-count)) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3594 (setq first t)) |
10705 | 3595 ;; |
3596 ((looking-at "is") | |
73531
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3597 ;; check if it is only a type definition, but not a protected |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3598 ;; type definition, which should be handled like a procedure. |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3599 (if (or (looking-at "is[ \t]+<>") |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3600 (save-excursion |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3601 (forward-comment -10000) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3602 (forward-char -1) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3603 |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3604 ;; Detect if we have a closing parenthesis (Could be |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3605 ;; either the end of subprogram parameters or (<>) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3606 ;; in a type definition |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3607 (if (= (char-after) ?\)) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3608 (progn |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3609 (forward-char 1) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3610 (backward-sexp 1) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3611 (forward-comment -10000) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3612 )) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3613 (skip-chars-backward "a-zA-Z0-9_.'") |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3614 (ada-goto-previous-word) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3615 (and |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3616 (looking-at "\\<\\(sub\\)?type\\|case\\>") |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3617 (save-match-data |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3618 (ada-goto-previous-word) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3619 (not (looking-at "\\<protected\\>")))) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3620 )) ; end of `or' |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3621 (goto-char (match-beginning 0)) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3622 (progn |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3623 (setq nest-count (1- nest-count)) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3624 (setq first nil)))) |
10705 | 3625 |
3626 ;; | |
3627 ((looking-at "new") | |
73531
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3628 (if (save-excursion |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3629 (ada-goto-previous-word) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3630 (looking-at "is")) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3631 (goto-char (match-beginning 0)))) |
10705 | 3632 ;; |
3633 ((and first | |
73531
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3634 (looking-at "begin")) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3635 (setq nest-count 0)) |
30411
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
3636 ;; |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
3637 ((looking-at "when") |
44465
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
3638 (save-excursion |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
3639 (forward-word -1) |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
3640 (unless (looking-at "\\<exit[ \t\n]*when\\>") |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
3641 (progn |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
3642 (if stop-at-when |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
3643 (setq nest-count (1- nest-count))) |
50736
b0ce71ab9c28
(ada-search-directories): Take into account ADA_INCLUDE_PATH for better
Juanma Barranquero <lekktu@gmail.com>
parents:
49598
diff
changeset
|
3644 )))) |
44465
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
3645 ;; |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
3646 ((looking-at "begin") |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
3647 (setq first nil)) |
10705 | 3648 ;; |
3649 (t | |
73531
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3650 (setq nest-count (1+ nest-count)) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3651 (setq first nil))) |
25903
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
3652 |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
3653 );; end of loop |
10705 | 3654 |
3655 ;; check if declaration-start is really found | |
25903
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
3656 (if (and |
73531
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3657 (zerop nest-count) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3658 (if (looking-at "is") |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3659 (ada-search-ignore-string-comment ada-subprog-start-re t) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3660 (looking-at "declare\\|generic"))) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3661 t |
25903
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
3662 (if noerror nil |
73531
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3663 (error "No matching proc/func/task/declare/package/protected"))) |
25903
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
3664 )) |
10705 | 3665 |
3666 (defun ada-goto-matching-start (&optional nest-level noerror gotothen) | |
63528
d6d50a511d12
(ada-format-paramlist)
Juanma Barranquero <lekktu@gmail.com>
parents:
63425
diff
changeset
|
3667 "Move point to the beginning of a block-start. |
d6d50a511d12
(ada-format-paramlist)
Juanma Barranquero <lekktu@gmail.com>
parents:
63425
diff
changeset
|
3668 Which block depends on the value of NEST-LEVEL, which defaults to zero. |
d6d50a511d12
(ada-format-paramlist)
Juanma Barranquero <lekktu@gmail.com>
parents:
63425
diff
changeset
|
3669 If NOERROR is non-nil, it only returns nil if no matching start was found. |
26225
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
3670 If GOTOTHEN is non-nil, point moves to the 'then' following 'if'." |
10705 | 3671 (let ((nest-count (if nest-level nest-level 0)) |
73531
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3672 (found nil) |
73932
242a56e8b2c0
Replace conditional (require 'ispell) with defvar.
Juanma Barranquero <lekktu@gmail.com>
parents:
73922
diff
changeset
|
3673 |
242a56e8b2c0
Replace conditional (require 'ispell) with defvar.
Juanma Barranquero <lekktu@gmail.com>
parents:
73922
diff
changeset
|
3674 (last-was-begin '()) |
242a56e8b2c0
Replace conditional (require 'ispell) with defvar.
Juanma Barranquero <lekktu@gmail.com>
parents:
73922
diff
changeset
|
3675 ;; List all keywords encountered while traversing |
242a56e8b2c0
Replace conditional (require 'ispell) with defvar.
Juanma Barranquero <lekktu@gmail.com>
parents:
73922
diff
changeset
|
3676 ;; something like '("end" "end" "begin") |
242a56e8b2c0
Replace conditional (require 'ispell) with defvar.
Juanma Barranquero <lekktu@gmail.com>
parents:
73922
diff
changeset
|
3677 ;; This is removed from the list when "package", "procedure",... |
242a56e8b2c0
Replace conditional (require 'ispell) with defvar.
Juanma Barranquero <lekktu@gmail.com>
parents:
73922
diff
changeset
|
3678 ;; are seen. The goal is to find whether a package has an elaboration |
242a56e8b2c0
Replace conditional (require 'ispell) with defvar.
Juanma Barranquero <lekktu@gmail.com>
parents:
73922
diff
changeset
|
3679 ;; part |
242a56e8b2c0
Replace conditional (require 'ispell) with defvar.
Juanma Barranquero <lekktu@gmail.com>
parents:
73922
diff
changeset
|
3680 |
73531
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3681 (pos nil)) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3682 |
10705 | 3683 ;; search backward for interesting keywords |
3684 (while (and | |
73531
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3685 (not found) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3686 (ada-search-ignore-string-comment ada-matching-start-re t)) |
25903
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
3687 |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
3688 (unless (and (looking-at "\\<record\\>") |
73531
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3689 (save-excursion |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3690 (forward-word -1) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3691 (looking-at "\\<null\\>"))) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3692 (progn |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3693 ;; calculate nest-depth |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3694 (cond |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3695 ;; found block end => increase nest depth |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3696 ((looking-at "end") |
73932
242a56e8b2c0
Replace conditional (require 'ispell) with defvar.
Juanma Barranquero <lekktu@gmail.com>
parents:
73922
diff
changeset
|
3697 (push nil last-was-begin) |
73531
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3698 (setq nest-count (1+ nest-count))) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3699 |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3700 ;; found loop/select/record/case/if => check if it starts or |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3701 ;; ends a block |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3702 ((looking-at "loop\\|select\\|record\\|case\\|if") |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3703 (setq pos (point)) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3704 (save-excursion |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3705 ;; check if keyword follows 'end' |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3706 (ada-goto-previous-word) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3707 (if (looking-at "\\<end\\>[ \t]*[^;]") |
73932
242a56e8b2c0
Replace conditional (require 'ispell) with defvar.
Juanma Barranquero <lekktu@gmail.com>
parents:
73922
diff
changeset
|
3708 (progn |
242a56e8b2c0
Replace conditional (require 'ispell) with defvar.
Juanma Barranquero <lekktu@gmail.com>
parents:
73922
diff
changeset
|
3709 ;; it ends a block => increase nest depth |
242a56e8b2c0
Replace conditional (require 'ispell) with defvar.
Juanma Barranquero <lekktu@gmail.com>
parents:
73922
diff
changeset
|
3710 (setq nest-count (1+ nest-count) |
242a56e8b2c0
Replace conditional (require 'ispell) with defvar.
Juanma Barranquero <lekktu@gmail.com>
parents:
73922
diff
changeset
|
3711 pos (point)) |
242a56e8b2c0
Replace conditional (require 'ispell) with defvar.
Juanma Barranquero <lekktu@gmail.com>
parents:
73922
diff
changeset
|
3712 (push nil last-was-begin)) |
49598
0d8b17d428b5
Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
45931
diff
changeset
|
3713 |
73531
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3714 ;; it starts a block => decrease nest depth |
73932
242a56e8b2c0
Replace conditional (require 'ispell) with defvar.
Juanma Barranquero <lekktu@gmail.com>
parents:
73922
diff
changeset
|
3715 (setq nest-count (1- nest-count)) |
242a56e8b2c0
Replace conditional (require 'ispell) with defvar.
Juanma Barranquero <lekktu@gmail.com>
parents:
73922
diff
changeset
|
3716 |
242a56e8b2c0
Replace conditional (require 'ispell) with defvar.
Juanma Barranquero <lekktu@gmail.com>
parents:
73922
diff
changeset
|
3717 ;; Some nested "begin .. end" blocks with no "declare"? |
242a56e8b2c0
Replace conditional (require 'ispell) with defvar.
Juanma Barranquero <lekktu@gmail.com>
parents:
73922
diff
changeset
|
3718 ;; => remove those entries |
242a56e8b2c0
Replace conditional (require 'ispell) with defvar.
Juanma Barranquero <lekktu@gmail.com>
parents:
73922
diff
changeset
|
3719 (while (car last-was-begin) |
242a56e8b2c0
Replace conditional (require 'ispell) with defvar.
Juanma Barranquero <lekktu@gmail.com>
parents:
73922
diff
changeset
|
3720 (setq last-was-begin (cdr (cdr last-was-begin)))) |
242a56e8b2c0
Replace conditional (require 'ispell) with defvar.
Juanma Barranquero <lekktu@gmail.com>
parents:
73922
diff
changeset
|
3721 |
242a56e8b2c0
Replace conditional (require 'ispell) with defvar.
Juanma Barranquero <lekktu@gmail.com>
parents:
73922
diff
changeset
|
3722 (setq last-was-begin (cdr last-was-begin)) |
242a56e8b2c0
Replace conditional (require 'ispell) with defvar.
Juanma Barranquero <lekktu@gmail.com>
parents:
73922
diff
changeset
|
3723 )) |
242a56e8b2c0
Replace conditional (require 'ispell) with defvar.
Juanma Barranquero <lekktu@gmail.com>
parents:
73922
diff
changeset
|
3724 (goto-char pos) |
242a56e8b2c0
Replace conditional (require 'ispell) with defvar.
Juanma Barranquero <lekktu@gmail.com>
parents:
73922
diff
changeset
|
3725 ) |
73531
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3726 |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3727 ;; found package start => check if it really is a block |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3728 ((looking-at "package") |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3729 (save-excursion |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3730 ;; ignore if this is just a renames statement |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3731 (let ((current (point)) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3732 (pos (ada-search-ignore-string-comment |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3733 "\\<\\(is\\|renames\\|;\\)\\>" nil))) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3734 (if pos |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3735 (goto-char (car pos)) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3736 (error (concat |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3737 "No matching 'is' or 'renames' for 'package' at" |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3738 " line " |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3739 (number-to-string (count-lines 1 (1+ current))))))) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3740 (unless (looking-at "renames") |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3741 (progn |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3742 (forward-word 1) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3743 (ada-goto-next-non-ws) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3744 ;; ignore it if it is only a declaration with 'new' |
44465
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
3745 ;; We could have package Foo is new .... |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
3746 ;; or package Foo is separate; |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
3747 ;; or package Foo is begin null; end Foo |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
3748 ;; for elaboration code (elaboration) |
73932
242a56e8b2c0
Replace conditional (require 'ispell) with defvar.
Juanma Barranquero <lekktu@gmail.com>
parents:
73922
diff
changeset
|
3749 (if (and (not (looking-at "\\<\\(new\\|separate\\|begin\\)\\>")) |
242a56e8b2c0
Replace conditional (require 'ispell) with defvar.
Juanma Barranquero <lekktu@gmail.com>
parents:
73922
diff
changeset
|
3750 (not (car last-was-begin))) |
242a56e8b2c0
Replace conditional (require 'ispell) with defvar.
Juanma Barranquero <lekktu@gmail.com>
parents:
73922
diff
changeset
|
3751 (setq nest-count (1- nest-count)))))) |
242a56e8b2c0
Replace conditional (require 'ispell) with defvar.
Juanma Barranquero <lekktu@gmail.com>
parents:
73922
diff
changeset
|
3752 |
242a56e8b2c0
Replace conditional (require 'ispell) with defvar.
Juanma Barranquero <lekktu@gmail.com>
parents:
73922
diff
changeset
|
3753 (setq last-was-begin (cdr last-was-begin)) |
242a56e8b2c0
Replace conditional (require 'ispell) with defvar.
Juanma Barranquero <lekktu@gmail.com>
parents:
73922
diff
changeset
|
3754 ) |
73531
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3755 ;; found task start => check if it has a body |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3756 ((looking-at "task") |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3757 (save-excursion |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3758 (forward-word 1) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3759 (ada-goto-next-non-ws) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3760 (cond |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3761 ((looking-at "\\<body\\>")) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3762 ((looking-at "\\<type\\>") |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3763 ;; In that case, do nothing if there is a "is" |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3764 (forward-word 2);; skip "type" |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3765 (ada-goto-next-non-ws);; skip type name |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3766 |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3767 ;; Do nothing if we are simply looking at a simple |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3768 ;; "task type name;" statement with no block |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3769 (unless (looking-at ";") |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3770 (progn |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3771 ;; Skip the parameters |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3772 (if (looking-at "(") |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3773 (ada-search-ignore-string-comment ")" nil)) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3774 (let ((tmp (ada-search-ignore-string-comment |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3775 "\\<\\(is\\|;\\)\\>" nil))) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3776 (if tmp |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3777 (progn |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3778 (goto-char (car tmp)) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3779 (if (looking-at "is") |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3780 (setq nest-count (1- nest-count))))))))) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3781 (t |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3782 ;; Check if that task declaration had a block attached to |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3783 ;; it (i.e do nothing if we have just "task name;") |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3784 (unless (progn (forward-word 1) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3785 (looking-at "[ \t]*;")) |
73932
242a56e8b2c0
Replace conditional (require 'ispell) with defvar.
Juanma Barranquero <lekktu@gmail.com>
parents:
73922
diff
changeset
|
3786 (setq nest-count (1- nest-count)))))) |
242a56e8b2c0
Replace conditional (require 'ispell) with defvar.
Juanma Barranquero <lekktu@gmail.com>
parents:
73922
diff
changeset
|
3787 (setq last-was-begin (cdr last-was-begin)) |
242a56e8b2c0
Replace conditional (require 'ispell) with defvar.
Juanma Barranquero <lekktu@gmail.com>
parents:
73922
diff
changeset
|
3788 ) |
242a56e8b2c0
Replace conditional (require 'ispell) with defvar.
Juanma Barranquero <lekktu@gmail.com>
parents:
73922
diff
changeset
|
3789 |
242a56e8b2c0
Replace conditional (require 'ispell) with defvar.
Juanma Barranquero <lekktu@gmail.com>
parents:
73922
diff
changeset
|
3790 ((looking-at "declare") |
242a56e8b2c0
Replace conditional (require 'ispell) with defvar.
Juanma Barranquero <lekktu@gmail.com>
parents:
73922
diff
changeset
|
3791 ;; remove entry for begin and end (include nested begin..end |
242a56e8b2c0
Replace conditional (require 'ispell) with defvar.
Juanma Barranquero <lekktu@gmail.com>
parents:
73922
diff
changeset
|
3792 ;; groups) |
242a56e8b2c0
Replace conditional (require 'ispell) with defvar.
Juanma Barranquero <lekktu@gmail.com>
parents:
73922
diff
changeset
|
3793 (setq last-was-begin (cdr last-was-begin)) |
242a56e8b2c0
Replace conditional (require 'ispell) with defvar.
Juanma Barranquero <lekktu@gmail.com>
parents:
73922
diff
changeset
|
3794 (let ((count 1)) |
242a56e8b2c0
Replace conditional (require 'ispell) with defvar.
Juanma Barranquero <lekktu@gmail.com>
parents:
73922
diff
changeset
|
3795 (while (and (> count 0)) |
242a56e8b2c0
Replace conditional (require 'ispell) with defvar.
Juanma Barranquero <lekktu@gmail.com>
parents:
73922
diff
changeset
|
3796 (if (equal (car last-was-begin) t) |
242a56e8b2c0
Replace conditional (require 'ispell) with defvar.
Juanma Barranquero <lekktu@gmail.com>
parents:
73922
diff
changeset
|
3797 (setq count (1+ count)) |
242a56e8b2c0
Replace conditional (require 'ispell) with defvar.
Juanma Barranquero <lekktu@gmail.com>
parents:
73922
diff
changeset
|
3798 (setq count (1- count))) |
242a56e8b2c0
Replace conditional (require 'ispell) with defvar.
Juanma Barranquero <lekktu@gmail.com>
parents:
73922
diff
changeset
|
3799 (setq last-was-begin (cdr last-was-begin)) |
242a56e8b2c0
Replace conditional (require 'ispell) with defvar.
Juanma Barranquero <lekktu@gmail.com>
parents:
73922
diff
changeset
|
3800 ))) |
242a56e8b2c0
Replace conditional (require 'ispell) with defvar.
Juanma Barranquero <lekktu@gmail.com>
parents:
73922
diff
changeset
|
3801 |
242a56e8b2c0
Replace conditional (require 'ispell) with defvar.
Juanma Barranquero <lekktu@gmail.com>
parents:
73922
diff
changeset
|
3802 ((looking-at "protected") |
242a56e8b2c0
Replace conditional (require 'ispell) with defvar.
Juanma Barranquero <lekktu@gmail.com>
parents:
73922
diff
changeset
|
3803 ;; Ignore if this is just a declaration |
242a56e8b2c0
Replace conditional (require 'ispell) with defvar.
Juanma Barranquero <lekktu@gmail.com>
parents:
73922
diff
changeset
|
3804 (save-excursion |
242a56e8b2c0
Replace conditional (require 'ispell) with defvar.
Juanma Barranquero <lekktu@gmail.com>
parents:
73922
diff
changeset
|
3805 (let ((pos (ada-search-ignore-string-comment |
242a56e8b2c0
Replace conditional (require 'ispell) with defvar.
Juanma Barranquero <lekktu@gmail.com>
parents:
73922
diff
changeset
|
3806 "\\(\\<is\\>\\|\\<renames\\>\\|;\\)" nil))) |
242a56e8b2c0
Replace conditional (require 'ispell) with defvar.
Juanma Barranquero <lekktu@gmail.com>
parents:
73922
diff
changeset
|
3807 (if pos |
242a56e8b2c0
Replace conditional (require 'ispell) with defvar.
Juanma Barranquero <lekktu@gmail.com>
parents:
73922
diff
changeset
|
3808 (goto-char (car pos))) |
242a56e8b2c0
Replace conditional (require 'ispell) with defvar.
Juanma Barranquero <lekktu@gmail.com>
parents:
73922
diff
changeset
|
3809 (if (looking-at "is") |
242a56e8b2c0
Replace conditional (require 'ispell) with defvar.
Juanma Barranquero <lekktu@gmail.com>
parents:
73922
diff
changeset
|
3810 ;; remove entry for end |
242a56e8b2c0
Replace conditional (require 'ispell) with defvar.
Juanma Barranquero <lekktu@gmail.com>
parents:
73922
diff
changeset
|
3811 (setq last-was-begin (cdr last-was-begin))))) |
242a56e8b2c0
Replace conditional (require 'ispell) with defvar.
Juanma Barranquero <lekktu@gmail.com>
parents:
73922
diff
changeset
|
3812 (setq nest-count (1- nest-count))) |
242a56e8b2c0
Replace conditional (require 'ispell) with defvar.
Juanma Barranquero <lekktu@gmail.com>
parents:
73922
diff
changeset
|
3813 |
242a56e8b2c0
Replace conditional (require 'ispell) with defvar.
Juanma Barranquero <lekktu@gmail.com>
parents:
73922
diff
changeset
|
3814 ((or (looking-at "procedure") |
242a56e8b2c0
Replace conditional (require 'ispell) with defvar.
Juanma Barranquero <lekktu@gmail.com>
parents:
73922
diff
changeset
|
3815 (looking-at "function")) |
242a56e8b2c0
Replace conditional (require 'ispell) with defvar.
Juanma Barranquero <lekktu@gmail.com>
parents:
73922
diff
changeset
|
3816 ;; Ignore if this is just a declaration |
242a56e8b2c0
Replace conditional (require 'ispell) with defvar.
Juanma Barranquero <lekktu@gmail.com>
parents:
73922
diff
changeset
|
3817 (save-excursion |
242a56e8b2c0
Replace conditional (require 'ispell) with defvar.
Juanma Barranquero <lekktu@gmail.com>
parents:
73922
diff
changeset
|
3818 (let ((pos (ada-search-ignore-string-comment |
242a56e8b2c0
Replace conditional (require 'ispell) with defvar.
Juanma Barranquero <lekktu@gmail.com>
parents:
73922
diff
changeset
|
3819 "\\(\\<is\\>\\|\\<renames\\>\\|)[ \t]*;\\)" nil))) |
242a56e8b2c0
Replace conditional (require 'ispell) with defvar.
Juanma Barranquero <lekktu@gmail.com>
parents:
73922
diff
changeset
|
3820 (if pos |
242a56e8b2c0
Replace conditional (require 'ispell) with defvar.
Juanma Barranquero <lekktu@gmail.com>
parents:
73922
diff
changeset
|
3821 (goto-char (car pos))) |
242a56e8b2c0
Replace conditional (require 'ispell) with defvar.
Juanma Barranquero <lekktu@gmail.com>
parents:
73922
diff
changeset
|
3822 (if (looking-at "is") |
242a56e8b2c0
Replace conditional (require 'ispell) with defvar.
Juanma Barranquero <lekktu@gmail.com>
parents:
73922
diff
changeset
|
3823 ;; remove entry for begin and end |
242a56e8b2c0
Replace conditional (require 'ispell) with defvar.
Juanma Barranquero <lekktu@gmail.com>
parents:
73922
diff
changeset
|
3824 (setq last-was-begin (cdr (cdr last-was-begin)))))) |
242a56e8b2c0
Replace conditional (require 'ispell) with defvar.
Juanma Barranquero <lekktu@gmail.com>
parents:
73922
diff
changeset
|
3825 ) |
242a56e8b2c0
Replace conditional (require 'ispell) with defvar.
Juanma Barranquero <lekktu@gmail.com>
parents:
73922
diff
changeset
|
3826 |
73531
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3827 ;; all the other block starts |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3828 (t |
73932
242a56e8b2c0
Replace conditional (require 'ispell) with defvar.
Juanma Barranquero <lekktu@gmail.com>
parents:
73922
diff
changeset
|
3829 (push (looking-at "begin") last-was-begin) |
242a56e8b2c0
Replace conditional (require 'ispell) with defvar.
Juanma Barranquero <lekktu@gmail.com>
parents:
73922
diff
changeset
|
3830 (setq nest-count (1- nest-count))) |
242a56e8b2c0
Replace conditional (require 'ispell) with defvar.
Juanma Barranquero <lekktu@gmail.com>
parents:
73922
diff
changeset
|
3831 |
242a56e8b2c0
Replace conditional (require 'ispell) with defvar.
Juanma Barranquero <lekktu@gmail.com>
parents:
73922
diff
changeset
|
3832 ) |
73531
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3833 |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3834 ;; match is found, if nest-depth is zero |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3835 (setq found (zerop nest-count))))) ; end of loop |
10705 | 3836 |
44465
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
3837 (if (bobp) |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
3838 (point) |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
3839 (if found |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
3840 ;; |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
3841 ;; match found => is there anything else to do ? |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
3842 ;; |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
3843 (progn |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
3844 (cond |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
3845 ;; |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
3846 ;; found 'if' => skip to 'then', if it's on a separate line |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
3847 ;; and GOTOTHEN is non-nil |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
3848 ;; |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
3849 ((and |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
3850 gotothen |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
3851 (looking-at "if") |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
3852 (save-excursion |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
3853 (ada-search-ignore-string-comment "then" nil nil nil |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
3854 'word-search-forward) |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
3855 (back-to-indentation) |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
3856 (looking-at "\\<then\\>"))) |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
3857 (goto-char (match-beginning 0))) |
49598
0d8b17d428b5
Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
45931
diff
changeset
|
3858 |
44465
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
3859 ;; |
98674
bde81f3667cd
* progmodes/ada-mode.el (ada-get-indent-end, ada-goto-matching-start):
Juanma Barranquero <lekktu@gmail.com>
parents:
97078
diff
changeset
|
3860 ;; found 'do' => skip back to 'accept' or 'return' |
44465
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
3861 ;; |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
3862 ((looking-at "do") |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
3863 (unless (ada-search-ignore-string-comment |
98674
bde81f3667cd
* progmodes/ada-mode.el (ada-get-indent-end, ada-goto-matching-start):
Juanma Barranquero <lekktu@gmail.com>
parents:
97078
diff
changeset
|
3864 "\\<accept\\|return\\>" t) |
bde81f3667cd
* progmodes/ada-mode.el (ada-get-indent-end, ada-goto-matching-start):
Juanma Barranquero <lekktu@gmail.com>
parents:
97078
diff
changeset
|
3865 (error "Missing 'accept' or 'return' in front of 'do'")))) |
44465
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
3866 (point)) |
49598
0d8b17d428b5
Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
45931
diff
changeset
|
3867 |
44465
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
3868 (if noerror |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
3869 nil |
63528
d6d50a511d12
(ada-format-paramlist)
Juanma Barranquero <lekktu@gmail.com>
parents:
63425
diff
changeset
|
3870 (error "No matching start")))))) |
10705 | 3871 |
3872 | |
3873 (defun ada-goto-matching-end (&optional nest-level noerror) | |
63528
d6d50a511d12
(ada-format-paramlist)
Juanma Barranquero <lekktu@gmail.com>
parents:
63425
diff
changeset
|
3874 "Move point to the end of a block. |
26225
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
3875 Which block depends on the value of NEST-LEVEL, which defaults to zero. |
73422
e1bac685e6a0
(ada-83-string-keywords, ada-last-which-function-line ada-no-auto-case,
Juanma Barranquero <lekktu@gmail.com>
parents:
71924
diff
changeset
|
3876 If NOERROR is non-nil, it only returns nil if no matching start found." |
44465
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
3877 (let ((nest-count (or nest-level 0)) |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
3878 (regex (eval-when-compile |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
3879 (concat "\\<" |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
3880 (regexp-opt '("end" "loop" "select" "begin" "case" |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
3881 "if" "task" "package" "record" "do" |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
3882 "procedure" "function") t) |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
3883 "\\>"))) |
50736
b0ce71ab9c28
(ada-search-directories): Take into account ADA_INCLUDE_PATH for better
Juanma Barranquero <lekktu@gmail.com>
parents:
49598
diff
changeset
|
3884 found |
73531
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3885 pos |
44465
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
3886 |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
3887 ;; First is used for subprograms: they are generally handled |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
3888 ;; recursively, but of course we do not want to do that the |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
3889 ;; first time (see comment below about subprograms) |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
3890 (first (not (looking-at "declare")))) |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
3891 |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
3892 ;; If we are already looking at one of the keywords, this shouldn't count |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
3893 ;; in the nesting loop below, so we just make sure we don't count it. |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
3894 ;; "declare" is a special case because we need to look after the "begin" |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
3895 ;; keyword |
50736
b0ce71ab9c28
(ada-search-directories): Take into account ADA_INCLUDE_PATH for better
Juanma Barranquero <lekktu@gmail.com>
parents:
49598
diff
changeset
|
3896 (if (looking-at "\\<if\\|loop\\|case\\|begin\\>") |
44465
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
3897 (forward-char 1)) |
10705 | 3898 |
3899 ;; | |
3900 ;; search forward for interesting keywords | |
3901 ;; | |
3902 (while (and | |
73531
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3903 (not found) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3904 (ada-search-ignore-string-comment regex nil)) |
10705 | 3905 |
3906 ;; | |
3907 ;; calculate nest-depth | |
3908 ;; | |
3909 (backward-word 1) | |
3910 (cond | |
44465
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
3911 ;; procedures and functions need to be processed recursively, in |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
3912 ;; case they are defined in a declare/begin block, as in: |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
3913 ;; declare -- NL 0 (nested level) |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
3914 ;; A : Boolean; |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
3915 ;; procedure B (C : D) is |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
3916 ;; begin -- NL 1 |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
3917 ;; null; |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
3918 ;; end B; -- NL 0, and we would exit |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
3919 ;; begin |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
3920 ;; end; -- we should exit here |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
3921 ;; processing them recursively avoids the need for any special |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
3922 ;; handling. |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
3923 ;; Nothing should be done if we have only the specs or a |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
3924 ;; generic instantion. |
49598
0d8b17d428b5
Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
45931
diff
changeset
|
3925 |
44465
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
3926 ((and (looking-at "\\<procedure\\|function\\>")) |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
3927 (if first |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
3928 (forward-word 1) |
50736
b0ce71ab9c28
(ada-search-directories): Take into account ADA_INCLUDE_PATH for better
Juanma Barranquero <lekktu@gmail.com>
parents:
49598
diff
changeset
|
3929 |
b0ce71ab9c28
(ada-search-directories): Take into account ADA_INCLUDE_PATH for better
Juanma Barranquero <lekktu@gmail.com>
parents:
49598
diff
changeset
|
3930 (setq pos (point)) |
44465
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
3931 (ada-search-ignore-string-comment "is\\|;") |
50736
b0ce71ab9c28
(ada-search-directories): Take into account ADA_INCLUDE_PATH for better
Juanma Barranquero <lekktu@gmail.com>
parents:
49598
diff
changeset
|
3932 (if (= (char-before) ?s) |
b0ce71ab9c28
(ada-search-directories): Take into account ADA_INCLUDE_PATH for better
Juanma Barranquero <lekktu@gmail.com>
parents:
49598
diff
changeset
|
3933 (progn |
b0ce71ab9c28
(ada-search-directories): Take into account ADA_INCLUDE_PATH for better
Juanma Barranquero <lekktu@gmail.com>
parents:
49598
diff
changeset
|
3934 (ada-goto-next-non-ws) |
b0ce71ab9c28
(ada-search-directories): Take into account ADA_INCLUDE_PATH for better
Juanma Barranquero <lekktu@gmail.com>
parents:
49598
diff
changeset
|
3935 (unless (looking-at "\\<new\\>") |
b0ce71ab9c28
(ada-search-directories): Take into account ADA_INCLUDE_PATH for better
Juanma Barranquero <lekktu@gmail.com>
parents:
49598
diff
changeset
|
3936 (progn |
b0ce71ab9c28
(ada-search-directories): Take into account ADA_INCLUDE_PATH for better
Juanma Barranquero <lekktu@gmail.com>
parents:
49598
diff
changeset
|
3937 (goto-char pos) |
b0ce71ab9c28
(ada-search-directories): Take into account ADA_INCLUDE_PATH for better
Juanma Barranquero <lekktu@gmail.com>
parents:
49598
diff
changeset
|
3938 (ada-goto-matching-end 0 t))))))) |
49598
0d8b17d428b5
Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
45931
diff
changeset
|
3939 |
10705 | 3940 ;; found block end => decrease nest depth |
3941 ((looking-at "\\<end\\>") | |
73531
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3942 (setq nest-count (1- nest-count) |
44465
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
3943 found (<= nest-count 0)) |
73531
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3944 ;; skip the following keyword |
44465
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
3945 (if (progn |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
3946 (skip-chars-forward "end") |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
3947 (ada-goto-next-non-ws) |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
3948 (looking-at "\\<\\(loop\\|select\\|record\\|case\\|if\\)\\>")) |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
3949 (forward-word 1))) |
49598
0d8b17d428b5
Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
45931
diff
changeset
|
3950 |
44465
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
3951 ;; found package start => check if it really starts a block, and is not |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
3952 ;; in fact a generic instantiation for instance |
10705 | 3953 ((looking-at "\\<package\\>") |
73531
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3954 (ada-search-ignore-string-comment "is" nil nil nil |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3955 'word-search-forward) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3956 (ada-goto-next-non-ws) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3957 ;; ignore and skip it if it is only a 'new' package |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3958 (if (looking-at "\\<new\\>") |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3959 (goto-char (match-end 0)) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3960 (setq nest-count (1+ nest-count) |
44465
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
3961 found (<= nest-count 0)))) |
49598
0d8b17d428b5
Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
45931
diff
changeset
|
3962 |
10705 | 3963 ;; all the other block starts |
3964 (t | |
50736
b0ce71ab9c28
(ada-search-directories): Take into account ADA_INCLUDE_PATH for better
Juanma Barranquero <lekktu@gmail.com>
parents:
49598
diff
changeset
|
3965 (if (not first) |
b0ce71ab9c28
(ada-search-directories): Take into account ADA_INCLUDE_PATH for better
Juanma Barranquero <lekktu@gmail.com>
parents:
49598
diff
changeset
|
3966 (setq nest-count (1+ nest-count))) |
b0ce71ab9c28
(ada-search-directories): Take into account ADA_INCLUDE_PATH for better
Juanma Barranquero <lekktu@gmail.com>
parents:
49598
diff
changeset
|
3967 (setq found (<= nest-count 0)) |
73531
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3968 (forward-word 1))) ; end of 'cond' |
10705 | 3969 |
44465
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
3970 (setq first nil)) |
25903
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
3971 |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
3972 (if found |
73531
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3973 t |
25903
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
3974 (if noerror |
73531
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3975 nil |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3976 (error "No matching end"))) |
25903
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
3977 )) |
10705 | 3978 |
3979 | |
3980 (defun ada-search-ignore-string-comment | |
30411
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
3981 (search-re &optional backward limit paramlists search-func) |
26225
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
3982 "Regexp-search for SEARCH-RE, ignoring comments, strings. |
73531
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3983 Returns a cons cell of begin and end of match data or nil, if not found. |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3984 If BACKWARD is non-nil, search backward; search forward otherwise. |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3985 The search stops at pos LIMIT. |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3986 If PARAMLISTS is nil, ignore parameter lists. |
78600
4f60c94dc647
Fix up comment style in header.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
78589
diff
changeset
|
3987 The search is done using SEARCH-FUNC. SEARCH-FUNC can be optimized |
63528
d6d50a511d12
(ada-format-paramlist)
Juanma Barranquero <lekktu@gmail.com>
parents:
63425
diff
changeset
|
3988 in case we are searching for a constant string. |
d6d50a511d12
(ada-format-paramlist)
Juanma Barranquero <lekktu@gmail.com>
parents:
63425
diff
changeset
|
3989 Point is moved at the beginning of the SEARCH-RE." |
25903
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
3990 (let (found |
73531
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3991 begin |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3992 end |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3993 parse-result |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3994 (previous-syntax-table (syntax-table))) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3995 |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
3996 ;; FIXME: need to pass BACKWARD to search-func! |
25903
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
3997 (unless search-func |
33716
c55ff055c68a
(ada-mode): `set '' -> `setq'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
32300
diff
changeset
|
3998 (setq search-func (if backward 're-search-backward 're-search-forward))) |
10705 | 3999 |
4000 ;; | |
4001 ;; search until found or end-of-buffer | |
25903
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
4002 ;; We have to test that we do not look further than limit |
10705 | 4003 ;; |
25903
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
4004 (set-syntax-table ada-mode-symbol-syntax-table) |
10705 | 4005 (while (and (not found) |
73531
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
4006 (or (not limit) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
4007 (or (and backward (<= limit (point))) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
4008 (>= limit (point)))) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
4009 (funcall search-func search-re limit 1)) |
33716
c55ff055c68a
(ada-mode): `set '' -> `setq'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
32300
diff
changeset
|
4010 (setq begin (match-beginning 0)) |
c55ff055c68a
(ada-mode): `set '' -> `setq'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
32300
diff
changeset
|
4011 (setq end (match-end 0)) |
c55ff055c68a
(ada-mode): `set '' -> `setq'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
32300
diff
changeset
|
4012 |
c55ff055c68a
(ada-mode): `set '' -> `setq'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
32300
diff
changeset
|
4013 (setq parse-result (parse-partial-sexp |
73531
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
4014 (save-excursion (beginning-of-line) (point)) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
4015 (point))) |
10705 | 4016 |
4017 (cond | |
4018 ;; | |
25903
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
4019 ;; If inside a string, skip it (and the following comments) |
10705 | 4020 ;; |
25903
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
4021 ((ada-in-string-p parse-result) |
73531
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
4022 (if (featurep 'xemacs) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
4023 (search-backward "\"" nil t) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
4024 (goto-char (nth 8 parse-result))) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
4025 (unless backward (forward-sexp 1))) |
10705 | 4026 ;; |
25903
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
4027 ;; If inside a comment, skip it (and the following comments) |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
4028 ;; There is a special code for comments at the end of the file |
10705 | 4029 ;; |
25903
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
4030 ((ada-in-comment-p parse-result) |
73531
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
4031 (if (featurep 'xemacs) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
4032 (progn |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
4033 (forward-line 1) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
4034 (beginning-of-line) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
4035 (forward-comment -1)) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
4036 (goto-char (nth 8 parse-result))) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
4037 (unless backward |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
4038 ;; at the end of the file, it is not possible to skip a comment |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
4039 ;; so we just go at the end of the line |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
4040 (if (forward-comment 1) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
4041 (progn |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
4042 (forward-comment 1000) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
4043 (beginning-of-line)) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
4044 (end-of-line)))) |
10705 | 4045 ;; |
25903
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
4046 ;; directly in front of a comment => skip it, if searching forward |
10705 | 4047 ;; |
25903
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
4048 ((and (= (char-after begin) ?-) (= (char-after (1+ begin)) ?-)) |
73531
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
4049 (unless backward (progn (forward-char -1) (forward-comment 1000)))) |
25903
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
4050 |
10705 | 4051 ;; |
4052 ;; found a parameter-list but should ignore it => skip it | |
4053 ;; | |
25903
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
4054 ((and (not paramlists) (ada-in-paramlist-p)) |
73531
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
4055 (if backward |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
4056 (search-backward "(" nil t) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
4057 (search-forward ")" nil t))) |
10705 | 4058 ;; |
4059 ;; found what we were looking for | |
4060 ;; | |
4061 (t | |
73531
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
4062 (setq found t)))) ; end of loop |
25903
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
4063 |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
4064 (set-syntax-table previous-syntax-table) |
10705 | 4065 |
4066 (if found | |
73531
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
4067 (cons begin end) |
10705 | 4068 nil))) |
4069 | |
26225
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
4070 ;; ------------------------------------------------------- |
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
4071 ;; -- Testing the position of the cursor |
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
4072 ;; ------------------------------------------------------- |
10705 | 4073 |
4074 (defun ada-in-decl-p () | |
63528
d6d50a511d12
(ada-format-paramlist)
Juanma Barranquero <lekktu@gmail.com>
parents:
63425
diff
changeset
|
4075 "Return t if point is inside a declarative part. |
26225
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
4076 Assumes point to be at the end of a statement." |
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
4077 (or (ada-in-paramlist-p) |
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
4078 (save-excursion |
73531
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
4079 (ada-goto-matching-decl-start t)))) |
10705 | 4080 |
4081 | |
4082 (defun ada-looking-at-semi-or () | |
63528
d6d50a511d12
(ada-format-paramlist)
Juanma Barranquero <lekktu@gmail.com>
parents:
63425
diff
changeset
|
4083 "Return t if looking at an 'or' following a semicolon." |
10705 | 4084 (save-excursion |
4085 (and (looking-at "\\<or\\>") | |
73531
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
4086 (progn |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
4087 (forward-word 1) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
4088 (ada-goto-stmt-start) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
4089 (looking-at "\\<or\\>"))))) |
10705 | 4090 |
4091 | |
4092 (defun ada-looking-at-semi-private () | |
63528
d6d50a511d12
(ada-format-paramlist)
Juanma Barranquero <lekktu@gmail.com>
parents:
63425
diff
changeset
|
4093 "Return t if looking at the start of a private section in a package. |
73422
e1bac685e6a0
(ada-83-string-keywords, ada-last-which-function-line ada-no-auto-case,
Juanma Barranquero <lekktu@gmail.com>
parents:
71924
diff
changeset
|
4094 Return nil if the private is part of the package name, as in |
26225
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
4095 'private package A is...' (this can only happen at top level)." |
10705 | 4096 (save-excursion |
4097 (and (looking-at "\\<private\\>") | |
73531
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
4098 (not (looking-at "\\<private[ \t]*\\(package\\|generic\\)")) |
30411
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
4099 |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
4100 ;; Make sure this is the start of a private section (ie after |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
4101 ;; a semicolon or just after the package declaration, but not |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
4102 ;; after a 'type ... is private' or 'is new ... with private' |
44465
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
4103 ;; |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
4104 ;; Note that a 'private' statement at the beginning of the buffer |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
4105 ;; does not indicate a private section, since this is instead a |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
4106 ;; 'private procedure ...' |
33786
9f63b158eb6b
* simple.el (delete-trailing-whitespace): New interactive function.
Sam Steingold <sds@gnu.org>
parents:
33716
diff
changeset
|
4107 (progn (forward-comment -1000) |
44465
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
4108 (and (not (bobp)) |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
4109 (or (= (char-before) ?\;) |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
4110 (and (forward-word -3) |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
4111 (looking-at "\\<package\\>")))))))) |
30411
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
4112 |
10705 | 4113 |
4114 (defun ada-in-paramlist-p () | |
63528
d6d50a511d12
(ada-format-paramlist)
Juanma Barranquero <lekktu@gmail.com>
parents:
63425
diff
changeset
|
4115 "Return t if point is inside a parameter-list." |
10705 | 4116 (save-excursion |
4117 (and | |
30411
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
4118 (ada-search-ignore-string-comment "(\\|)" t nil t) |
10705 | 4119 ;; inside parentheses ? |
25903
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
4120 (= (char-after) ?\() |
30411
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
4121 |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
4122 ;; We could be looking at two things here: |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
4123 ;; operator definition: function "." ( |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
4124 ;; subprogram definition: procedure .... ( |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
4125 ;; Let's skip back over the first one |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
4126 (progn |
44465
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
4127 (skip-chars-backward " \t\n") |
30411
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
4128 (if (= (char-before) ?\") |
73531
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
4129 (backward-char 3) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
4130 (backward-word 1)) |
30411
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
4131 t) |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
4132 |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
4133 ;; and now over the second one |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
4134 (backward-word 1) |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
4135 |
25903
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
4136 ;; We should ignore the case when the reserved keyword is in a |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
4137 ;; comment (for instance, when we have: |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
4138 ;; -- .... package |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
4139 ;; Test (A) |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
4140 ;; we should return nil |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
4141 |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
4142 (not (ada-in-string-or-comment-p)) |
30411
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
4143 |
25903
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
4144 ;; right keyword two words before parenthesis ? |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
4145 ;; Type is in this list because of discriminants |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
4146 (looking-at (eval-when-compile |
73531
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
4147 (concat "\\<\\(" |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
4148 "procedure\\|function\\|body\\|" |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
4149 "task\\|entry\\|accept\\|" |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
4150 "access[ \t]+procedure\\|" |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
4151 "access[ \t]+function\\|" |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
4152 "pragma\\|" |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
4153 "type\\)\\>")))))) |
10705 | 4154 |
30411
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
4155 (defun ada-search-ignore-complex-boolean (regexp backwardp) |
73531
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
4156 "Search for REGEXP, ignoring comments, strings, 'and then', 'or else'. |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
4157 If BACKWARDP is non-nil, search backward; search forward otherwise." |
30411
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
4158 (let (result) |
33716
c55ff055c68a
(ada-mode): `set '' -> `setq'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
32300
diff
changeset
|
4159 (while (and (setq result (ada-search-ignore-string-comment regexp backwardp)) |
30411
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
4160 (save-excursion (forward-word -1) |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
4161 (looking-at "and then\\|or else")))) |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
4162 result)) |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
4163 |
10705 | 4164 (defun ada-in-open-paren-p () |
73531
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
4165 "Non-nil if in an open parenthesis. |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
4166 Return value is the position of the first non-ws behind the last unclosed |
26225
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
4167 parenthesis, or nil." |
25903
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
4168 (save-excursion |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
4169 (let ((parse (parse-partial-sexp |
73531
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
4170 (point) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
4171 (or (car (ada-search-ignore-complex-boolean |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
4172 "\\<\\(;\\|is\\|then\\|loop\\|begin\\|else\\)\\>" |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
4173 t)) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
4174 (point-min))))) |
30411
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
4175 |
25903
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
4176 (if (nth 1 parse) |
73531
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
4177 (progn |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
4178 (goto-char (1+ (nth 1 parse))) |
44465
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
4179 |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
4180 ;; Skip blanks, if they are not followed by a comment |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
4181 ;; See: |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
4182 ;; type A is ( Value_0, |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
4183 ;; Value_1); |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
4184 ;; type B is ( -- comment |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
4185 ;; Value_2); |
49598
0d8b17d428b5
Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
45931
diff
changeset
|
4186 |
44465
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
4187 (if (or (not ada-indent-handle-comment-special) |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
4188 (not (looking-at "[ \t]+--"))) |
73531
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
4189 (skip-chars-forward " \t")) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
4190 |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
4191 (point)))))) |
10705 | 4192 |
4193 | |
30411
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
4194 ;; ----------------------------------------------------------- |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
4195 ;; -- Behavior Of TAB Key |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
4196 ;; ----------------------------------------------------------- |
26225
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
4197 |
10705 | 4198 (defun ada-tab () |
25903
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
4199 "Do indenting or tabbing according to `ada-tab-policy'. |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
4200 In Transient Mark mode, if the mark is active, operate on the contents |
63528
d6d50a511d12
(ada-format-paramlist)
Juanma Barranquero <lekktu@gmail.com>
parents:
63425
diff
changeset
|
4201 of the region. Otherwise, operate only on the current line." |
10705 | 4202 (interactive) |
25903
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
4203 (cond ((eq ada-tab-policy 'indent-rigidly) (ada-tab-hard)) |
73531
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
4204 ((eq ada-tab-policy 'indent-auto) |
44465
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
4205 (if (ada-region-selected) |
73531
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
4206 (ada-indent-region (region-beginning) (region-end)) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
4207 (ada-indent-current))) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
4208 ((eq ada-tab-policy 'always-tab) (error "Not implemented")) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
4209 )) |
10705 | 4210 |
4211 (defun ada-untab (arg) | |
4212 "Delete leading indenting according to `ada-tab-policy'." | |
73531
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
4213 ;; FIXME: ARG is ignored |
10705 | 4214 (interactive "P") |
4215 (cond ((eq ada-tab-policy 'indent-rigidly) (ada-untab-hard)) | |
73531
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
4216 ((eq ada-tab-policy 'indent-auto) (error "Not implemented")) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
4217 ((eq ada-tab-policy 'always-tab) (error "Not implemented")) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
4218 )) |
10705 | 4219 |
4220 (defun ada-indent-current-function () | |
63528
d6d50a511d12
(ada-format-paramlist)
Juanma Barranquero <lekktu@gmail.com>
parents:
63425
diff
changeset
|
4221 "Ada mode version of the `indent-line-function'." |
10705 | 4222 (interactive "*") |
4223 (let ((starting-point (point-marker))) | |
25903
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
4224 (beginning-of-line) |
10705 | 4225 (ada-tab) |
4226 (if (< (point) starting-point) | |
73531
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
4227 (goto-char starting-point)) |
10705 | 4228 (set-marker starting-point nil) |
4229 )) | |
4230 | |
4231 (defun ada-tab-hard () | |
4232 "Indent current line to next tab stop." | |
4233 (interactive) | |
4234 (save-excursion | |
4235 (beginning-of-line) | |
4236 (insert-char ? ada-indent)) | |
4237 (if (save-excursion (= (point) (progn (beginning-of-line) (point)))) | |
4238 (forward-char ada-indent))) | |
4239 | |
4240 (defun ada-untab-hard () | |
63528
d6d50a511d12
(ada-format-paramlist)
Juanma Barranquero <lekktu@gmail.com>
parents:
63425
diff
changeset
|
4241 "Indent current line to previous tab stop." |
10705 | 4242 (interactive) |
73434
3586ad4a01a1
(ada-in-string-p): Doc fix.
Juanma Barranquero <lekktu@gmail.com>
parents:
73422
diff
changeset
|
4243 (let ((bol (save-excursion (progn (beginning-of-line) (point)))) |
73531
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
4244 (eol (save-excursion (progn (end-of-line) (point))))) |
73434
3586ad4a01a1
(ada-in-string-p): Doc fix.
Juanma Barranquero <lekktu@gmail.com>
parents:
73422
diff
changeset
|
4245 (indent-rigidly bol eol (- 0 ada-indent)))) |
10705 | 4246 |
4247 | |
4248 | |
26225
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
4249 ;; ------------------------------------------------------------ |
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
4250 ;; -- Miscellaneous |
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
4251 ;; ------------------------------------------------------------ |
10705 | 4252 |
44465
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
4253 ;; Not needed any more for Emacs 21.2, but still needed for backward |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
4254 ;; compatibility |
73434
3586ad4a01a1
(ada-in-string-p): Doc fix.
Juanma Barranquero <lekktu@gmail.com>
parents:
73422
diff
changeset
|
4255 (defun ada-remove-trailing-spaces () |
44465
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
4256 "Remove trailing spaces in the whole buffer." |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
4257 (interactive) |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
4258 (save-match-data |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
4259 (save-excursion |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
4260 (save-restriction |
73531
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
4261 (widen) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
4262 (goto-char (point-min)) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
4263 (while (re-search-forward "[ \t]+$" (point-max) t) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
4264 (replace-match "" nil nil)))))) |
44465
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
4265 |
17914
e5e2ef0dd5ab
(ada-krunch-args): Use gnatkr instead of gnatk8.
Richard M. Stallman <rms@gnu.org>
parents:
14415
diff
changeset
|
4266 (defun ada-gnat-style () |
e5e2ef0dd5ab
(ada-krunch-args): Use gnatkr instead of gnatk8.
Richard M. Stallman <rms@gnu.org>
parents:
14415
diff
changeset
|
4267 "Clean up comments, `(' and `,' for GNAT style checking switch." |
e5e2ef0dd5ab
(ada-krunch-args): Use gnatkr instead of gnatk8.
Richard M. Stallman <rms@gnu.org>
parents:
14415
diff
changeset
|
4268 (interactive) |
e5e2ef0dd5ab
(ada-krunch-args): Use gnatkr instead of gnatk8.
Richard M. Stallman <rms@gnu.org>
parents:
14415
diff
changeset
|
4269 (save-excursion |
44465
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
4270 |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
4271 ;; The \n is required, or the line after an empty comment line is |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
4272 ;; simply ignored. |
17914
e5e2ef0dd5ab
(ada-krunch-args): Use gnatkr instead of gnatk8.
Richard M. Stallman <rms@gnu.org>
parents:
14415
diff
changeset
|
4273 (goto-char (point-min)) |
44465
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
4274 (while (re-search-forward "--[ \t]*\\([^-\n]\\)" nil t) |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
4275 (replace-match "-- \\1") |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
4276 (forward-line 1) |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
4277 (beginning-of-line)) |
49598
0d8b17d428b5
Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
45931
diff
changeset
|
4278 |
17914
e5e2ef0dd5ab
(ada-krunch-args): Use gnatkr instead of gnatk8.
Richard M. Stallman <rms@gnu.org>
parents:
14415
diff
changeset
|
4279 (goto-char (point-min)) |
e5e2ef0dd5ab
(ada-krunch-args): Use gnatkr instead of gnatk8.
Richard M. Stallman <rms@gnu.org>
parents:
14415
diff
changeset
|
4280 (while (re-search-forward "\\>(" nil t) |
44465
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
4281 (if (not (ada-in-string-or-comment-p)) |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
4282 (replace-match " ("))) |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
4283 (goto-char (point-min)) |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
4284 (while (re-search-forward ";--" nil t) |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
4285 (forward-char -1) |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
4286 (if (not (ada-in-string-or-comment-p)) |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
4287 (replace-match "; --"))) |
17914
e5e2ef0dd5ab
(ada-krunch-args): Use gnatkr instead of gnatk8.
Richard M. Stallman <rms@gnu.org>
parents:
14415
diff
changeset
|
4288 (goto-char (point-min)) |
30411
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
4289 (while (re-search-forward "([ \t]+" nil t) |
44465
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
4290 (if (not (ada-in-string-or-comment-p)) |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
4291 (replace-match "("))) |
30411
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
4292 (goto-char (point-min)) |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
4293 (while (re-search-forward ")[ \t]+)" nil t) |
44465
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
4294 (if (not (ada-in-string-or-comment-p)) |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
4295 (replace-match "))"))) |
30411
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
4296 (goto-char (point-min)) |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
4297 (while (re-search-forward "\\>:" nil t) |
44465
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
4298 (if (not (ada-in-string-or-comment-p)) |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
4299 (replace-match " :"))) |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
4300 |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
4301 ;; Make sure there is a space after a ','. |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
4302 ;; Always go back to the beginning of the match, since otherwise |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
4303 ;; a statement like ('F','D','E') is incorrectly modified. |
30411
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
4304 (goto-char (point-min)) |
44465
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
4305 (while (re-search-forward ",[ \t]*\\(.\\)" nil t) |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
4306 (if (not (save-excursion |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
4307 (goto-char (match-beginning 0)) |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
4308 (ada-in-string-or-comment-p))) |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
4309 (replace-match ", \\1"))) |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
4310 |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
4311 ;; Operators should be surrounded by spaces. |
30411
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
4312 (goto-char (point-min)) |
44465
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
4313 (while (re-search-forward |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
4314 "[ \t]*\\(/=\\|\\*\\*\\|:=\\|\\.\\.\\|[-:+*/]\\)[ \t]*" |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
4315 nil t) |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
4316 (goto-char (match-beginning 1)) |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
4317 (if (or (looking-at "--") |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
4318 (ada-in-string-or-comment-p)) |
30411
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
4319 (progn |
44465
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
4320 (forward-line 1) |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
4321 (beginning-of-line)) |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
4322 (cond |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
4323 ((string= (match-string 1) "/=") |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
4324 (replace-match " /= ")) |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
4325 ((string= (match-string 1) "..") |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
4326 (replace-match " .. ")) |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
4327 ((string= (match-string 1) "**") |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
4328 (replace-match " ** ")) |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
4329 ((string= (match-string 1) ":=") |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
4330 (replace-match " := ")) |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
4331 (t |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
4332 (replace-match " \\1 "))) |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
4333 (forward-char 1))) |
17914
e5e2ef0dd5ab
(ada-krunch-args): Use gnatkr instead of gnatk8.
Richard M. Stallman <rms@gnu.org>
parents:
14415
diff
changeset
|
4334 )) |
e5e2ef0dd5ab
(ada-krunch-args): Use gnatkr instead of gnatk8.
Richard M. Stallman <rms@gnu.org>
parents:
14415
diff
changeset
|
4335 |
e5e2ef0dd5ab
(ada-krunch-args): Use gnatkr instead of gnatk8.
Richard M. Stallman <rms@gnu.org>
parents:
14415
diff
changeset
|
4336 |
10705 | 4337 |
26225
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
4338 ;; ------------------------------------------------------------- |
30411
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
4339 ;; -- Moving To Procedures/Packages/Statements |
26225
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
4340 ;; ------------------------------------------------------------- |
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
4341 |
30411
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
4342 (defun ada-move-to-start () |
63528
d6d50a511d12
(ada-format-paramlist)
Juanma Barranquero <lekktu@gmail.com>
parents:
63425
diff
changeset
|
4343 "Move point to the matching start of the current Ada structure." |
30411
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
4344 (interactive) |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
4345 (let ((pos (point)) |
73531
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
4346 (previous-syntax-table (syntax-table))) |
30411
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
4347 (unwind-protect |
73531
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
4348 (progn |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
4349 (set-syntax-table ada-mode-symbol-syntax-table) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
4350 |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
4351 (save-excursion |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
4352 ;; |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
4353 ;; do nothing if in string or comment or not on 'end ...;' |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
4354 ;; or if an error occurs during processing |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
4355 ;; |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
4356 (or |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
4357 (ada-in-string-or-comment-p) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
4358 (and (progn |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
4359 (or (looking-at "[ \t]*\\<end\\>") |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
4360 (backward-word 1)) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
4361 (or (looking-at "[ \t]*\\<end\\>") |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
4362 (backward-word 1)) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
4363 (or (looking-at "[ \t]*\\<end\\>") |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
4364 (error "Not on end ...;"))) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
4365 (ada-goto-matching-start 1) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
4366 (setq pos (point)) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
4367 |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
4368 ;; |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
4369 ;; on 'begin' => go on, according to user option |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
4370 ;; |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
4371 ada-move-to-declaration |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
4372 (looking-at "\\<begin\\>") |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
4373 (ada-goto-matching-decl-start) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
4374 (setq pos (point)))) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
4375 |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
4376 ) ; end of save-excursion |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
4377 |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
4378 ;; now really move to the found position |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
4379 (goto-char pos)) |
30411
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
4380 |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
4381 ;; restore syntax-table |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
4382 (set-syntax-table previous-syntax-table)))) |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
4383 |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
4384 (defun ada-move-to-end () |
63528
d6d50a511d12
(ada-format-paramlist)
Juanma Barranquero <lekktu@gmail.com>
parents:
63425
diff
changeset
|
4385 "Move point to the matching end of the block around point. |
30411
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
4386 Moves to 'begin' if in a declarative part." |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
4387 (interactive) |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
4388 (let ((pos (point)) |
44465
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
4389 decl-start |
73531
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
4390 (previous-syntax-table (syntax-table))) |
30411
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
4391 (unwind-protect |
73531
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
4392 (progn |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
4393 (set-syntax-table ada-mode-symbol-syntax-table) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
4394 |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
4395 (save-excursion |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
4396 |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
4397 (cond |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
4398 ;; Go to the beginning of the current word, and check if we are |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
4399 ;; directly on 'begin' |
44465
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
4400 ((save-excursion |
45931
a4c8d672ccbe
* progmodes/ada-mode.el: Update copyright notice.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
44933
diff
changeset
|
4401 (skip-syntax-backward "w") |
44465
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
4402 (looking-at "\\<begin\\>")) |
50736
b0ce71ab9c28
(ada-search-directories): Take into account ADA_INCLUDE_PATH for better
Juanma Barranquero <lekktu@gmail.com>
parents:
49598
diff
changeset
|
4403 (ada-goto-matching-end 1) |
b0ce71ab9c28
(ada-search-directories): Take into account ADA_INCLUDE_PATH for better
Juanma Barranquero <lekktu@gmail.com>
parents:
49598
diff
changeset
|
4404 ) |
49598
0d8b17d428b5
Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
45931
diff
changeset
|
4405 |
44465
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
4406 ;; on first line of subprogram body |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
4407 ;; Do nothing for specs or generic instantion, since these are |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
4408 ;; handled as the general case (find the enclosing block) |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
4409 ;; We also need to make sure that we ignore nested subprograms |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
4410 ((save-excursion |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
4411 (and (skip-syntax-backward "w") |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
4412 (looking-at "\\<function\\>\\|\\<procedure\\>" ) |
73531
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
4413 (ada-search-ignore-string-comment "is\\|;") |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
4414 (not (= (char-before) ?\;)) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
4415 )) |
44465
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
4416 (skip-syntax-backward "w") |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
4417 (ada-goto-matching-end 0 t)) |
49598
0d8b17d428b5
Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
45931
diff
changeset
|
4418 |
73531
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
4419 ;; on first line of task declaration |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
4420 ((save-excursion |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
4421 (and (ada-goto-stmt-start) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
4422 (looking-at "\\<task\\>" ) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
4423 (forward-word 1) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
4424 (ada-goto-next-non-ws) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
4425 (looking-at "\\<body\\>"))) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
4426 (ada-search-ignore-string-comment "begin" nil nil nil |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
4427 'word-search-forward)) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
4428 ;; accept block start |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
4429 ((save-excursion |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
4430 (and (ada-goto-stmt-start) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
4431 (looking-at "\\<accept\\>" ))) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
4432 (ada-goto-matching-end 0)) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
4433 ;; package start |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
4434 ((save-excursion |
44465
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
4435 (setq decl-start (and (ada-goto-matching-decl-start t) (point))) |
73531
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
4436 (and decl-start (looking-at "\\<package\\>"))) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
4437 (ada-goto-matching-end 1)) |
45931
a4c8d672ccbe
* progmodes/ada-mode.el: Update copyright notice.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
44933
diff
changeset
|
4438 |
a4c8d672ccbe
* progmodes/ada-mode.el: Update copyright notice.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
44933
diff
changeset
|
4439 ;; On a "declare" keyword |
a4c8d672ccbe
* progmodes/ada-mode.el: Update copyright notice.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
44933
diff
changeset
|
4440 ((save-excursion |
a4c8d672ccbe
* progmodes/ada-mode.el: Update copyright notice.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
44933
diff
changeset
|
4441 (skip-syntax-backward "w") |
a4c8d672ccbe
* progmodes/ada-mode.el: Update copyright notice.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
44933
diff
changeset
|
4442 (looking-at "\\<declare\\>")) |
a4c8d672ccbe
* progmodes/ada-mode.el: Update copyright notice.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
44933
diff
changeset
|
4443 (ada-goto-matching-end 0 t)) |
49598
0d8b17d428b5
Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
45931
diff
changeset
|
4444 |
73531
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
4445 ;; inside a 'begin' ... 'end' block |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
4446 (decl-start |
44465
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
4447 (goto-char decl-start) |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
4448 (ada-goto-matching-end 0 t)) |
49598
0d8b17d428b5
Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
45931
diff
changeset
|
4449 |
73531
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
4450 ;; (hopefully ;-) everything else |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
4451 (t |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
4452 (ada-goto-matching-end 1))) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
4453 (setq pos (point)) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
4454 ) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
4455 |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
4456 ;; now really move to the position found |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
4457 (goto-char pos)) |
30411
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
4458 |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
4459 ;; restore syntax-table |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
4460 (set-syntax-table previous-syntax-table)))) |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
4461 |
10705 | 4462 (defun ada-next-procedure () |
63528
d6d50a511d12
(ada-format-paramlist)
Juanma Barranquero <lekktu@gmail.com>
parents:
63425
diff
changeset
|
4463 "Move point to next procedure." |
10705 | 4464 (interactive) |
4465 (end-of-line) | |
4466 (if (re-search-forward ada-procedure-start-regexp nil t) | |
73922
289cedd46cd8
Delete `eval-and-compile' around `require'.
Juanma Barranquero <lekktu@gmail.com>
parents:
73531
diff
changeset
|
4467 (goto-char (match-beginning 4)) |
10705 | 4468 (error "No more functions/procedures/tasks"))) |
4469 | |
4470 (defun ada-previous-procedure () | |
63528
d6d50a511d12
(ada-format-paramlist)
Juanma Barranquero <lekktu@gmail.com>
parents:
63425
diff
changeset
|
4471 "Move point to previous procedure." |
10705 | 4472 (interactive) |
4473 (beginning-of-line) | |
4474 (if (re-search-backward ada-procedure-start-regexp nil t) | |
73922
289cedd46cd8
Delete `eval-and-compile' around `require'.
Juanma Barranquero <lekktu@gmail.com>
parents:
73531
diff
changeset
|
4475 (goto-char (match-beginning 4)) |
10705 | 4476 (error "No more functions/procedures/tasks"))) |
4477 | |
4478 (defun ada-next-package () | |
63528
d6d50a511d12
(ada-format-paramlist)
Juanma Barranquero <lekktu@gmail.com>
parents:
63425
diff
changeset
|
4479 "Move point to next package." |
10705 | 4480 (interactive) |
4481 (end-of-line) | |
4482 (if (re-search-forward ada-package-start-regexp nil t) | |
4483 (goto-char (match-beginning 1)) | |
4484 (error "No more packages"))) | |
4485 | |
4486 (defun ada-previous-package () | |
63528
d6d50a511d12
(ada-format-paramlist)
Juanma Barranquero <lekktu@gmail.com>
parents:
63425
diff
changeset
|
4487 "Move point to previous package." |
10705 | 4488 (interactive) |
4489 (beginning-of-line) | |
4490 (if (re-search-backward ada-package-start-regexp nil t) | |
4491 (goto-char (match-beginning 1)) | |
4492 (error "No more packages"))) | |
4493 | |
4494 | |
26225
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
4495 ;; ------------------------------------------------------------ |
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
4496 ;; -- Define keymap and menus for Ada |
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
4497 ;; ------------------------------------------------------------- |
10705 | 4498 |
25903
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
4499 (defun ada-create-keymap () |
26225
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
4500 "Create the keymap associated with the Ada mode." |
25903
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
4501 |
95268
bcc553c768f9
* textmodes/reftex-vars.el (reftex-extra-bindings-prefix): New var.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
94673
diff
changeset
|
4502 ;; All non-standard keys go into ada-mode-extra-map |
bcc553c768f9
* textmodes/reftex-vars.el (reftex-extra-bindings-prefix): New var.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
94673
diff
changeset
|
4503 (define-key ada-mode-map ada-mode-extra-prefix ada-mode-extra-map) |
bcc553c768f9
* textmodes/reftex-vars.el (reftex-extra-bindings-prefix): New var.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
94673
diff
changeset
|
4504 |
25903
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
4505 ;; Indentation and Formatting |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
4506 (define-key ada-mode-map "\C-j" 'ada-indent-newline-indent-conditional) |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
4507 (define-key ada-mode-map "\C-m" 'ada-indent-newline-indent-conditional) |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
4508 (define-key ada-mode-map "\t" 'ada-tab) |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
4509 (define-key ada-mode-map "\C-c\t" 'ada-justified-indent-current) |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
4510 (define-key ada-mode-map "\C-c\C-l" 'ada-indent-region) |
78600
4f60c94dc647
Fix up comment style in header.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
78589
diff
changeset
|
4511 (define-key ada-mode-map [(shift tab)] 'ada-untab) |
25903
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
4512 (define-key ada-mode-map "\C-c\C-f" 'ada-format-paramlist) |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
4513 ;; We don't want to make meta-characters case-specific. |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
4514 |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
4515 ;; Movement |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
4516 (define-key ada-mode-map "\M-\C-e" 'ada-next-procedure) |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
4517 (define-key ada-mode-map "\M-\C-a" 'ada-previous-procedure) |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
4518 (define-key ada-mode-map "\C-c\C-a" 'ada-move-to-start) |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
4519 (define-key ada-mode-map "\C-c\C-e" 'ada-move-to-end) |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
4520 |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
4521 ;; Compilation |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
4522 (unless (lookup-key ada-mode-map "\C-c\C-c") |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
4523 (define-key ada-mode-map "\C-c\C-c" 'compile)) |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
4524 |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
4525 ;; Casing |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
4526 (define-key ada-mode-map "\C-c\C-b" 'ada-adjust-case-buffer) |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
4527 (define-key ada-mode-map "\C-c\C-t" 'ada-case-read-exceptions) |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
4528 (define-key ada-mode-map "\C-c\C-y" 'ada-create-case-exception) |
44465
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
4529 (define-key ada-mode-map "\C-c\C-\M-y" 'ada-create-case-exception-substring) |
25903
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
4530 |
30411
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
4531 ;; On XEmacs, you can easily specify whether DEL should deletes |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
4532 ;; one character forward or one character backward. Take this into |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
4533 ;; account |
78600
4f60c94dc647
Fix up comment style in header.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
78589
diff
changeset
|
4534 (define-key ada-mode-map |
4f60c94dc647
Fix up comment style in header.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
78589
diff
changeset
|
4535 (if (boundp 'delete-key-deletes-forward) [backspace] "\177") |
78601
047d1fc93812
(ada-create-keymap): Paren typo.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
78600
diff
changeset
|
4536 'backward-delete-char-untabify) |
25903
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
4537 |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
4538 ;; Make body |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
4539 (define-key ada-mode-map "\C-c\C-n" 'ada-make-subprogram-body) |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
4540 |
26225
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
4541 ;; Use predefined function of Emacs19 for comments (RE) |
25903
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
4542 (define-key ada-mode-map "\C-c;" 'comment-region) |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
4543 (define-key ada-mode-map "\C-c:" 'ada-uncomment-region) |
50736
b0ce71ab9c28
(ada-search-directories): Take into account ADA_INCLUDE_PATH for better
Juanma Barranquero <lekktu@gmail.com>
parents:
49598
diff
changeset
|
4544 |
b0ce71ab9c28
(ada-search-directories): Take into account ADA_INCLUDE_PATH for better
Juanma Barranquero <lekktu@gmail.com>
parents:
49598
diff
changeset
|
4545 ;; The following keys are bound to functions defined in ada-xref.el or |
b0ce71ab9c28
(ada-search-directories): Take into account ADA_INCLUDE_PATH for better
Juanma Barranquero <lekktu@gmail.com>
parents:
49598
diff
changeset
|
4546 ;; ada-prj,el., However, RMS rightly thinks that the code should be shared, |
b0ce71ab9c28
(ada-search-directories): Take into account ADA_INCLUDE_PATH for better
Juanma Barranquero <lekktu@gmail.com>
parents:
49598
diff
changeset
|
4547 ;; and activated only if the right compiler is used |
84917
e52cb6ef60ec
(ada-save-exceptions-to-file): Use `mapc' rather than `mapcar'.
Juanma Barranquero <lekktu@gmail.com>
parents:
78601
diff
changeset
|
4548 |
78600
4f60c94dc647
Fix up comment style in header.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
78589
diff
changeset
|
4549 (define-key ada-mode-map (if (featurep 'xemacs) '(shift button3) [S-mouse-3]) |
4f60c94dc647
Fix up comment style in header.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
78589
diff
changeset
|
4550 'ada-point-and-xref) |
4f60c94dc647
Fix up comment style in header.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
78589
diff
changeset
|
4551 (define-key ada-mode-map [(control tab)] 'ada-complete-identifier) |
50736
b0ce71ab9c28
(ada-search-directories): Take into account ADA_INCLUDE_PATH for better
Juanma Barranquero <lekktu@gmail.com>
parents:
49598
diff
changeset
|
4552 |
95268
bcc553c768f9
* textmodes/reftex-vars.el (reftex-extra-bindings-prefix): New var.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
94673
diff
changeset
|
4553 (define-key ada-mode-extra-map "o" 'ff-find-other-file) |
50736
b0ce71ab9c28
(ada-search-directories): Take into account ADA_INCLUDE_PATH for better
Juanma Barranquero <lekktu@gmail.com>
parents:
49598
diff
changeset
|
4554 (define-key ada-mode-map "\C-c5\C-d" 'ada-goto-declaration-other-frame) |
b0ce71ab9c28
(ada-search-directories): Take into account ADA_INCLUDE_PATH for better
Juanma Barranquero <lekktu@gmail.com>
parents:
49598
diff
changeset
|
4555 (define-key ada-mode-map "\C-c\C-d" 'ada-goto-declaration) |
b0ce71ab9c28
(ada-search-directories): Take into account ADA_INCLUDE_PATH for better
Juanma Barranquero <lekktu@gmail.com>
parents:
49598
diff
changeset
|
4556 (define-key ada-mode-map "\C-c\C-s" 'ada-xref-goto-previous-reference) |
b0ce71ab9c28
(ada-search-directories): Take into account ADA_INCLUDE_PATH for better
Juanma Barranquero <lekktu@gmail.com>
parents:
49598
diff
changeset
|
4557 (define-key ada-mode-map "\C-c\C-c" 'ada-compile-application) |
95268
bcc553c768f9
* textmodes/reftex-vars.el (reftex-extra-bindings-prefix): New var.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
94673
diff
changeset
|
4558 (define-key ada-mode-extra-map "c" 'ada-change-prj) |
bcc553c768f9
* textmodes/reftex-vars.el (reftex-extra-bindings-prefix): New var.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
94673
diff
changeset
|
4559 (define-key ada-mode-extra-map "d" 'ada-set-default-project-file) |
bcc553c768f9
* textmodes/reftex-vars.el (reftex-extra-bindings-prefix): New var.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
94673
diff
changeset
|
4560 (define-key ada-mode-extra-map "g" 'ada-gdb-application) |
74002
5909c257c4ea
(ada-mode-version): Bump version.
Juanma Barranquero <lekktu@gmail.com>
parents:
73935
diff
changeset
|
4561 (define-key ada-mode-map "\C-c\C-m" 'ada-set-main-compile-application) |
95268
bcc553c768f9
* textmodes/reftex-vars.el (reftex-extra-bindings-prefix): New var.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
94673
diff
changeset
|
4562 (define-key ada-mode-extra-map "r" 'ada-run-application) |
50736
b0ce71ab9c28
(ada-search-directories): Take into account ADA_INCLUDE_PATH for better
Juanma Barranquero <lekktu@gmail.com>
parents:
49598
diff
changeset
|
4563 (define-key ada-mode-map "\C-c\C-o" 'ada-goto-parent) |
b0ce71ab9c28
(ada-search-directories): Take into account ADA_INCLUDE_PATH for better
Juanma Barranquero <lekktu@gmail.com>
parents:
49598
diff
changeset
|
4564 (define-key ada-mode-map "\C-c\C-r" 'ada-find-references) |
95268
bcc553c768f9
* textmodes/reftex-vars.el (reftex-extra-bindings-prefix): New var.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
94673
diff
changeset
|
4565 (define-key ada-mode-extra-map "l" 'ada-find-local-references) |
50736
b0ce71ab9c28
(ada-search-directories): Take into account ADA_INCLUDE_PATH for better
Juanma Barranquero <lekktu@gmail.com>
parents:
49598
diff
changeset
|
4566 (define-key ada-mode-map "\C-c\C-v" 'ada-check-current) |
95268
bcc553c768f9
* textmodes/reftex-vars.el (reftex-extra-bindings-prefix): New var.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
94673
diff
changeset
|
4567 (define-key ada-mode-extra-map "f" 'ada-find-file) |
bcc553c768f9
* textmodes/reftex-vars.el (reftex-extra-bindings-prefix): New var.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
94673
diff
changeset
|
4568 |
bcc553c768f9
* textmodes/reftex-vars.el (reftex-extra-bindings-prefix): New var.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
94673
diff
changeset
|
4569 (define-key ada-mode-extra-map "u" 'ada-prj-edit) |
50736
b0ce71ab9c28
(ada-search-directories): Take into account ADA_INCLUDE_PATH for better
Juanma Barranquero <lekktu@gmail.com>
parents:
49598
diff
changeset
|
4570 |
106831
7fd22a65b1a9
* progmodes/ada-mode.el: Override `narrow-to-defun' with `ada-narrow-to-defun'.
Juanma Barranquero <lekktu@gmail.com>
parents:
106830
diff
changeset
|
4571 (define-key ada-mode-map "\C-xnd" 'ada-narrow-to-defun); override narrow-to-defun |
7fd22a65b1a9
* progmodes/ada-mode.el: Override `narrow-to-defun' with `ada-narrow-to-defun'.
Juanma Barranquero <lekktu@gmail.com>
parents:
106830
diff
changeset
|
4572 |
50736
b0ce71ab9c28
(ada-search-directories): Take into account ADA_INCLUDE_PATH for better
Juanma Barranquero <lekktu@gmail.com>
parents:
49598
diff
changeset
|
4573 ;; The templates, defined in ada-stmt.el |
b0ce71ab9c28
(ada-search-directories): Take into account ADA_INCLUDE_PATH for better
Juanma Barranquero <lekktu@gmail.com>
parents:
49598
diff
changeset
|
4574 |
b0ce71ab9c28
(ada-search-directories): Take into account ADA_INCLUDE_PATH for better
Juanma Barranquero <lekktu@gmail.com>
parents:
49598
diff
changeset
|
4575 (let ((map (make-sparse-keymap))) |
b0ce71ab9c28
(ada-search-directories): Take into account ADA_INCLUDE_PATH for better
Juanma Barranquero <lekktu@gmail.com>
parents:
49598
diff
changeset
|
4576 (define-key map "h" 'ada-header) |
b0ce71ab9c28
(ada-search-directories): Take into account ADA_INCLUDE_PATH for better
Juanma Barranquero <lekktu@gmail.com>
parents:
49598
diff
changeset
|
4577 (define-key map "\C-a" 'ada-array) |
b0ce71ab9c28
(ada-search-directories): Take into account ADA_INCLUDE_PATH for better
Juanma Barranquero <lekktu@gmail.com>
parents:
49598
diff
changeset
|
4578 (define-key map "b" 'ada-exception-block) |
b0ce71ab9c28
(ada-search-directories): Take into account ADA_INCLUDE_PATH for better
Juanma Barranquero <lekktu@gmail.com>
parents:
49598
diff
changeset
|
4579 (define-key map "d" 'ada-declare-block) |
b0ce71ab9c28
(ada-search-directories): Take into account ADA_INCLUDE_PATH for better
Juanma Barranquero <lekktu@gmail.com>
parents:
49598
diff
changeset
|
4580 (define-key map "c" 'ada-case) |
b0ce71ab9c28
(ada-search-directories): Take into account ADA_INCLUDE_PATH for better
Juanma Barranquero <lekktu@gmail.com>
parents:
49598
diff
changeset
|
4581 (define-key map "\C-e" 'ada-elsif) |
b0ce71ab9c28
(ada-search-directories): Take into account ADA_INCLUDE_PATH for better
Juanma Barranquero <lekktu@gmail.com>
parents:
49598
diff
changeset
|
4582 (define-key map "e" 'ada-else) |
b0ce71ab9c28
(ada-search-directories): Take into account ADA_INCLUDE_PATH for better
Juanma Barranquero <lekktu@gmail.com>
parents:
49598
diff
changeset
|
4583 (define-key map "\C-k" 'ada-package-spec) |
b0ce71ab9c28
(ada-search-directories): Take into account ADA_INCLUDE_PATH for better
Juanma Barranquero <lekktu@gmail.com>
parents:
49598
diff
changeset
|
4584 (define-key map "k" 'ada-package-body) |
b0ce71ab9c28
(ada-search-directories): Take into account ADA_INCLUDE_PATH for better
Juanma Barranquero <lekktu@gmail.com>
parents:
49598
diff
changeset
|
4585 (define-key map "\C-p" 'ada-procedure-spec) |
b0ce71ab9c28
(ada-search-directories): Take into account ADA_INCLUDE_PATH for better
Juanma Barranquero <lekktu@gmail.com>
parents:
49598
diff
changeset
|
4586 (define-key map "p" 'ada-subprogram-body) |
b0ce71ab9c28
(ada-search-directories): Take into account ADA_INCLUDE_PATH for better
Juanma Barranquero <lekktu@gmail.com>
parents:
49598
diff
changeset
|
4587 (define-key map "\C-f" 'ada-function-spec) |
b0ce71ab9c28
(ada-search-directories): Take into account ADA_INCLUDE_PATH for better
Juanma Barranquero <lekktu@gmail.com>
parents:
49598
diff
changeset
|
4588 (define-key map "f" 'ada-for-loop) |
b0ce71ab9c28
(ada-search-directories): Take into account ADA_INCLUDE_PATH for better
Juanma Barranquero <lekktu@gmail.com>
parents:
49598
diff
changeset
|
4589 (define-key map "i" 'ada-if) |
b0ce71ab9c28
(ada-search-directories): Take into account ADA_INCLUDE_PATH for better
Juanma Barranquero <lekktu@gmail.com>
parents:
49598
diff
changeset
|
4590 (define-key map "l" 'ada-loop) |
b0ce71ab9c28
(ada-search-directories): Take into account ADA_INCLUDE_PATH for better
Juanma Barranquero <lekktu@gmail.com>
parents:
49598
diff
changeset
|
4591 (define-key map "\C-r" 'ada-record) |
b0ce71ab9c28
(ada-search-directories): Take into account ADA_INCLUDE_PATH for better
Juanma Barranquero <lekktu@gmail.com>
parents:
49598
diff
changeset
|
4592 (define-key map "\C-s" 'ada-subtype) |
b0ce71ab9c28
(ada-search-directories): Take into account ADA_INCLUDE_PATH for better
Juanma Barranquero <lekktu@gmail.com>
parents:
49598
diff
changeset
|
4593 (define-key map "S" 'ada-tabsize) |
b0ce71ab9c28
(ada-search-directories): Take into account ADA_INCLUDE_PATH for better
Juanma Barranquero <lekktu@gmail.com>
parents:
49598
diff
changeset
|
4594 (define-key map "\C-t" 'ada-task-spec) |
b0ce71ab9c28
(ada-search-directories): Take into account ADA_INCLUDE_PATH for better
Juanma Barranquero <lekktu@gmail.com>
parents:
49598
diff
changeset
|
4595 (define-key map "t" 'ada-task-body) |
b0ce71ab9c28
(ada-search-directories): Take into account ADA_INCLUDE_PATH for better
Juanma Barranquero <lekktu@gmail.com>
parents:
49598
diff
changeset
|
4596 (define-key map "\C-y" 'ada-type) |
b0ce71ab9c28
(ada-search-directories): Take into account ADA_INCLUDE_PATH for better
Juanma Barranquero <lekktu@gmail.com>
parents:
49598
diff
changeset
|
4597 (define-key map "\C-v" 'ada-private) |
b0ce71ab9c28
(ada-search-directories): Take into account ADA_INCLUDE_PATH for better
Juanma Barranquero <lekktu@gmail.com>
parents:
49598
diff
changeset
|
4598 (define-key map "u" 'ada-use) |
b0ce71ab9c28
(ada-search-directories): Take into account ADA_INCLUDE_PATH for better
Juanma Barranquero <lekktu@gmail.com>
parents:
49598
diff
changeset
|
4599 (define-key map "\C-u" 'ada-with) |
b0ce71ab9c28
(ada-search-directories): Take into account ADA_INCLUDE_PATH for better
Juanma Barranquero <lekktu@gmail.com>
parents:
49598
diff
changeset
|
4600 (define-key map "\C-w" 'ada-when) |
b0ce71ab9c28
(ada-search-directories): Take into account ADA_INCLUDE_PATH for better
Juanma Barranquero <lekktu@gmail.com>
parents:
49598
diff
changeset
|
4601 (define-key map "w" 'ada-while-loop) |
b0ce71ab9c28
(ada-search-directories): Take into account ADA_INCLUDE_PATH for better
Juanma Barranquero <lekktu@gmail.com>
parents:
49598
diff
changeset
|
4602 (define-key map "\C-x" 'ada-exception) |
b0ce71ab9c28
(ada-search-directories): Take into account ADA_INCLUDE_PATH for better
Juanma Barranquero <lekktu@gmail.com>
parents:
49598
diff
changeset
|
4603 (define-key map "x" 'ada-exit) |
95268
bcc553c768f9
* textmodes/reftex-vars.el (reftex-extra-bindings-prefix): New var.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
94673
diff
changeset
|
4604 (define-key ada-mode-extra-map "t" map)) |
25903
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
4605 ) |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
4606 |
26225
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
4607 |
25903
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
4608 (defun ada-create-menu () |
63528
d6d50a511d12
(ada-format-paramlist)
Juanma Barranquero <lekktu@gmail.com>
parents:
63425
diff
changeset
|
4609 "Create the Ada menu as shown in the menu bar." |
50736
b0ce71ab9c28
(ada-search-directories): Take into account ADA_INCLUDE_PATH for better
Juanma Barranquero <lekktu@gmail.com>
parents:
49598
diff
changeset
|
4610 (let ((m '("Ada" |
b0ce71ab9c28
(ada-search-directories): Take into account ADA_INCLUDE_PATH for better
Juanma Barranquero <lekktu@gmail.com>
parents:
49598
diff
changeset
|
4611 ("Help" |
b0ce71ab9c28
(ada-search-directories): Take into account ADA_INCLUDE_PATH for better
Juanma Barranquero <lekktu@gmail.com>
parents:
49598
diff
changeset
|
4612 ["Ada Mode" (info "ada-mode") t] |
b0ce71ab9c28
(ada-search-directories): Take into account ADA_INCLUDE_PATH for better
Juanma Barranquero <lekktu@gmail.com>
parents:
49598
diff
changeset
|
4613 ["GNAT User's Guide" (info "gnat_ugn") |
b0ce71ab9c28
(ada-search-directories): Take into account ADA_INCLUDE_PATH for better
Juanma Barranquero <lekktu@gmail.com>
parents:
49598
diff
changeset
|
4614 (eq ada-which-compiler 'gnat)] |
b0ce71ab9c28
(ada-search-directories): Take into account ADA_INCLUDE_PATH for better
Juanma Barranquero <lekktu@gmail.com>
parents:
49598
diff
changeset
|
4615 ["GNAT Reference Manual" (info "gnat_rm") |
b0ce71ab9c28
(ada-search-directories): Take into account ADA_INCLUDE_PATH for better
Juanma Barranquero <lekktu@gmail.com>
parents:
49598
diff
changeset
|
4616 (eq ada-which-compiler 'gnat)] |
b0ce71ab9c28
(ada-search-directories): Take into account ADA_INCLUDE_PATH for better
Juanma Barranquero <lekktu@gmail.com>
parents:
49598
diff
changeset
|
4617 ["Gcc Documentation" (info "gcc") |
b0ce71ab9c28
(ada-search-directories): Take into account ADA_INCLUDE_PATH for better
Juanma Barranquero <lekktu@gmail.com>
parents:
49598
diff
changeset
|
4618 (eq ada-which-compiler 'gnat)] |
b0ce71ab9c28
(ada-search-directories): Take into account ADA_INCLUDE_PATH for better
Juanma Barranquero <lekktu@gmail.com>
parents:
49598
diff
changeset
|
4619 ["Gdb Documentation" (info "gdb") |
b0ce71ab9c28
(ada-search-directories): Take into account ADA_INCLUDE_PATH for better
Juanma Barranquero <lekktu@gmail.com>
parents:
49598
diff
changeset
|
4620 (eq ada-which-compiler 'gnat)] |
73932
242a56e8b2c0
Replace conditional (require 'ispell) with defvar.
Juanma Barranquero <lekktu@gmail.com>
parents:
73922
diff
changeset
|
4621 ["Ada95 Reference Manual" (info "arm95") t]) |
50736
b0ce71ab9c28
(ada-search-directories): Take into account ADA_INCLUDE_PATH for better
Juanma Barranquero <lekktu@gmail.com>
parents:
49598
diff
changeset
|
4622 ("Options" :included (eq major-mode 'ada-mode) |
b0ce71ab9c28
(ada-search-directories): Take into account ADA_INCLUDE_PATH for better
Juanma Barranquero <lekktu@gmail.com>
parents:
49598
diff
changeset
|
4623 ["Auto Casing" (setq ada-auto-case (not ada-auto-case)) |
b0ce71ab9c28
(ada-search-directories): Take into account ADA_INCLUDE_PATH for better
Juanma Barranquero <lekktu@gmail.com>
parents:
49598
diff
changeset
|
4624 :style toggle :selected ada-auto-case] |
b0ce71ab9c28
(ada-search-directories): Take into account ADA_INCLUDE_PATH for better
Juanma Barranquero <lekktu@gmail.com>
parents:
49598
diff
changeset
|
4625 ["Auto Indent After Return" |
b0ce71ab9c28
(ada-search-directories): Take into account ADA_INCLUDE_PATH for better
Juanma Barranquero <lekktu@gmail.com>
parents:
49598
diff
changeset
|
4626 (setq ada-indent-after-return (not ada-indent-after-return)) |
b0ce71ab9c28
(ada-search-directories): Take into account ADA_INCLUDE_PATH for better
Juanma Barranquero <lekktu@gmail.com>
parents:
49598
diff
changeset
|
4627 :style toggle :selected ada-indent-after-return] |
b0ce71ab9c28
(ada-search-directories): Take into account ADA_INCLUDE_PATH for better
Juanma Barranquero <lekktu@gmail.com>
parents:
49598
diff
changeset
|
4628 ["Automatically Recompile For Cross-references" |
b0ce71ab9c28
(ada-search-directories): Take into account ADA_INCLUDE_PATH for better
Juanma Barranquero <lekktu@gmail.com>
parents:
49598
diff
changeset
|
4629 (setq ada-xref-create-ali (not ada-xref-create-ali)) |
b0ce71ab9c28
(ada-search-directories): Take into account ADA_INCLUDE_PATH for better
Juanma Barranquero <lekktu@gmail.com>
parents:
49598
diff
changeset
|
4630 :style toggle :selected ada-xref-create-ali |
b0ce71ab9c28
(ada-search-directories): Take into account ADA_INCLUDE_PATH for better
Juanma Barranquero <lekktu@gmail.com>
parents:
49598
diff
changeset
|
4631 :included (eq ada-which-compiler 'gnat)] |
b0ce71ab9c28
(ada-search-directories): Take into account ADA_INCLUDE_PATH for better
Juanma Barranquero <lekktu@gmail.com>
parents:
49598
diff
changeset
|
4632 ["Confirm Commands" |
b0ce71ab9c28
(ada-search-directories): Take into account ADA_INCLUDE_PATH for better
Juanma Barranquero <lekktu@gmail.com>
parents:
49598
diff
changeset
|
4633 (setq ada-xref-confirm-compile (not ada-xref-confirm-compile)) |
b0ce71ab9c28
(ada-search-directories): Take into account ADA_INCLUDE_PATH for better
Juanma Barranquero <lekktu@gmail.com>
parents:
49598
diff
changeset
|
4634 :style toggle :selected ada-xref-confirm-compile |
b0ce71ab9c28
(ada-search-directories): Take into account ADA_INCLUDE_PATH for better
Juanma Barranquero <lekktu@gmail.com>
parents:
49598
diff
changeset
|
4635 :included (eq ada-which-compiler 'gnat)] |
b0ce71ab9c28
(ada-search-directories): Take into account ADA_INCLUDE_PATH for better
Juanma Barranquero <lekktu@gmail.com>
parents:
49598
diff
changeset
|
4636 ["Show Cross-references In Other Buffer" |
b0ce71ab9c28
(ada-search-directories): Take into account ADA_INCLUDE_PATH for better
Juanma Barranquero <lekktu@gmail.com>
parents:
49598
diff
changeset
|
4637 (setq ada-xref-other-buffer (not ada-xref-other-buffer)) |
b0ce71ab9c28
(ada-search-directories): Take into account ADA_INCLUDE_PATH for better
Juanma Barranquero <lekktu@gmail.com>
parents:
49598
diff
changeset
|
4638 :style toggle :selected ada-xref-other-buffer |
b0ce71ab9c28
(ada-search-directories): Take into account ADA_INCLUDE_PATH for better
Juanma Barranquero <lekktu@gmail.com>
parents:
49598
diff
changeset
|
4639 :included (eq ada-which-compiler 'gnat)] |
b0ce71ab9c28
(ada-search-directories): Take into account ADA_INCLUDE_PATH for better
Juanma Barranquero <lekktu@gmail.com>
parents:
49598
diff
changeset
|
4640 ["Tight Integration With GNU Visual Debugger" |
b0ce71ab9c28
(ada-search-directories): Take into account ADA_INCLUDE_PATH for better
Juanma Barranquero <lekktu@gmail.com>
parents:
49598
diff
changeset
|
4641 (setq ada-tight-gvd-integration (not ada-tight-gvd-integration)) |
b0ce71ab9c28
(ada-search-directories): Take into account ADA_INCLUDE_PATH for better
Juanma Barranquero <lekktu@gmail.com>
parents:
49598
diff
changeset
|
4642 :style toggle :selected ada-tight-gvd-integration |
b0ce71ab9c28
(ada-search-directories): Take into account ADA_INCLUDE_PATH for better
Juanma Barranquero <lekktu@gmail.com>
parents:
49598
diff
changeset
|
4643 :included (string-match "gvd" ada-prj-default-debugger)]) |
b0ce71ab9c28
(ada-search-directories): Take into account ADA_INCLUDE_PATH for better
Juanma Barranquero <lekktu@gmail.com>
parents:
49598
diff
changeset
|
4644 ["Customize" (customize-group 'ada) |
b0ce71ab9c28
(ada-search-directories): Take into account ADA_INCLUDE_PATH for better
Juanma Barranquero <lekktu@gmail.com>
parents:
49598
diff
changeset
|
4645 :included (fboundp 'customize-group)] |
73531
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
4646 ["Check file" ada-check-current t] |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
4647 ["Compile file" ada-compile-current t] |
74002
5909c257c4ea
(ada-mode-version): Bump version.
Juanma Barranquero <lekktu@gmail.com>
parents:
73935
diff
changeset
|
4648 ["Set main and Build" ada-set-main-compile-application t] |
5909c257c4ea
(ada-mode-version): Bump version.
Juanma Barranquero <lekktu@gmail.com>
parents:
73935
diff
changeset
|
4649 ["Show main" ada-show-current-main t] |
73531
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
4650 ["Build" ada-compile-application t] |
50736
b0ce71ab9c28
(ada-search-directories): Take into account ADA_INCLUDE_PATH for better
Juanma Barranquero <lekktu@gmail.com>
parents:
49598
diff
changeset
|
4651 ["Run" ada-run-application t] |
b0ce71ab9c28
(ada-search-directories): Take into account ADA_INCLUDE_PATH for better
Juanma Barranquero <lekktu@gmail.com>
parents:
49598
diff
changeset
|
4652 ["Debug" ada-gdb-application (eq ada-which-compiler 'gnat)] |
b0ce71ab9c28
(ada-search-directories): Take into account ADA_INCLUDE_PATH for better
Juanma Barranquero <lekktu@gmail.com>
parents:
49598
diff
changeset
|
4653 ["------" nil nil] |
b0ce71ab9c28
(ada-search-directories): Take into account ADA_INCLUDE_PATH for better
Juanma Barranquero <lekktu@gmail.com>
parents:
49598
diff
changeset
|
4654 ("Project" |
74002
5909c257c4ea
(ada-mode-version): Bump version.
Juanma Barranquero <lekktu@gmail.com>
parents:
73935
diff
changeset
|
4655 ["Show project" ada-show-current-project t] |
50736
b0ce71ab9c28
(ada-search-directories): Take into account ADA_INCLUDE_PATH for better
Juanma Barranquero <lekktu@gmail.com>
parents:
49598
diff
changeset
|
4656 ["Load..." ada-set-default-project-file t] |
b0ce71ab9c28
(ada-search-directories): Take into account ADA_INCLUDE_PATH for better
Juanma Barranquero <lekktu@gmail.com>
parents:
49598
diff
changeset
|
4657 ["New..." ada-prj-new t] |
b0ce71ab9c28
(ada-search-directories): Take into account ADA_INCLUDE_PATH for better
Juanma Barranquero <lekktu@gmail.com>
parents:
49598
diff
changeset
|
4658 ["Edit..." ada-prj-edit t]) |
b0ce71ab9c28
(ada-search-directories): Take into account ADA_INCLUDE_PATH for better
Juanma Barranquero <lekktu@gmail.com>
parents:
49598
diff
changeset
|
4659 ("Goto" :included (eq major-mode 'ada-mode) |
b0ce71ab9c28
(ada-search-directories): Take into account ADA_INCLUDE_PATH for better
Juanma Barranquero <lekktu@gmail.com>
parents:
49598
diff
changeset
|
4660 ["Goto Declaration/Body" ada-goto-declaration |
b0ce71ab9c28
(ada-search-directories): Take into account ADA_INCLUDE_PATH for better
Juanma Barranquero <lekktu@gmail.com>
parents:
49598
diff
changeset
|
4661 (eq ada-which-compiler 'gnat)] |
b0ce71ab9c28
(ada-search-directories): Take into account ADA_INCLUDE_PATH for better
Juanma Barranquero <lekktu@gmail.com>
parents:
49598
diff
changeset
|
4662 ["Goto Body" ada-goto-body |
b0ce71ab9c28
(ada-search-directories): Take into account ADA_INCLUDE_PATH for better
Juanma Barranquero <lekktu@gmail.com>
parents:
49598
diff
changeset
|
4663 (eq ada-which-compiler 'gnat)] |
b0ce71ab9c28
(ada-search-directories): Take into account ADA_INCLUDE_PATH for better
Juanma Barranquero <lekktu@gmail.com>
parents:
49598
diff
changeset
|
4664 ["Goto Declaration Other Frame" |
b0ce71ab9c28
(ada-search-directories): Take into account ADA_INCLUDE_PATH for better
Juanma Barranquero <lekktu@gmail.com>
parents:
49598
diff
changeset
|
4665 ada-goto-declaration-other-frame |
b0ce71ab9c28
(ada-search-directories): Take into account ADA_INCLUDE_PATH for better
Juanma Barranquero <lekktu@gmail.com>
parents:
49598
diff
changeset
|
4666 (eq ada-which-compiler 'gnat)] |
b0ce71ab9c28
(ada-search-directories): Take into account ADA_INCLUDE_PATH for better
Juanma Barranquero <lekktu@gmail.com>
parents:
49598
diff
changeset
|
4667 ["Goto Previous Reference" ada-xref-goto-previous-reference |
b0ce71ab9c28
(ada-search-directories): Take into account ADA_INCLUDE_PATH for better
Juanma Barranquero <lekktu@gmail.com>
parents:
49598
diff
changeset
|
4668 (eq ada-which-compiler 'gnat)] |
b0ce71ab9c28
(ada-search-directories): Take into account ADA_INCLUDE_PATH for better
Juanma Barranquero <lekktu@gmail.com>
parents:
49598
diff
changeset
|
4669 ["List Local References" ada-find-local-references |
b0ce71ab9c28
(ada-search-directories): Take into account ADA_INCLUDE_PATH for better
Juanma Barranquero <lekktu@gmail.com>
parents:
49598
diff
changeset
|
4670 (eq ada-which-compiler 'gnat)] |
b0ce71ab9c28
(ada-search-directories): Take into account ADA_INCLUDE_PATH for better
Juanma Barranquero <lekktu@gmail.com>
parents:
49598
diff
changeset
|
4671 ["List References" ada-find-references |
b0ce71ab9c28
(ada-search-directories): Take into account ADA_INCLUDE_PATH for better
Juanma Barranquero <lekktu@gmail.com>
parents:
49598
diff
changeset
|
4672 (eq ada-which-compiler 'gnat)] |
b0ce71ab9c28
(ada-search-directories): Take into account ADA_INCLUDE_PATH for better
Juanma Barranquero <lekktu@gmail.com>
parents:
49598
diff
changeset
|
4673 ["Goto Reference To Any Entity" ada-find-any-references |
b0ce71ab9c28
(ada-search-directories): Take into account ADA_INCLUDE_PATH for better
Juanma Barranquero <lekktu@gmail.com>
parents:
49598
diff
changeset
|
4674 (eq ada-which-compiler 'gnat)] |
b0ce71ab9c28
(ada-search-directories): Take into account ADA_INCLUDE_PATH for better
Juanma Barranquero <lekktu@gmail.com>
parents:
49598
diff
changeset
|
4675 ["Goto Parent Unit" ada-goto-parent |
b0ce71ab9c28
(ada-search-directories): Take into account ADA_INCLUDE_PATH for better
Juanma Barranquero <lekktu@gmail.com>
parents:
49598
diff
changeset
|
4676 (eq ada-which-compiler 'gnat)] |
b0ce71ab9c28
(ada-search-directories): Take into account ADA_INCLUDE_PATH for better
Juanma Barranquero <lekktu@gmail.com>
parents:
49598
diff
changeset
|
4677 ["--" nil nil] |
b0ce71ab9c28
(ada-search-directories): Take into account ADA_INCLUDE_PATH for better
Juanma Barranquero <lekktu@gmail.com>
parents:
49598
diff
changeset
|
4678 ["Next compilation error" next-error t] |
b0ce71ab9c28
(ada-search-directories): Take into account ADA_INCLUDE_PATH for better
Juanma Barranquero <lekktu@gmail.com>
parents:
49598
diff
changeset
|
4679 ["Previous Package" ada-previous-package t] |
b0ce71ab9c28
(ada-search-directories): Take into account ADA_INCLUDE_PATH for better
Juanma Barranquero <lekktu@gmail.com>
parents:
49598
diff
changeset
|
4680 ["Next Package" ada-next-package t] |
b0ce71ab9c28
(ada-search-directories): Take into account ADA_INCLUDE_PATH for better
Juanma Barranquero <lekktu@gmail.com>
parents:
49598
diff
changeset
|
4681 ["Previous Procedure" ada-previous-procedure t] |
50812
15929fed5553
(ada-xemacs): Variable removed, since it's better to use (featurep 'xemacs).
Juanma Barranquero <lekktu@gmail.com>
parents:
50736
diff
changeset
|
4682 ["Next Procedure" ada-next-procedure t] |
15929fed5553
(ada-xemacs): Variable removed, since it's better to use (featurep 'xemacs).
Juanma Barranquero <lekktu@gmail.com>
parents:
50736
diff
changeset
|
4683 ["Goto Start Of Statement" ada-move-to-start t] |
50736
b0ce71ab9c28
(ada-search-directories): Take into account ADA_INCLUDE_PATH for better
Juanma Barranquero <lekktu@gmail.com>
parents:
49598
diff
changeset
|
4684 ["Goto End Of Statement" ada-move-to-end t] |
b0ce71ab9c28
(ada-search-directories): Take into account ADA_INCLUDE_PATH for better
Juanma Barranquero <lekktu@gmail.com>
parents:
49598
diff
changeset
|
4685 ["-" nil nil] |
b0ce71ab9c28
(ada-search-directories): Take into account ADA_INCLUDE_PATH for better
Juanma Barranquero <lekktu@gmail.com>
parents:
49598
diff
changeset
|
4686 ["Other File" ff-find-other-file t] |
b0ce71ab9c28
(ada-search-directories): Take into account ADA_INCLUDE_PATH for better
Juanma Barranquero <lekktu@gmail.com>
parents:
49598
diff
changeset
|
4687 ["Other File Other Window" ada-ff-other-window t]) |
b0ce71ab9c28
(ada-search-directories): Take into account ADA_INCLUDE_PATH for better
Juanma Barranquero <lekktu@gmail.com>
parents:
49598
diff
changeset
|
4688 ("Edit" :included (eq major-mode 'ada-mode) |
b0ce71ab9c28
(ada-search-directories): Take into account ADA_INCLUDE_PATH for better
Juanma Barranquero <lekktu@gmail.com>
parents:
49598
diff
changeset
|
4689 ["Search File On Source Path" ada-find-file t] |
b0ce71ab9c28
(ada-search-directories): Take into account ADA_INCLUDE_PATH for better
Juanma Barranquero <lekktu@gmail.com>
parents:
49598
diff
changeset
|
4690 ["------" nil nil] |
b0ce71ab9c28
(ada-search-directories): Take into account ADA_INCLUDE_PATH for better
Juanma Barranquero <lekktu@gmail.com>
parents:
49598
diff
changeset
|
4691 ["Complete Identifier" ada-complete-identifier t] |
b0ce71ab9c28
(ada-search-directories): Take into account ADA_INCLUDE_PATH for better
Juanma Barranquero <lekktu@gmail.com>
parents:
49598
diff
changeset
|
4692 ["-----" nil nil] |
b0ce71ab9c28
(ada-search-directories): Take into account ADA_INCLUDE_PATH for better
Juanma Barranquero <lekktu@gmail.com>
parents:
49598
diff
changeset
|
4693 ["Indent Line" ada-indent-current-function t] |
b0ce71ab9c28
(ada-search-directories): Take into account ADA_INCLUDE_PATH for better
Juanma Barranquero <lekktu@gmail.com>
parents:
49598
diff
changeset
|
4694 ["Justify Current Indentation" ada-justified-indent-current t] |
b0ce71ab9c28
(ada-search-directories): Take into account ADA_INCLUDE_PATH for better
Juanma Barranquero <lekktu@gmail.com>
parents:
49598
diff
changeset
|
4695 ["Indent Lines in Selection" ada-indent-region t] |
b0ce71ab9c28
(ada-search-directories): Take into account ADA_INCLUDE_PATH for better
Juanma Barranquero <lekktu@gmail.com>
parents:
49598
diff
changeset
|
4696 ["Indent Lines in File" |
b0ce71ab9c28
(ada-search-directories): Take into account ADA_INCLUDE_PATH for better
Juanma Barranquero <lekktu@gmail.com>
parents:
49598
diff
changeset
|
4697 (ada-indent-region (point-min) (point-max)) t] |
b0ce71ab9c28
(ada-search-directories): Take into account ADA_INCLUDE_PATH for better
Juanma Barranquero <lekktu@gmail.com>
parents:
49598
diff
changeset
|
4698 ["Format Parameter List" ada-format-paramlist t] |
b0ce71ab9c28
(ada-search-directories): Take into account ADA_INCLUDE_PATH for better
Juanma Barranquero <lekktu@gmail.com>
parents:
49598
diff
changeset
|
4699 ["-" nil nil] |
b0ce71ab9c28
(ada-search-directories): Take into account ADA_INCLUDE_PATH for better
Juanma Barranquero <lekktu@gmail.com>
parents:
49598
diff
changeset
|
4700 ["Comment Selection" comment-region t] |
b0ce71ab9c28
(ada-search-directories): Take into account ADA_INCLUDE_PATH for better
Juanma Barranquero <lekktu@gmail.com>
parents:
49598
diff
changeset
|
4701 ["Uncomment Selection" ada-uncomment-region t] |
b0ce71ab9c28
(ada-search-directories): Take into account ADA_INCLUDE_PATH for better
Juanma Barranquero <lekktu@gmail.com>
parents:
49598
diff
changeset
|
4702 ["--" nil nil] |
b0ce71ab9c28
(ada-search-directories): Take into account ADA_INCLUDE_PATH for better
Juanma Barranquero <lekktu@gmail.com>
parents:
49598
diff
changeset
|
4703 ["Fill Comment Paragraph" fill-paragraph t] |
b0ce71ab9c28
(ada-search-directories): Take into account ADA_INCLUDE_PATH for better
Juanma Barranquero <lekktu@gmail.com>
parents:
49598
diff
changeset
|
4704 ["Fill Comment Paragraph Justify" |
b0ce71ab9c28
(ada-search-directories): Take into account ADA_INCLUDE_PATH for better
Juanma Barranquero <lekktu@gmail.com>
parents:
49598
diff
changeset
|
4705 ada-fill-comment-paragraph-justify t] |
b0ce71ab9c28
(ada-search-directories): Take into account ADA_INCLUDE_PATH for better
Juanma Barranquero <lekktu@gmail.com>
parents:
49598
diff
changeset
|
4706 ["Fill Comment Paragraph Postfix" |
b0ce71ab9c28
(ada-search-directories): Take into account ADA_INCLUDE_PATH for better
Juanma Barranquero <lekktu@gmail.com>
parents:
49598
diff
changeset
|
4707 ada-fill-comment-paragraph-postfix t] |
b0ce71ab9c28
(ada-search-directories): Take into account ADA_INCLUDE_PATH for better
Juanma Barranquero <lekktu@gmail.com>
parents:
49598
diff
changeset
|
4708 ["---" nil nil] |
b0ce71ab9c28
(ada-search-directories): Take into account ADA_INCLUDE_PATH for better
Juanma Barranquero <lekktu@gmail.com>
parents:
49598
diff
changeset
|
4709 ["Adjust Case Selection" ada-adjust-case-region t] |
b0ce71ab9c28
(ada-search-directories): Take into account ADA_INCLUDE_PATH for better
Juanma Barranquero <lekktu@gmail.com>
parents:
49598
diff
changeset
|
4710 ["Adjust Case in File" ada-adjust-case-buffer t] |
50812
15929fed5553
(ada-xemacs): Variable removed, since it's better to use (featurep 'xemacs).
Juanma Barranquero <lekktu@gmail.com>
parents:
50736
diff
changeset
|
4711 ["Create Case Exception" ada-create-case-exception t] |
15929fed5553
(ada-xemacs): Variable removed, since it's better to use (featurep 'xemacs).
Juanma Barranquero <lekktu@gmail.com>
parents:
50736
diff
changeset
|
4712 ["Create Case Exception Substring" |
50736
b0ce71ab9c28
(ada-search-directories): Take into account ADA_INCLUDE_PATH for better
Juanma Barranquero <lekktu@gmail.com>
parents:
49598
diff
changeset
|
4713 ada-create-case-exception-substring t] |
b0ce71ab9c28
(ada-search-directories): Take into account ADA_INCLUDE_PATH for better
Juanma Barranquero <lekktu@gmail.com>
parents:
49598
diff
changeset
|
4714 ["Reload Case Exceptions" ada-case-read-exceptions t] |
b0ce71ab9c28
(ada-search-directories): Take into account ADA_INCLUDE_PATH for better
Juanma Barranquero <lekktu@gmail.com>
parents:
49598
diff
changeset
|
4715 ["----" nil nil] |
b0ce71ab9c28
(ada-search-directories): Take into account ADA_INCLUDE_PATH for better
Juanma Barranquero <lekktu@gmail.com>
parents:
49598
diff
changeset
|
4716 ["Make body for subprogram" ada-make-subprogram-body t] |
b0ce71ab9c28
(ada-search-directories): Take into account ADA_INCLUDE_PATH for better
Juanma Barranquero <lekktu@gmail.com>
parents:
49598
diff
changeset
|
4717 ["-----" nil nil] |
73531
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
4718 ["Narrow to subprogram" ada-narrow-to-defun t]) |
50736
b0ce71ab9c28
(ada-search-directories): Take into account ADA_INCLUDE_PATH for better
Juanma Barranquero <lekktu@gmail.com>
parents:
49598
diff
changeset
|
4719 ("Templates" |
b0ce71ab9c28
(ada-search-directories): Take into account ADA_INCLUDE_PATH for better
Juanma Barranquero <lekktu@gmail.com>
parents:
49598
diff
changeset
|
4720 :included (eq major-mode 'ada-mode) |
b0ce71ab9c28
(ada-search-directories): Take into account ADA_INCLUDE_PATH for better
Juanma Barranquero <lekktu@gmail.com>
parents:
49598
diff
changeset
|
4721 ["Header" ada-header t] |
b0ce71ab9c28
(ada-search-directories): Take into account ADA_INCLUDE_PATH for better
Juanma Barranquero <lekktu@gmail.com>
parents:
49598
diff
changeset
|
4722 ["-" nil nil] |
b0ce71ab9c28
(ada-search-directories): Take into account ADA_INCLUDE_PATH for better
Juanma Barranquero <lekktu@gmail.com>
parents:
49598
diff
changeset
|
4723 ["Package Body" ada-package-body t] |
b0ce71ab9c28
(ada-search-directories): Take into account ADA_INCLUDE_PATH for better
Juanma Barranquero <lekktu@gmail.com>
parents:
49598
diff
changeset
|
4724 ["Package Spec" ada-package-spec t] |
b0ce71ab9c28
(ada-search-directories): Take into account ADA_INCLUDE_PATH for better
Juanma Barranquero <lekktu@gmail.com>
parents:
49598
diff
changeset
|
4725 ["Function Spec" ada-function-spec t] |
b0ce71ab9c28
(ada-search-directories): Take into account ADA_INCLUDE_PATH for better
Juanma Barranquero <lekktu@gmail.com>
parents:
49598
diff
changeset
|
4726 ["Procedure Spec" ada-procedure-spec t] |
b0ce71ab9c28
(ada-search-directories): Take into account ADA_INCLUDE_PATH for better
Juanma Barranquero <lekktu@gmail.com>
parents:
49598
diff
changeset
|
4727 ["Proc/func Body" ada-subprogram-body t] |
b0ce71ab9c28
(ada-search-directories): Take into account ADA_INCLUDE_PATH for better
Juanma Barranquero <lekktu@gmail.com>
parents:
49598
diff
changeset
|
4728 ["Task Body" ada-task-body t] |
b0ce71ab9c28
(ada-search-directories): Take into account ADA_INCLUDE_PATH for better
Juanma Barranquero <lekktu@gmail.com>
parents:
49598
diff
changeset
|
4729 ["Task Spec" ada-task-spec t] |
b0ce71ab9c28
(ada-search-directories): Take into account ADA_INCLUDE_PATH for better
Juanma Barranquero <lekktu@gmail.com>
parents:
49598
diff
changeset
|
4730 ["Declare Block" ada-declare-block t] |
b0ce71ab9c28
(ada-search-directories): Take into account ADA_INCLUDE_PATH for better
Juanma Barranquero <lekktu@gmail.com>
parents:
49598
diff
changeset
|
4731 ["Exception Block" ada-exception-block t] |
b0ce71ab9c28
(ada-search-directories): Take into account ADA_INCLUDE_PATH for better
Juanma Barranquero <lekktu@gmail.com>
parents:
49598
diff
changeset
|
4732 ["--" nil nil] |
b0ce71ab9c28
(ada-search-directories): Take into account ADA_INCLUDE_PATH for better
Juanma Barranquero <lekktu@gmail.com>
parents:
49598
diff
changeset
|
4733 ["Entry" ada-entry t] |
b0ce71ab9c28
(ada-search-directories): Take into account ADA_INCLUDE_PATH for better
Juanma Barranquero <lekktu@gmail.com>
parents:
49598
diff
changeset
|
4734 ["Entry family" ada-entry-family t] |
b0ce71ab9c28
(ada-search-directories): Take into account ADA_INCLUDE_PATH for better
Juanma Barranquero <lekktu@gmail.com>
parents:
49598
diff
changeset
|
4735 ["Select" ada-select t] |
b0ce71ab9c28
(ada-search-directories): Take into account ADA_INCLUDE_PATH for better
Juanma Barranquero <lekktu@gmail.com>
parents:
49598
diff
changeset
|
4736 ["Accept" ada-accept t] |
b0ce71ab9c28
(ada-search-directories): Take into account ADA_INCLUDE_PATH for better
Juanma Barranquero <lekktu@gmail.com>
parents:
49598
diff
changeset
|
4737 ["Or accept" ada-or-accep t] |
b0ce71ab9c28
(ada-search-directories): Take into account ADA_INCLUDE_PATH for better
Juanma Barranquero <lekktu@gmail.com>
parents:
49598
diff
changeset
|
4738 ["Or delay" ada-or-delay t] |
b0ce71ab9c28
(ada-search-directories): Take into account ADA_INCLUDE_PATH for better
Juanma Barranquero <lekktu@gmail.com>
parents:
49598
diff
changeset
|
4739 ["Or terminate" ada-or-terminate t] |
b0ce71ab9c28
(ada-search-directories): Take into account ADA_INCLUDE_PATH for better
Juanma Barranquero <lekktu@gmail.com>
parents:
49598
diff
changeset
|
4740 ["---" nil nil] |
b0ce71ab9c28
(ada-search-directories): Take into account ADA_INCLUDE_PATH for better
Juanma Barranquero <lekktu@gmail.com>
parents:
49598
diff
changeset
|
4741 ["Type" ada-type t] |
b0ce71ab9c28
(ada-search-directories): Take into account ADA_INCLUDE_PATH for better
Juanma Barranquero <lekktu@gmail.com>
parents:
49598
diff
changeset
|
4742 ["Private" ada-private t] |
b0ce71ab9c28
(ada-search-directories): Take into account ADA_INCLUDE_PATH for better
Juanma Barranquero <lekktu@gmail.com>
parents:
49598
diff
changeset
|
4743 ["Subtype" ada-subtype t] |
b0ce71ab9c28
(ada-search-directories): Take into account ADA_INCLUDE_PATH for better
Juanma Barranquero <lekktu@gmail.com>
parents:
49598
diff
changeset
|
4744 ["Record" ada-record t] |
b0ce71ab9c28
(ada-search-directories): Take into account ADA_INCLUDE_PATH for better
Juanma Barranquero <lekktu@gmail.com>
parents:
49598
diff
changeset
|
4745 ["Array" ada-array t] |
b0ce71ab9c28
(ada-search-directories): Take into account ADA_INCLUDE_PATH for better
Juanma Barranquero <lekktu@gmail.com>
parents:
49598
diff
changeset
|
4746 ["----" nil nil] |
b0ce71ab9c28
(ada-search-directories): Take into account ADA_INCLUDE_PATH for better
Juanma Barranquero <lekktu@gmail.com>
parents:
49598
diff
changeset
|
4747 ["If" ada-if t] |
b0ce71ab9c28
(ada-search-directories): Take into account ADA_INCLUDE_PATH for better
Juanma Barranquero <lekktu@gmail.com>
parents:
49598
diff
changeset
|
4748 ["Else" ada-else t] |
b0ce71ab9c28
(ada-search-directories): Take into account ADA_INCLUDE_PATH for better
Juanma Barranquero <lekktu@gmail.com>
parents:
49598
diff
changeset
|
4749 ["Elsif" ada-elsif t] |
b0ce71ab9c28
(ada-search-directories): Take into account ADA_INCLUDE_PATH for better
Juanma Barranquero <lekktu@gmail.com>
parents:
49598
diff
changeset
|
4750 ["Case" ada-case t] |
b0ce71ab9c28
(ada-search-directories): Take into account ADA_INCLUDE_PATH for better
Juanma Barranquero <lekktu@gmail.com>
parents:
49598
diff
changeset
|
4751 ["-----" nil nil] |
b0ce71ab9c28
(ada-search-directories): Take into account ADA_INCLUDE_PATH for better
Juanma Barranquero <lekktu@gmail.com>
parents:
49598
diff
changeset
|
4752 ["While Loop" ada-while-loop t] |
b0ce71ab9c28
(ada-search-directories): Take into account ADA_INCLUDE_PATH for better
Juanma Barranquero <lekktu@gmail.com>
parents:
49598
diff
changeset
|
4753 ["For Loop" ada-for-loop t] |
b0ce71ab9c28
(ada-search-directories): Take into account ADA_INCLUDE_PATH for better
Juanma Barranquero <lekktu@gmail.com>
parents:
49598
diff
changeset
|
4754 ["Loop" ada-loop t] |
b0ce71ab9c28
(ada-search-directories): Take into account ADA_INCLUDE_PATH for better
Juanma Barranquero <lekktu@gmail.com>
parents:
49598
diff
changeset
|
4755 ["------" nil nil] |
b0ce71ab9c28
(ada-search-directories): Take into account ADA_INCLUDE_PATH for better
Juanma Barranquero <lekktu@gmail.com>
parents:
49598
diff
changeset
|
4756 ["Exception" ada-exception t] |
b0ce71ab9c28
(ada-search-directories): Take into account ADA_INCLUDE_PATH for better
Juanma Barranquero <lekktu@gmail.com>
parents:
49598
diff
changeset
|
4757 ["Exit" ada-exit t] |
b0ce71ab9c28
(ada-search-directories): Take into account ADA_INCLUDE_PATH for better
Juanma Barranquero <lekktu@gmail.com>
parents:
49598
diff
changeset
|
4758 ["When" ada-when t]) |
b0ce71ab9c28
(ada-search-directories): Take into account ADA_INCLUDE_PATH for better
Juanma Barranquero <lekktu@gmail.com>
parents:
49598
diff
changeset
|
4759 ))) |
b0ce71ab9c28
(ada-search-directories): Take into account ADA_INCLUDE_PATH for better
Juanma Barranquero <lekktu@gmail.com>
parents:
49598
diff
changeset
|
4760 |
30411
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
4761 (easy-menu-define ada-mode-menu ada-mode-map "Menu keymap for Ada mode" m) |
50812
15929fed5553
(ada-xemacs): Variable removed, since it's better to use (featurep 'xemacs).
Juanma Barranquero <lekktu@gmail.com>
parents:
50736
diff
changeset
|
4762 (if (featurep 'xemacs) |
15929fed5553
(ada-xemacs): Variable removed, since it's better to use (featurep 'xemacs).
Juanma Barranquero <lekktu@gmail.com>
parents:
50736
diff
changeset
|
4763 (progn |
15929fed5553
(ada-xemacs): Variable removed, since it's better to use (featurep 'xemacs).
Juanma Barranquero <lekktu@gmail.com>
parents:
50736
diff
changeset
|
4764 (define-key ada-mode-map [menu-bar] ada-mode-menu) |
15929fed5553
(ada-xemacs): Variable removed, since it's better to use (featurep 'xemacs).
Juanma Barranquero <lekktu@gmail.com>
parents:
50736
diff
changeset
|
4765 (set 'mode-popup-menu (cons "Ada mode" ada-mode-menu)))))) |
10705 | 4766 |
4767 | |
26225
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
4768 ;; ------------------------------------------------------- |
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
4769 ;; Commenting/Uncommenting code |
30411
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
4770 ;; The following two calls are provided to enhance the standard |
25903
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
4771 ;; comment-region function, which only allows uncommenting if the |
26225
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
4772 ;; comment is at the beginning of a line. If the line have been re-indented, |
25903
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
4773 ;; we are unable to use comment-region, which makes no sense. |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
4774 ;; |
26225
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
4775 ;; In addition, we provide an interface to the standard comment handling |
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
4776 ;; function for justifying the comments. |
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
4777 ;; ------------------------------------------------------- |
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
4778 |
45931
a4c8d672ccbe
* progmodes/ada-mode.el: Update copyright notice.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
44933
diff
changeset
|
4779 (defadvice comment-region (before ada-uncomment-anywhere disable) |
87566
0c4a74c24677
* progmodes/ada-xref.el (ada-prj-find-prj-file):
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
87401
diff
changeset
|
4780 (if (and (consp arg) ;; a prefix with \C-u is of the form '(4), whereas |
73531
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
4781 ;; \C-u 2 sets arg to '2' (fixed by S.Leake) |
87566
0c4a74c24677
* progmodes/ada-xref.el (ada-prj-find-prj-file):
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
87401
diff
changeset
|
4782 (derived-mode-p 'ada-mode)) |
25903
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
4783 (save-excursion |
73531
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
4784 (let ((cs (concat "^[ \t]*" (regexp-quote comment-start)))) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
4785 (goto-char beg) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
4786 (while (re-search-forward cs end t) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
4787 (replace-match comment-start)) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
4788 )))) |
25903
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
4789 |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
4790 (defun ada-uncomment-region (beg end &optional arg) |
73531
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
4791 "Uncomment region BEG .. END. |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
4792 ARG gives number of comment characters." |
25903
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
4793 (interactive "r\nP") |
30411
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
4794 |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
4795 ;; This advice is not needed anymore with Emacs21. However, for older |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
4796 ;; versions, as well as for XEmacs, we still need to enable it. |
50812
15929fed5553
(ada-xemacs): Variable removed, since it's better to use (featurep 'xemacs).
Juanma Barranquero <lekktu@gmail.com>
parents:
50736
diff
changeset
|
4797 (if (or (<= emacs-major-version 20) (featurep 'xemacs)) |
30411
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
4798 (progn |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
4799 (ad-activate 'comment-region) |
44465
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
4800 (comment-region beg end (- (or arg 2))) |
30411
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
4801 (ad-deactivate 'comment-region)) |
45931
a4c8d672ccbe
* progmodes/ada-mode.el: Update copyright notice.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
44933
diff
changeset
|
4802 (comment-region beg end (list (- (or arg 2)))) |
a4c8d672ccbe
* progmodes/ada-mode.el: Update copyright notice.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
44933
diff
changeset
|
4803 (ada-indent-region beg end))) |
25903
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
4804 |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
4805 (defun ada-fill-comment-paragraph-justify () |
63528
d6d50a511d12
(ada-format-paramlist)
Juanma Barranquero <lekktu@gmail.com>
parents:
63425
diff
changeset
|
4806 "Fill current comment paragraph and justify each line as well." |
25903
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
4807 (interactive) |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
4808 (ada-fill-comment-paragraph 'full)) |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
4809 |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
4810 (defun ada-fill-comment-paragraph-postfix () |
63528
d6d50a511d12
(ada-format-paramlist)
Juanma Barranquero <lekktu@gmail.com>
parents:
63425
diff
changeset
|
4811 "Fill current comment paragraph and justify each line as well. |
26225
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
4812 Adds `ada-fill-comment-postfix' at the end of each line." |
25903
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
4813 (interactive) |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
4814 (ada-fill-comment-paragraph 'full t)) |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
4815 |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
4816 (defun ada-fill-comment-paragraph (&optional justify postfix) |
63528
d6d50a511d12
(ada-format-paramlist)
Juanma Barranquero <lekktu@gmail.com>
parents:
63425
diff
changeset
|
4817 "Fill the current comment paragraph. |
25903
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
4818 If JUSTIFY is non-nil, each line is justified as well. |
63528
d6d50a511d12
(ada-format-paramlist)
Juanma Barranquero <lekktu@gmail.com>
parents:
63425
diff
changeset
|
4819 If POSTFIX and JUSTIFY are non-nil, `ada-fill-comment-postfix' is appended |
d6d50a511d12
(ada-format-paramlist)
Juanma Barranquero <lekktu@gmail.com>
parents:
63425
diff
changeset
|
4820 to each line filled and justified. |
25903
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
4821 The paragraph is indented on the first line." |
10705 | 4822 (interactive "P") |
25903
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
4823 |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
4824 ;; check if inside comment or just in front a comment |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
4825 (if (and (not (ada-in-comment-p)) |
73531
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
4826 (not (looking-at "[ \t]*--"))) |
63528
d6d50a511d12
(ada-format-paramlist)
Juanma Barranquero <lekktu@gmail.com>
parents:
63425
diff
changeset
|
4827 (error "Not inside comment")) |
25903
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
4828 |
45931
a4c8d672ccbe
* progmodes/ada-mode.el: Update copyright notice.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
44933
diff
changeset
|
4829 (let* (indent from to |
73531
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
4830 (opos (point-marker)) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
4831 |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
4832 ;; Sets this variable to nil, otherwise it prevents |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
4833 ;; fill-region-as-paragraph to work on Emacs <= 20.2 |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
4834 (parse-sexp-lookup-properties nil) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
4835 |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
4836 fill-prefix |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
4837 (fill-column (current-fill-column))) |
25903
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
4838 |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
4839 ;; Find end of paragraph |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
4840 (back-to-indentation) |
45931
a4c8d672ccbe
* progmodes/ada-mode.el: Update copyright notice.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
44933
diff
changeset
|
4841 (while (and (not (eobp)) (looking-at ".*--[ \t]*[^ \t\n]")) |
25903
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
4842 (forward-line 1) |
30411
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
4843 |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
4844 ;; If we were at the last line in the buffer, create a dummy empty |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
4845 ;; line at the end of the buffer. |
44465
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
4846 (if (eobp) |
30411
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
4847 (insert "\n") |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
4848 (back-to-indentation))) |
25903
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
4849 (beginning-of-line) |
33716
c55ff055c68a
(ada-mode): `set '' -> `setq'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
32300
diff
changeset
|
4850 (setq to (point-marker)) |
25903
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
4851 (goto-char opos) |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
4852 |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
4853 ;; Find beginning of paragraph |
44465
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
4854 (back-to-indentation) |
45931
a4c8d672ccbe
* progmodes/ada-mode.el: Update copyright notice.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
44933
diff
changeset
|
4855 (while (and (not (bobp)) (looking-at ".*--[ \t]*[^ \t\n]")) |
44465
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
4856 (forward-line -1) |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
4857 (back-to-indentation)) |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
4858 |
45931
a4c8d672ccbe
* progmodes/ada-mode.el: Update copyright notice.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
44933
diff
changeset
|
4859 ;; We want one line above the first one, unless we are at the beginning |
44465
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
4860 ;; of the buffer |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
4861 (unless (bobp) |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
4862 (forward-line 1)) |
41036
aaa6f44a1b96
(ada-fill-comment-prefix): Doc fix.
Richard M. Stallman <rms@gnu.org>
parents:
41012
diff
changeset
|
4863 (beginning-of-line) |
33716
c55ff055c68a
(ada-mode): `set '' -> `setq'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
32300
diff
changeset
|
4864 (setq from (point-marker)) |
25903
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
4865 |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
4866 ;; Calculate the indentation we will need for the paragraph |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
4867 (back-to-indentation) |
33716
c55ff055c68a
(ada-mode): `set '' -> `setq'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
32300
diff
changeset
|
4868 (setq indent (current-column)) |
25903
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
4869 ;; unindent the first line of the paragraph |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
4870 (delete-region from (point)) |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
4871 |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
4872 ;; Remove the old postfixes |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
4873 (goto-char from) |
30411
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
4874 (while (re-search-forward "--\n" to t) |
25903
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
4875 (replace-match "\n")) |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
4876 |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
4877 (goto-char (1- to)) |
33716
c55ff055c68a
(ada-mode): `set '' -> `setq'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
32300
diff
changeset
|
4878 (setq to (point-marker)) |
25903
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
4879 |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
4880 ;; Indent and justify the paragraph |
33716
c55ff055c68a
(ada-mode): `set '' -> `setq'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
32300
diff
changeset
|
4881 (setq fill-prefix ada-fill-comment-prefix) |
25903
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
4882 (set-left-margin from to indent) |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
4883 (if postfix |
73531
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
4884 (setq fill-column (- fill-column (length ada-fill-comment-postfix)))) |
25903
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
4885 |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
4886 (fill-region-as-paragraph from to justify) |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
4887 |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
4888 ;; Add the postfixes if required |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
4889 (if postfix |
73531
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
4890 (save-restriction |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
4891 (goto-char from) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
4892 (narrow-to-region from to) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
4893 (while (not (eobp)) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
4894 (end-of-line) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
4895 (insert-char ? (- fill-column (current-column))) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
4896 (insert ada-fill-comment-postfix) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
4897 (forward-line)) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
4898 )) |
25903
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
4899 |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
4900 ;; In Emacs <= 20.2 and XEmacs <=20.4, there is a bug, and a newline is |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
4901 ;; inserted at the end. Delete it |
50812
15929fed5553
(ada-xemacs): Variable removed, since it's better to use (featurep 'xemacs).
Juanma Barranquero <lekktu@gmail.com>
parents:
50736
diff
changeset
|
4902 (if (or (featurep 'xemacs) |
73531
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
4903 (<= emacs-major-version 19) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
4904 (and (= emacs-major-version 20) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
4905 (<= emacs-minor-version 2))) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
4906 (progn |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
4907 (goto-char to) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
4908 (end-of-line) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
4909 (delete-char 1))) |
25903
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
4910 |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
4911 (goto-char opos))) |
10705 | 4912 |
30411
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
4913 |
26225
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
4914 ;; --------------------------------------------------- |
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
4915 ;; support for find-file.el |
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
4916 ;; These functions are used by find-file to guess the file names from |
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
4917 ;; unit names, and to find the other file (spec or body) from the current |
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
4918 ;; file (body or spec). |
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
4919 ;; It is also used to find in which function we are, so as to put the |
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
4920 ;; cursor at the correct position. |
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
4921 ;; Standard Ada does not force any relation between unit names and file names, |
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
4922 ;; so some of these functions can only be a good approximation. However, they |
79854
d979323205c7
Fix typos in comments.
Juanma Barranquero <lekktu@gmail.com>
parents:
79717
diff
changeset
|
4923 ;; are also overridden in `ada-xref'.el when we know that the user is using |
26225
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
4924 ;; GNAT. |
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
4925 ;; --------------------------------------------------- |
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
4926 |
79854
d979323205c7
Fix typos in comments.
Juanma Barranquero <lekktu@gmail.com>
parents:
79717
diff
changeset
|
4927 ;; Overridden when we work with GNAT, to use gnatkrunch |
10705 | 4928 (defun ada-make-filename-from-adaname (adaname) |
26225
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
4929 "Determine the filename in which ADANAME is found. |
73531
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
4930 This matches the GNAT default naming convention, except for |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
4931 pre-defined units." |
25903
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
4932 (while (string-match "\\." adaname) |
33716
c55ff055c68a
(ada-mode): `set '' -> `setq'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
32300
diff
changeset
|
4933 (setq adaname (replace-match "-" t t adaname))) |
30411
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
4934 (downcase adaname) |
10705 | 4935 ) |
4936 | |
25903
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
4937 (defun ada-other-file-name () |
30411
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
4938 "Return the name of the other file. |
63528
d6d50a511d12
(ada-format-paramlist)
Juanma Barranquero <lekktu@gmail.com>
parents:
63425
diff
changeset
|
4939 The name returned is the body if `current-buffer' is the spec, |
d6d50a511d12
(ada-format-paramlist)
Juanma Barranquero <lekktu@gmail.com>
parents:
63425
diff
changeset
|
4940 or the spec otherwise." |
30411
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
4941 |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
4942 (let ((is-spec nil) |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
4943 (is-body nil) |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
4944 (suffixes ada-spec-suffixes) |
73434
3586ad4a01a1
(ada-in-string-p): Doc fix.
Juanma Barranquero <lekktu@gmail.com>
parents:
73422
diff
changeset
|
4945 (name (buffer-file-name))) |
30411
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
4946 |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
4947 ;; Guess whether we have a spec or a body, and get the basename of the |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
4948 ;; file. Since the extension may not start with '.', we can not use |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
4949 ;; file-name-extension |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
4950 (while (and (not is-spec) |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
4951 suffixes) |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
4952 (if (string-match (concat "\\(.*\\)" (car suffixes) "$") name) |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
4953 (setq is-spec t |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
4954 name (match-string 1 name))) |
33716
c55ff055c68a
(ada-mode): `set '' -> `setq'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
32300
diff
changeset
|
4955 (setq suffixes (cdr suffixes))) |
30411
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
4956 |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
4957 (if (not is-spec) |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
4958 (progn |
33716
c55ff055c68a
(ada-mode): `set '' -> `setq'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
32300
diff
changeset
|
4959 (setq suffixes ada-body-suffixes) |
30411
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
4960 (while (and (not is-body) |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
4961 suffixes) |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
4962 (if (string-match (concat "\\(.*\\)" (car suffixes) "$") name) |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
4963 (setq is-body t |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
4964 name (match-string 1 name))) |
33716
c55ff055c68a
(ada-mode): `set '' -> `setq'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
32300
diff
changeset
|
4965 (setq suffixes (cdr suffixes))))) |
33786
9f63b158eb6b
* simple.el (delete-trailing-whitespace): New interactive function.
Sam Steingold <sds@gnu.org>
parents:
33716
diff
changeset
|
4966 |
30411
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
4967 ;; If this wasn't in either list, return name itself |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
4968 (if (not (or is-spec is-body)) |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
4969 name |
33786
9f63b158eb6b
* simple.el (delete-trailing-whitespace): New interactive function.
Sam Steingold <sds@gnu.org>
parents:
33716
diff
changeset
|
4970 |
30411
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
4971 ;; Else find the other possible names |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
4972 (if is-spec |
33716
c55ff055c68a
(ada-mode): `set '' -> `setq'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
32300
diff
changeset
|
4973 (setq suffixes ada-body-suffixes) |
c55ff055c68a
(ada-mode): `set '' -> `setq'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
32300
diff
changeset
|
4974 (setq suffixes ada-spec-suffixes)) |
c55ff055c68a
(ada-mode): `set '' -> `setq'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
32300
diff
changeset
|
4975 (setq is-spec name) |
30411
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
4976 |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
4977 (while suffixes |
44465
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
4978 |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
4979 ;; If we are using project file, search for the other file in all |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
4980 ;; the possible src directories. |
49598
0d8b17d428b5
Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
45931
diff
changeset
|
4981 |
50812
15929fed5553
(ada-xemacs): Variable removed, since it's better to use (featurep 'xemacs).
Juanma Barranquero <lekktu@gmail.com>
parents:
50736
diff
changeset
|
4982 (if (fboundp 'ada-find-src-file-in-dir) |
44465
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
4983 (let ((other |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
4984 (ada-find-src-file-in-dir |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
4985 (file-name-nondirectory (concat name (car suffixes)))))) |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
4986 (if other |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
4987 (set 'is-spec other))) |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
4988 |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
4989 ;; Else search in the current directory |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
4990 (if (file-exists-p (concat name (car suffixes))) |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
4991 (setq is-spec (concat name (car suffixes))))) |
33716
c55ff055c68a
(ada-mode): `set '' -> `setq'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
32300
diff
changeset
|
4992 (setq suffixes (cdr suffixes))) |
30411
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
4993 |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
4994 is-spec))) |
12039
a75524689022
(initial comments): Copyright 1995; don't speak
Karl Heuer <kwzh@gnu.org>
parents:
11869
diff
changeset
|
4995 |
a75524689022
(initial comments): Copyright 1995; don't speak
Karl Heuer <kwzh@gnu.org>
parents:
11869
diff
changeset
|
4996 (defun ada-which-function-are-we-in () |
26225
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
4997 "Return the name of the function whose definition/declaration point is in. |
73922
289cedd46cd8
Delete `eval-and-compile' around `require'.
Juanma Barranquero <lekktu@gmail.com>
parents:
73531
diff
changeset
|
4998 Used in `ff-pre-load-hook'." |
33716
c55ff055c68a
(ada-mode): `set '' -> `setq'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
32300
diff
changeset
|
4999 (setq ff-function-name nil) |
12039
a75524689022
(initial comments): Copyright 1995; don't speak
Karl Heuer <kwzh@gnu.org>
parents:
11869
diff
changeset
|
5000 (save-excursion |
30411
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
5001 (end-of-line);; make sure we get the complete name |
73922
289cedd46cd8
Delete `eval-and-compile' around `require'.
Juanma Barranquero <lekktu@gmail.com>
parents:
73531
diff
changeset
|
5002 (or (if (re-search-backward ada-procedure-start-regexp nil t) |
97058
b6ac850e9d2b
Fix bug #272, and update Ada mode to version 4.0.
Juanma Barranquero <lekktu@gmail.com>
parents:
95268
diff
changeset
|
5003 (setq ff-function-name (match-string 5))) |
b6ac850e9d2b
Fix bug #272, and update Ada mode to version 4.0.
Juanma Barranquero <lekktu@gmail.com>
parents:
95268
diff
changeset
|
5004 (if (re-search-backward ada-package-start-regexp nil t) |
b6ac850e9d2b
Fix bug #272, and update Ada mode to version 4.0.
Juanma Barranquero <lekktu@gmail.com>
parents:
95268
diff
changeset
|
5005 (setq ff-function-name (match-string 4)))) |
25903
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
5006 )) |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
5007 |
30411
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
5008 |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
5009 (defvar ada-last-which-function-line -1 |
73422
e1bac685e6a0
(ada-83-string-keywords, ada-last-which-function-line ada-no-auto-case,
Juanma Barranquero <lekktu@gmail.com>
parents:
71924
diff
changeset
|
5010 "Last line on which `ada-which-function' was called.") |
30411
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
5011 (defvar ada-last-which-function-subprog 0 |
63528
d6d50a511d12
(ada-format-paramlist)
Juanma Barranquero <lekktu@gmail.com>
parents:
63425
diff
changeset
|
5012 "Last subprogram name returned by `ada-which-function'.") |
30411
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
5013 (make-variable-buffer-local 'ada-last-which-function-subprog) |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
5014 (make-variable-buffer-local 'ada-last-which-function-line) |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
5015 |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
5016 |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
5017 (defun ada-which-function () |
63528
d6d50a511d12
(ada-format-paramlist)
Juanma Barranquero <lekktu@gmail.com>
parents:
63425
diff
changeset
|
5018 "Return the name of the function whose body the point is in. |
30411
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
5019 This function works even in the case of nested subprograms, whereas the |
45931
a4c8d672ccbe
* progmodes/ada-mode.el: Update copyright notice.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
44933
diff
changeset
|
5020 standard Emacs function `which-function' does not. |
30411
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
5021 Since the search can be long, the results are cached." |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
5022 |
45931
a4c8d672ccbe
* progmodes/ada-mode.el: Update copyright notice.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
44933
diff
changeset
|
5023 (let ((line (count-lines 1 (point))) |
73531
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
5024 (pos (point)) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
5025 end-pos |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
5026 func-name indent |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
5027 found) |
30411
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
5028 |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
5029 ;; If this is the same line as before, simply return the same result |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
5030 (if (= line ada-last-which-function-line) |
73531
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
5031 ada-last-which-function-subprog |
30411
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
5032 |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
5033 (save-excursion |
73531
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
5034 ;; In case the current line is also the beginning of the body |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
5035 (end-of-line) |
44465
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
5036 |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
5037 ;; Are we looking at "function Foo\n (paramlist)" |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
5038 (skip-chars-forward " \t\n(") |
49598
0d8b17d428b5
Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
45931
diff
changeset
|
5039 |
44465
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
5040 (condition-case nil |
45931
a4c8d672ccbe
* progmodes/ada-mode.el: Update copyright notice.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
44933
diff
changeset
|
5041 (up-list 1) |
44465
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
5042 (error nil)) |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
5043 |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
5044 (skip-chars-forward " \t\n") |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
5045 (if (looking-at "return") |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
5046 (progn |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
5047 (forward-word 1) |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
5048 (skip-chars-forward " \t\n") |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
5049 (skip-chars-forward "a-zA-Z0-9_'"))) |
49598
0d8b17d428b5
Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
45931
diff
changeset
|
5050 |
73531
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
5051 ;; Can't simply do forward-word, in case the "is" is not on the |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
5052 ;; same line as the closing parenthesis |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
5053 (skip-chars-forward "is \t\n") |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
5054 |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
5055 ;; No look for the closest subprogram body that has not ended yet. |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
5056 ;; Not that we expect all the bodies to be finished by "end <name>", |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
5057 ;; or a simple "end;" indented in the same column as the start of |
44465
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
5058 ;; the subprogram. The goal is to be as efficient as possible. |
30411
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
5059 |
73531
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
5060 (while (and (not found) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
5061 (re-search-backward ada-imenu-subprogram-menu-re nil t)) |
44465
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
5062 |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
5063 ;; Get the function name, but not the properties, or this changes |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
5064 ;; the face in the modeline on Emacs 21 |
106830
4ff0e607507d
* progmodes/ada-mode.el: Deal with Ada 2005 "overriding" keyword.
Juanma Barranquero <lekktu@gmail.com>
parents:
106829
diff
changeset
|
5065 (setq func-name (match-string-no-properties 3)) |
73531
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
5066 (if (and (not (ada-in-comment-p)) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
5067 (not (save-excursion |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
5068 (goto-char (match-end 0)) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
5069 (looking-at "[ \t\n]*new")))) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
5070 (save-excursion |
44465
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
5071 (back-to-indentation) |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
5072 (setq indent (current-column)) |
73531
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
5073 (if (ada-search-ignore-string-comment |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
5074 (concat "end[ \t]+" func-name "[ \t]*;\\|^" |
44465
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
5075 (make-string indent ? ) "end;")) |
73531
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
5076 (setq end-pos (point)) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
5077 (setq end-pos (point-max))) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
5078 (if (>= end-pos pos) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
5079 (setq found func-name)))) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
5080 ) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
5081 (setq ada-last-which-function-line line |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
5082 ada-last-which-function-subprog found) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
5083 found)))) |
30411
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
5084 |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
5085 (defun ada-ff-other-window () |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
5086 "Find other file in other window using `ff-find-other-file'." |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
5087 (interactive) |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
5088 (and (fboundp 'ff-find-other-file) |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
5089 (ff-find-other-file t))) |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
5090 |
25903
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
5091 (defun ada-set-point-accordingly () |
73531
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
5092 "Move to the function declaration that was set by `ff-which-function-are-we-in'." |
25903
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
5093 (if ff-function-name |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
5094 (progn |
73531
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
5095 (goto-char (point-min)) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
5096 (unless (ada-search-ignore-string-comment |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
5097 (concat ff-function-name "\\b") nil) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
5098 (goto-char (point-min)))))) |
12039
a75524689022
(initial comments): Copyright 1995; don't speak
Karl Heuer <kwzh@gnu.org>
parents:
11869
diff
changeset
|
5099 |
30411
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
5100 (defun ada-get-body-name (&optional spec-name) |
63528
d6d50a511d12
(ada-format-paramlist)
Juanma Barranquero <lekktu@gmail.com>
parents:
63425
diff
changeset
|
5101 "Return the file name for the body of SPEC-NAME. |
d6d50a511d12
(ada-format-paramlist)
Juanma Barranquero <lekktu@gmail.com>
parents:
63425
diff
changeset
|
5102 If SPEC-NAME is nil, return the body for the current package. |
73422
e1bac685e6a0
(ada-83-string-keywords, ada-last-which-function-line ada-no-auto-case,
Juanma Barranquero <lekktu@gmail.com>
parents:
71924
diff
changeset
|
5103 Return nil if no body was found." |
30411
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
5104 (interactive) |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
5105 |
33716
c55ff055c68a
(ada-mode): `set '' -> `setq'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
32300
diff
changeset
|
5106 (unless spec-name (setq spec-name (buffer-file-name))) |
30411
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
5107 |
44465
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
5108 ;; Remove the spec extension. We can not simply remove the file extension, |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
5109 ;; but we need to take into account the specific non-GNAT extensions that the |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
5110 ;; user might have specified. |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
5111 |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
5112 (let ((suffixes ada-spec-suffixes) |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
5113 end) |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
5114 (while suffixes |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
5115 (setq end (- (length spec-name) (length (car suffixes)))) |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
5116 (if (string-equal (car suffixes) (substring spec-name end)) |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
5117 (setq spec-name (substring spec-name 0 end))) |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
5118 (setq suffixes (cdr suffixes)))) |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
5119 |
30411
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
5120 ;; If find-file.el was available, use its functions |
50812
15929fed5553
(ada-xemacs): Variable removed, since it's better to use (featurep 'xemacs).
Juanma Barranquero <lekktu@gmail.com>
parents:
50736
diff
changeset
|
5121 (if (fboundp 'ff-get-file-name) |
15929fed5553
(ada-xemacs): Variable removed, since it's better to use (featurep 'xemacs).
Juanma Barranquero <lekktu@gmail.com>
parents:
50736
diff
changeset
|
5122 (ff-get-file-name ada-search-directories-internal |
73531
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
5123 (ada-make-filename-from-adaname |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
5124 (file-name-nondirectory |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
5125 (file-name-sans-extension spec-name))) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
5126 ada-body-suffixes) |
30411
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
5127 ;; Else emulate it very simply |
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
5128 (concat (ada-make-filename-from-adaname |
73531
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
5129 (file-name-nondirectory |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
5130 (file-name-sans-extension spec-name))) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
5131 ".adb"))) |
30411
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
5132 |
26225
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
5133 |
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
5134 ;; --------------------------------------------------- |
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
5135 ;; support for font-lock.el |
17914
e5e2ef0dd5ab
(ada-krunch-args): Use gnatkr instead of gnatk8.
Richard M. Stallman <rms@gnu.org>
parents:
14415
diff
changeset
|
5136 ;; Strings are a real pain in Ada because a single quote character is |
e5e2ef0dd5ab
(ada-krunch-args): Use gnatkr instead of gnatk8.
Richard M. Stallman <rms@gnu.org>
parents:
14415
diff
changeset
|
5137 ;; overloaded as a string quote and type/instance delimiter. By default, a |
e5e2ef0dd5ab
(ada-krunch-args): Use gnatkr instead of gnatk8.
Richard M. Stallman <rms@gnu.org>
parents:
14415
diff
changeset
|
5138 ;; single quote is given punctuation syntax in `ada-mode-syntax-table'. |
e5e2ef0dd5ab
(ada-krunch-args): Use gnatkr instead of gnatk8.
Richard M. Stallman <rms@gnu.org>
parents:
14415
diff
changeset
|
5139 ;; So, for Font Lock mode purposes, we mark single quotes as having string |
26225
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
5140 ;; syntax when the gods that created Ada determine them to be. |
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
5141 ;; |
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
5142 ;; This only works in Emacs. See the comments before the grammar functions |
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
5143 ;; at the beginning of this file for how this is done with XEmacs. |
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
5144 ;; ---------------------------------------------------- |
17914
e5e2ef0dd5ab
(ada-krunch-args): Use gnatkr instead of gnatk8.
Richard M. Stallman <rms@gnu.org>
parents:
14415
diff
changeset
|
5145 |
e5e2ef0dd5ab
(ada-krunch-args): Use gnatkr instead of gnatk8.
Richard M. Stallman <rms@gnu.org>
parents:
14415
diff
changeset
|
5146 (defconst ada-font-lock-syntactic-keywords |
e5e2ef0dd5ab
(ada-krunch-args): Use gnatkr instead of gnatk8.
Richard M. Stallman <rms@gnu.org>
parents:
14415
diff
changeset
|
5147 ;; Mark single quotes as having string quote syntax in 'c' instances. |
80134
b0f27575dc50
(ada-font-lock-syntactic-keywords):
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
79854
diff
changeset
|
5148 ;; We used to explicitly avoid ''' as a special case for fear the buffer |
b0f27575dc50
(ada-font-lock-syntactic-keywords):
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
79854
diff
changeset
|
5149 ;; be highlighted as a string, but it seems this fear is unfounded. |
97058
b6ac850e9d2b
Fix bug #272, and update Ada mode to version 4.0.
Juanma Barranquero <lekktu@gmail.com>
parents:
95268
diff
changeset
|
5150 ;; |
b6ac850e9d2b
Fix bug #272, and update Ada mode to version 4.0.
Juanma Barranquero <lekktu@gmail.com>
parents:
95268
diff
changeset
|
5151 ;; This sets the properties of the characters, so that ada-in-string-p |
b6ac850e9d2b
Fix bug #272, and update Ada mode to version 4.0.
Juanma Barranquero <lekktu@gmail.com>
parents:
95268
diff
changeset
|
5152 ;; correctly handles '"' too... |
80134
b0f27575dc50
(ada-font-lock-syntactic-keywords):
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
79854
diff
changeset
|
5153 '(("[^a-zA-Z0-9)]\\('\\)[^\n]\\('\\)" (1 (7 . ?')) (2 (7 . ?'))) |
78589
56d6a084bbb6
(ada-create-syntax-table): Move
Martin Rudalics <rudalics@gmx.at>
parents:
78234
diff
changeset
|
5154 ("^[ \t]*\\(#\\(if\\|else\\|elsif\\|end\\)\\)" (1 (11 . ?\n))))) |
25903
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
5155 |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
5156 (defvar ada-font-lock-keywords |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
5157 (eval-when-compile |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
5158 (list |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
5159 ;; |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
5160 ;; handle "type T is access function return S;" |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
5161 (list "\\<\\(function[ \t]+return\\)\\>" '(1 font-lock-keyword-face) ) |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
5162 |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
5163 ;; preprocessor line |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
5164 (list "^[ \t]*\\(#.*\n\\)" '(1 font-lock-type-face t)) |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
5165 |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
5166 ;; |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
5167 ;; accept, entry, function, package (body), protected (body|type), |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
5168 ;; pragma, procedure, task (body) plus name. |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
5169 (list (concat |
73531
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
5170 "\\<\\(" |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
5171 "accept\\|" |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
5172 "entry\\|" |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
5173 "function\\|" |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
5174 "package[ \t]+body\\|" |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
5175 "package\\|" |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
5176 "pragma\\|" |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
5177 "procedure\\|" |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
5178 "protected[ \t]+body\\|" |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
5179 "protected[ \t]+type\\|" |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
5180 "protected\\|" |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
5181 "task[ \t]+body\\|" |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
5182 "task[ \t]+type\\|" |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
5183 "task" |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
5184 "\\)\\>[ \t]*" |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
5185 "\\(\\sw+\\(\\.\\sw*\\)*\\)?") |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
5186 '(1 font-lock-keyword-face) '(2 font-lock-function-name-face nil t)) |
25903
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
5187 ;; |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
5188 ;; Optional keywords followed by a type name. |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
5189 (list (concat ; ":[ \t]*" |
73531
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
5190 "\\<\\(access[ \t]+all\\|access[ \t]+constant\\|access\\|constant\\|in[ \t]+reverse\\|\\|in[ \t]+out\\|in\\|out\\)\\>" |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
5191 "[ \t]*" |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
5192 "\\(\\sw+\\(\\.\\sw*\\)*\\)?") |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
5193 '(1 font-lock-keyword-face nil t) '(2 font-lock-type-face nil t)) |
25903
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
5194 |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
5195 ;; |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
5196 ;; Main keywords, except those treated specially below. |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
5197 (concat "\\<" |
73531
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
5198 (regexp-opt |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
5199 '("abort" "abs" "abstract" "accept" "access" "aliased" "all" |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
5200 "and" "array" "at" "begin" "case" "declare" "delay" "delta" |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
5201 "digits" "do" "else" "elsif" "entry" "exception" "exit" "for" |
73922
289cedd46cd8
Delete `eval-and-compile' around `require'.
Juanma Barranquero <lekktu@gmail.com>
parents:
73531
diff
changeset
|
5202 "generic" "if" "in" "interface" "is" "limited" "loop" "mod" "not" |
289cedd46cd8
Delete `eval-and-compile' around `require'.
Juanma Barranquero <lekktu@gmail.com>
parents:
73531
diff
changeset
|
5203 "null" "or" "others" "overriding" "private" "protected" "raise" |
73531
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
5204 "range" "record" "rem" "renames" "requeue" "return" "reverse" |
73922
289cedd46cd8
Delete `eval-and-compile' around `require'.
Juanma Barranquero <lekktu@gmail.com>
parents:
73531
diff
changeset
|
5205 "select" "separate" "synchronized" "tagged" "task" "terminate" |
97058
b6ac850e9d2b
Fix bug #272, and update Ada mode to version 4.0.
Juanma Barranquero <lekktu@gmail.com>
parents:
95268
diff
changeset
|
5206 "then" "until" "when" "while" "with" "xor") t) |
73531
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
5207 "\\>") |
25903
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
5208 ;; |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
5209 ;; Anything following end and not already fontified is a body name. |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
5210 '("\\<\\(end\\)\\>\\([ \t]+\\)?\\(\\(\\sw\\|[_.]\\)+\\)?" |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
5211 (1 font-lock-keyword-face) (3 font-lock-function-name-face nil t)) |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
5212 ;; |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
5213 ;; Keywords followed by a type or function name. |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
5214 (list (concat "\\<\\(" |
73531
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
5215 "new\\|of\\|subtype\\|type" |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
5216 "\\)\\>[ \t]*\\(\\sw+\\(\\.\\sw*\\)*\\)?[ \t]*\\((\\)?") |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
5217 '(1 font-lock-keyword-face) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
5218 '(2 (if (match-beginning 4) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
5219 font-lock-function-name-face |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
5220 font-lock-type-face) nil t)) |
25903
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
5221 ;; |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
5222 ;; Keywords followed by a (comma separated list of) reference. |
44465
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
5223 ;; Note that font-lock only works on single lines, thus we can not |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
5224 ;; correctly highlight a with_clause that spans multiple lines. |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
5225 (list (concat "\\<\\(goto\\|raise\\|use\\|with\\)" |
73531
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
5226 "[ \t]+\\([a-zA-Z0-9_., \t]+\\)\\W") |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
5227 '(1 font-lock-keyword-face) '(2 font-lock-reference-face nil t)) |
50736
b0ce71ab9c28
(ada-search-directories): Take into account ADA_INCLUDE_PATH for better
Juanma Barranquero <lekktu@gmail.com>
parents:
49598
diff
changeset
|
5228 |
25903
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
5229 ;; |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
5230 ;; Goto tags. |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
5231 '("<<\\(\\sw+\\)>>" 1 font-lock-reference-face) |
44465
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
5232 |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
5233 ;; Highlight based-numbers (R. Reagan <robin-reply@reagans.org>) |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
5234 (list "\\([0-9]+#[0-9a-fA-F_]+#\\)" '(1 font-lock-constant-face t)) |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
5235 |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
5236 ;; Ada unnamed numerical constants |
0a0f75d152df
(ada-case-exception-file, ada-indent-handle-comment-special): New variables.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42619
diff
changeset
|
5237 (list "\\W\\([-+]?[0-9._]+\\)\\>" '(1 font-lock-constant-face)) |
49598
0d8b17d428b5
Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
45931
diff
changeset
|
5238 |
25903
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
5239 )) |
17914
e5e2ef0dd5ab
(ada-krunch-args): Use gnatkr instead of gnatk8.
Richard M. Stallman <rms@gnu.org>
parents:
14415
diff
changeset
|
5240 "Default expressions to highlight in Ada mode.") |
e5e2ef0dd5ab
(ada-krunch-args): Use gnatkr instead of gnatk8.
Richard M. Stallman <rms@gnu.org>
parents:
14415
diff
changeset
|
5241 |
30411
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
5242 |
26225
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
5243 ;; --------------------------------------------------------- |
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
5244 ;; Support for outline.el |
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
5245 ;; --------------------------------------------------------- |
25903
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
5246 |
17914
e5e2ef0dd5ab
(ada-krunch-args): Use gnatkr instead of gnatk8.
Richard M. Stallman <rms@gnu.org>
parents:
14415
diff
changeset
|
5247 (defun ada-outline-level () |
63528
d6d50a511d12
(ada-format-paramlist)
Juanma Barranquero <lekktu@gmail.com>
parents:
63425
diff
changeset
|
5248 "This is so that `current-column' DTRT in otherwise-hidden text." |
25903
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
5249 ;; patch from Dave Love <fx@gnu.org> |
24446
25556de3fe49
(ada-outline-level): Bind buffer-invisibility-spec.
Dave Love <fx@gnu.org>
parents:
24325
diff
changeset
|
5250 (let (buffer-invisibility-spec) |
25556de3fe49
(ada-outline-level): Bind buffer-invisibility-spec.
Dave Love <fx@gnu.org>
parents:
24325
diff
changeset
|
5251 (save-excursion |
25903
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
5252 (back-to-indentation) |
24446
25556de3fe49
(ada-outline-level): Bind buffer-invisibility-spec.
Dave Love <fx@gnu.org>
parents:
24325
diff
changeset
|
5253 (current-column)))) |
17914
e5e2ef0dd5ab
(ada-krunch-args): Use gnatkr instead of gnatk8.
Richard M. Stallman <rms@gnu.org>
parents:
14415
diff
changeset
|
5254 |
26225
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
5255 ;; --------------------------------------------------------- |
50736
b0ce71ab9c28
(ada-search-directories): Take into account ADA_INCLUDE_PATH for better
Juanma Barranquero <lekktu@gmail.com>
parents:
49598
diff
changeset
|
5256 ;; Support for narrow-to-region |
b0ce71ab9c28
(ada-search-directories): Take into account ADA_INCLUDE_PATH for better
Juanma Barranquero <lekktu@gmail.com>
parents:
49598
diff
changeset
|
5257 ;; --------------------------------------------------------- |
b0ce71ab9c28
(ada-search-directories): Take into account ADA_INCLUDE_PATH for better
Juanma Barranquero <lekktu@gmail.com>
parents:
49598
diff
changeset
|
5258 |
b0ce71ab9c28
(ada-search-directories): Take into account ADA_INCLUDE_PATH for better
Juanma Barranquero <lekktu@gmail.com>
parents:
49598
diff
changeset
|
5259 (defun ada-narrow-to-defun (&optional arg) |
63528
d6d50a511d12
(ada-format-paramlist)
Juanma Barranquero <lekktu@gmail.com>
parents:
63425
diff
changeset
|
5260 "Make text outside current subprogram invisible. |
50736
b0ce71ab9c28
(ada-search-directories): Take into account ADA_INCLUDE_PATH for better
Juanma Barranquero <lekktu@gmail.com>
parents:
49598
diff
changeset
|
5261 The subprogram visible is the one that contains or follow point. |
b0ce71ab9c28
(ada-search-directories): Take into account ADA_INCLUDE_PATH for better
Juanma Barranquero <lekktu@gmail.com>
parents:
49598
diff
changeset
|
5262 Optional ARG is ignored. |
73422
e1bac685e6a0
(ada-83-string-keywords, ada-last-which-function-line ada-no-auto-case,
Juanma Barranquero <lekktu@gmail.com>
parents:
71924
diff
changeset
|
5263 Use \\[widen] to go back to the full visibility for the buffer." |
50736
b0ce71ab9c28
(ada-search-directories): Take into account ADA_INCLUDE_PATH for better
Juanma Barranquero <lekktu@gmail.com>
parents:
49598
diff
changeset
|
5264 |
b0ce71ab9c28
(ada-search-directories): Take into account ADA_INCLUDE_PATH for better
Juanma Barranquero <lekktu@gmail.com>
parents:
49598
diff
changeset
|
5265 (interactive) |
b0ce71ab9c28
(ada-search-directories): Take into account ADA_INCLUDE_PATH for better
Juanma Barranquero <lekktu@gmail.com>
parents:
49598
diff
changeset
|
5266 (save-excursion |
b0ce71ab9c28
(ada-search-directories): Take into account ADA_INCLUDE_PATH for better
Juanma Barranquero <lekktu@gmail.com>
parents:
49598
diff
changeset
|
5267 (let (end) |
b0ce71ab9c28
(ada-search-directories): Take into account ADA_INCLUDE_PATH for better
Juanma Barranquero <lekktu@gmail.com>
parents:
49598
diff
changeset
|
5268 (widen) |
b0ce71ab9c28
(ada-search-directories): Take into account ADA_INCLUDE_PATH for better
Juanma Barranquero <lekktu@gmail.com>
parents:
49598
diff
changeset
|
5269 (forward-line 1) |
b0ce71ab9c28
(ada-search-directories): Take into account ADA_INCLUDE_PATH for better
Juanma Barranquero <lekktu@gmail.com>
parents:
49598
diff
changeset
|
5270 (ada-previous-procedure) |
b0ce71ab9c28
(ada-search-directories): Take into account ADA_INCLUDE_PATH for better
Juanma Barranquero <lekktu@gmail.com>
parents:
49598
diff
changeset
|
5271 |
b0ce71ab9c28
(ada-search-directories): Take into account ADA_INCLUDE_PATH for better
Juanma Barranquero <lekktu@gmail.com>
parents:
49598
diff
changeset
|
5272 (save-excursion |
73531
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
5273 (beginning-of-line) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
5274 (setq end (point))) |
50736
b0ce71ab9c28
(ada-search-directories): Take into account ADA_INCLUDE_PATH for better
Juanma Barranquero <lekktu@gmail.com>
parents:
49598
diff
changeset
|
5275 |
b0ce71ab9c28
(ada-search-directories): Take into account ADA_INCLUDE_PATH for better
Juanma Barranquero <lekktu@gmail.com>
parents:
49598
diff
changeset
|
5276 (ada-move-to-end) |
b0ce71ab9c28
(ada-search-directories): Take into account ADA_INCLUDE_PATH for better
Juanma Barranquero <lekktu@gmail.com>
parents:
49598
diff
changeset
|
5277 (end-of-line) |
b0ce71ab9c28
(ada-search-directories): Take into account ADA_INCLUDE_PATH for better
Juanma Barranquero <lekktu@gmail.com>
parents:
49598
diff
changeset
|
5278 (narrow-to-region end (point)) |
b0ce71ab9c28
(ada-search-directories): Take into account ADA_INCLUDE_PATH for better
Juanma Barranquero <lekktu@gmail.com>
parents:
49598
diff
changeset
|
5279 (message |
b0ce71ab9c28
(ada-search-directories): Take into account ADA_INCLUDE_PATH for better
Juanma Barranquero <lekktu@gmail.com>
parents:
49598
diff
changeset
|
5280 "Use M-x widen to get back to full visibility in the buffer")))) |
b0ce71ab9c28
(ada-search-directories): Take into account ADA_INCLUDE_PATH for better
Juanma Barranquero <lekktu@gmail.com>
parents:
49598
diff
changeset
|
5281 |
b0ce71ab9c28
(ada-search-directories): Take into account ADA_INCLUDE_PATH for better
Juanma Barranquero <lekktu@gmail.com>
parents:
49598
diff
changeset
|
5282 ;; --------------------------------------------------------- |
26225
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
5283 ;; Automatic generation of code |
71537
2a4ed80e93ba
(ada-which-compiler, ada-mode-menu, ada-compile-mouse-goto-error,
Juanma Barranquero <lekktu@gmail.com>
parents:
68764
diff
changeset
|
5284 ;; The Ada mode has a set of function to automatically generate a subprogram |
26225
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
5285 ;; or package body from its spec. |
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
5286 ;; These function only use a primary and basic algorithm, this could use a |
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
5287 ;; lot of improvement. |
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
5288 ;; When the user is using GNAT, we rather use gnatstub to generate an accurate |
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
5289 ;; body. |
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
5290 ;; ---------------------------------------------------------- |
10705 | 5291 |
12039
a75524689022
(initial comments): Copyright 1995; don't speak
Karl Heuer <kwzh@gnu.org>
parents:
11869
diff
changeset
|
5292 (defun ada-gen-treat-proc (match) |
26225
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
5293 "Make dummy body of a procedure/function specification. |
63528
d6d50a511d12
(ada-format-paramlist)
Juanma Barranquero <lekktu@gmail.com>
parents:
63425
diff
changeset
|
5294 MATCH is a cons cell containing the start and end locations of the last search |
d6d50a511d12
(ada-format-paramlist)
Juanma Barranquero <lekktu@gmail.com>
parents:
63425
diff
changeset
|
5295 for `ada-procedure-start-regexp'." |
12039
a75524689022
(initial comments): Copyright 1995; don't speak
Karl Heuer <kwzh@gnu.org>
parents:
11869
diff
changeset
|
5296 (goto-char (car match)) |
25903
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
5297 (let (func-found procname functype) |
12039
a75524689022
(initial comments): Copyright 1995; don't speak
Karl Heuer <kwzh@gnu.org>
parents:
11869
diff
changeset
|
5298 (cond |
25903
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
5299 ((or (looking-at "^[ \t]*procedure") |
73531
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
5300 (setq func-found (looking-at "^[ \t]*function"))) |
25903
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
5301 ;; treat it as a proc/func |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
5302 (forward-word 2) |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
5303 (forward-word -1) |
33716
c55ff055c68a
(ada-mode): `set '' -> `setq'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
32300
diff
changeset
|
5304 (setq procname (buffer-substring (point) (cdr match))) ; store proc name |
25903
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
5305 |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
5306 ;; goto end of procname |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
5307 (goto-char (cdr match)) |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
5308 |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
5309 ;; skip over parameterlist |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
5310 (unless (looking-at "[ \t\n]*\\(;\\|return\\)") |
73531
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
5311 (forward-sexp)) |
25903
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
5312 |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
5313 ;; if function, skip over 'return' and result type. |
12039
a75524689022
(initial comments): Copyright 1995; don't speak
Karl Heuer <kwzh@gnu.org>
parents:
11869
diff
changeset
|
5314 (if func-found |
73531
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
5315 (progn |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
5316 (forward-word 1) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
5317 (skip-chars-forward " \t\n") |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
5318 (setq functype (buffer-substring (point) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
5319 (progn |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
5320 (skip-chars-forward |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
5321 "a-zA-Z0-9_\.") |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
5322 (point)))))) |
25903
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
5323 ;; look for next non WS |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
5324 (cond |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
5325 ((looking-at "[ \t]*;") |
73531
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
5326 (delete-region (match-beginning 0) (match-end 0));; delete the ';' |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
5327 (ada-indent-newline-indent) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
5328 (insert "is") |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
5329 (ada-indent-newline-indent) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
5330 (if func-found |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
5331 (progn |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
5332 (insert "Result : " functype ";") |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
5333 (ada-indent-newline-indent))) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
5334 (insert "begin") |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
5335 (ada-indent-newline-indent) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
5336 (if func-found |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
5337 (insert "return Result;") |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
5338 (insert "null;")) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
5339 (ada-indent-newline-indent) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
5340 (insert "end " procname ";") |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
5341 (ada-indent-newline-indent) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
5342 ) |
97058
b6ac850e9d2b
Fix bug #272, and update Ada mode to version 4.0.
Juanma Barranquero <lekktu@gmail.com>
parents:
95268
diff
changeset
|
5343 |
25903
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
5344 ((looking-at "[ \t\n]*is") |
73531
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
5345 ;; do nothing |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
5346 ) |
97058
b6ac850e9d2b
Fix bug #272, and update Ada mode to version 4.0.
Juanma Barranquero <lekktu@gmail.com>
parents:
95268
diff
changeset
|
5347 |
25903
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
5348 ((looking-at "[ \t\n]*rename") |
73531
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
5349 ;; do nothing |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
5350 ) |
97058
b6ac850e9d2b
Fix bug #272, and update Ada mode to version 4.0.
Juanma Barranquero <lekktu@gmail.com>
parents:
95268
diff
changeset
|
5351 |
25903
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
5352 (t |
73531
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
5353 (message "unknown syntax")))) |
12039
a75524689022
(initial comments): Copyright 1995; don't speak
Karl Heuer <kwzh@gnu.org>
parents:
11869
diff
changeset
|
5354 (t |
25903
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
5355 (if (looking-at "^[ \t]*task") |
73531
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
5356 (progn |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
5357 (message "Task conversion is not yet implemented") |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
5358 (forward-word 2) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
5359 (if (looking-at "[ \t]*;") |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
5360 (forward-line) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
5361 (ada-move-to-end)) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
5362 )))))) |
12039
a75524689022
(initial comments): Copyright 1995; don't speak
Karl Heuer <kwzh@gnu.org>
parents:
11869
diff
changeset
|
5363 |
a75524689022
(initial comments): Copyright 1995; don't speak
Karl Heuer <kwzh@gnu.org>
parents:
11869
diff
changeset
|
5364 (defun ada-make-body () |
a75524689022
(initial comments): Copyright 1995; don't speak
Karl Heuer <kwzh@gnu.org>
parents:
11869
diff
changeset
|
5365 "Create an Ada package body in the current buffer. |
73922
289cedd46cd8
Delete `eval-and-compile' around `require'.
Juanma Barranquero <lekktu@gmail.com>
parents:
73531
diff
changeset
|
5366 The spec must be the previously visited buffer. |
74073
ef8cf7255613
(ada-make-body): Fix typo.
Juanma Barranquero <lekktu@gmail.com>
parents:
74002
diff
changeset
|
5367 This function typically is to be hooked into `ff-file-created-hook'." |
12039
a75524689022
(initial comments): Copyright 1995; don't speak
Karl Heuer <kwzh@gnu.org>
parents:
11869
diff
changeset
|
5368 (delete-region (point-min) (point-max)) |
64434
0eca480a23a7
(ada-make-body): Use `insert-buffer-substring' and `goto-char', not `insert-buffer'.
Juanma Barranquero <lekktu@gmail.com>
parents:
64085
diff
changeset
|
5369 (insert-buffer-substring (car (cdr (buffer-list)))) |
0eca480a23a7
(ada-make-body): Use `insert-buffer-substring' and `goto-char', not `insert-buffer'.
Juanma Barranquero <lekktu@gmail.com>
parents:
64085
diff
changeset
|
5370 (goto-char (point-min)) |
12039
a75524689022
(initial comments): Copyright 1995; don't speak
Karl Heuer <kwzh@gnu.org>
parents:
11869
diff
changeset
|
5371 (ada-mode) |
a75524689022
(initial comments): Copyright 1995; don't speak
Karl Heuer <kwzh@gnu.org>
parents:
11869
diff
changeset
|
5372 |
25903
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
5373 (let (found ada-procedure-or-package-start-regexp) |
33716
c55ff055c68a
(ada-mode): `set '' -> `setq'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
32300
diff
changeset
|
5374 (if (setq found |
73531
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
5375 (ada-search-ignore-string-comment ada-package-start-regexp nil)) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
5376 (progn (goto-char (cdr found)) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
5377 (insert " body") |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
5378 ) |
10705 | 5379 (error "No package")) |
25903
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
5380 |
33716
c55ff055c68a
(ada-mode): `set '' -> `setq'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
32300
diff
changeset
|
5381 (setq ada-procedure-or-package-start-regexp |
73531
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
5382 (concat ada-procedure-start-regexp |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
5383 "\\|" |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
5384 ada-package-start-regexp)) |
25903
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
5385 |
33716
c55ff055c68a
(ada-mode): `set '' -> `setq'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
32300
diff
changeset
|
5386 (while (setq found |
73531
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
5387 (ada-search-ignore-string-comment |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
5388 ada-procedure-or-package-start-regexp nil)) |
25903
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
5389 (progn |
73531
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
5390 (goto-char (car found)) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
5391 (if (looking-at ada-package-start-regexp) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
5392 (progn (goto-char (cdr found)) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
5393 (insert " body")) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
5394 (ada-gen-treat-proc found)))))) |
25903
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
5395 |
30411
41f228350eca
Got rid of all byte-compiler warnings on Emacs Load
Gerd Moellmann <gerd@gnu.org>
parents:
28995
diff
changeset
|
5396 |
25903
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
5397 (defun ada-make-subprogram-body () |
73922
289cedd46cd8
Delete `eval-and-compile' around `require'.
Juanma Barranquero <lekktu@gmail.com>
parents:
73531
diff
changeset
|
5398 "Create a dummy subprogram body in package body file from spec surrounding point." |
25903
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
5399 (interactive) |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
5400 (let* ((found (re-search-backward ada-procedure-start-regexp nil t)) |
73531
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
5401 (spec (match-beginning 0)) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
5402 body-file) |
25903
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
5403 (if found |
73531
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
5404 (progn |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
5405 (goto-char spec) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
5406 (if (and (re-search-forward "(\\|;" nil t) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
5407 (= (char-before) ?\()) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
5408 (progn |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
5409 (ada-search-ignore-string-comment ")" nil) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
5410 (ada-search-ignore-string-comment ";" nil))) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
5411 (setq spec (buffer-substring spec (point))) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
5412 |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
5413 ;; If find-file.el was available, use its functions |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
5414 (setq body-file (ada-get-body-name)) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
5415 (if body-file |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
5416 (find-file body-file) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
5417 (error "No body found for the package. Create it first")) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
5418 |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
5419 (save-restriction |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
5420 (widen) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
5421 (goto-char (point-max)) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
5422 (forward-comment -10000) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
5423 (re-search-backward "\\<end\\>" nil t) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
5424 ;; Move to the beginning of the elaboration part, if any |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
5425 (re-search-backward "^begin" nil t) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
5426 (newline) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
5427 (forward-char -1) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
5428 (insert spec) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
5429 (re-search-backward ada-procedure-start-regexp nil t) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
5430 (ada-gen-treat-proc (cons (match-beginning 0) (match-end 0))) |
7e876e4226ed
Change maintainer, apply whitespace-clean, checkdoc. Minor improvements to many
Juanma Barranquero <lekktu@gmail.com>
parents:
73434
diff
changeset
|
5431 )) |
25903
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
5432 (error "Not in subprogram spec")))) |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
5433 |
26225
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
5434 ;; -------------------------------------------------------- |
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
5435 ;; Global initializations |
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
5436 ;; -------------------------------------------------------- |
91cb7b3bae3c
Changed format of years in copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents:
25903
diff
changeset
|
5437 |
25903
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
5438 ;; Create the keymap once and for all. If we do that in ada-mode, |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
5439 ;; the keys changed in the user's .emacs have to be modified |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
5440 ;; every time |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
5441 (ada-create-keymap) |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
5442 (ada-create-menu) |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
5443 |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
5444 ;; Create the syntax tables, but do not activate them |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
5445 (ada-create-syntax-table) |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
5446 |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
5447 ;; Add the default extensions (and set up speedbar) |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
5448 (ada-add-extensions ".ads" ".adb") |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
5449 ;; This two files are generated by GNAT when running with -gnatD |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
5450 (if (equal ada-which-compiler 'gnat) |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
5451 (ada-add-extensions ".ads.dg" ".adb.dg")) |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
5452 |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
5453 ;; Read the special cases for exceptions |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
5454 (ada-case-read-exceptions) |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
5455 |
71537
2a4ed80e93ba
(ada-which-compiler, ada-mode-menu, ada-compile-mouse-goto-error,
Juanma Barranquero <lekktu@gmail.com>
parents:
68764
diff
changeset
|
5456 ;; Setup auto-loading of the other Ada mode files. |
73922
289cedd46cd8
Delete `eval-and-compile' around `require'.
Juanma Barranquero <lekktu@gmail.com>
parents:
73531
diff
changeset
|
5457 (autoload 'ada-change-prj "ada-xref" nil t) |
289cedd46cd8
Delete `eval-and-compile' around `require'.
Juanma Barranquero <lekktu@gmail.com>
parents:
73531
diff
changeset
|
5458 (autoload 'ada-check-current "ada-xref" nil t) |
289cedd46cd8
Delete `eval-and-compile' around `require'.
Juanma Barranquero <lekktu@gmail.com>
parents:
73531
diff
changeset
|
5459 (autoload 'ada-compile-application "ada-xref" nil t) |
289cedd46cd8
Delete `eval-and-compile' around `require'.
Juanma Barranquero <lekktu@gmail.com>
parents:
73531
diff
changeset
|
5460 (autoload 'ada-compile-current "ada-xref" nil t) |
289cedd46cd8
Delete `eval-and-compile' around `require'.
Juanma Barranquero <lekktu@gmail.com>
parents:
73531
diff
changeset
|
5461 (autoload 'ada-complete-identifier "ada-xref" nil t) |
289cedd46cd8
Delete `eval-and-compile' around `require'.
Juanma Barranquero <lekktu@gmail.com>
parents:
73531
diff
changeset
|
5462 (autoload 'ada-find-file "ada-xref" nil t) |
289cedd46cd8
Delete `eval-and-compile' around `require'.
Juanma Barranquero <lekktu@gmail.com>
parents:
73531
diff
changeset
|
5463 (autoload 'ada-find-any-references "ada-xref" nil t) |
289cedd46cd8
Delete `eval-and-compile' around `require'.
Juanma Barranquero <lekktu@gmail.com>
parents:
73531
diff
changeset
|
5464 (autoload 'ada-find-src-file-in-dir "ada-xref" nil t) |
289cedd46cd8
Delete `eval-and-compile' around `require'.
Juanma Barranquero <lekktu@gmail.com>
parents:
73531
diff
changeset
|
5465 (autoload 'ada-find-local-references "ada-xref" nil t) |
289cedd46cd8
Delete `eval-and-compile' around `require'.
Juanma Barranquero <lekktu@gmail.com>
parents:
73531
diff
changeset
|
5466 (autoload 'ada-find-references "ada-xref" nil t) |
289cedd46cd8
Delete `eval-and-compile' around `require'.
Juanma Barranquero <lekktu@gmail.com>
parents:
73531
diff
changeset
|
5467 (autoload 'ada-gdb-application "ada-xref" nil t) |
289cedd46cd8
Delete `eval-and-compile' around `require'.
Juanma Barranquero <lekktu@gmail.com>
parents:
73531
diff
changeset
|
5468 (autoload 'ada-goto-declaration "ada-xref" nil t) |
289cedd46cd8
Delete `eval-and-compile' around `require'.
Juanma Barranquero <lekktu@gmail.com>
parents:
73531
diff
changeset
|
5469 (autoload 'ada-goto-declaration-other-frame "ada-xref" nil t) |
289cedd46cd8
Delete `eval-and-compile' around `require'.
Juanma Barranquero <lekktu@gmail.com>
parents:
73531
diff
changeset
|
5470 (autoload 'ada-goto-parent "ada-xref" nil t) |
289cedd46cd8
Delete `eval-and-compile' around `require'.
Juanma Barranquero <lekktu@gmail.com>
parents:
73531
diff
changeset
|
5471 (autoload 'ada-make-body-gnatstub "ada-xref" nil t) |
289cedd46cd8
Delete `eval-and-compile' around `require'.
Juanma Barranquero <lekktu@gmail.com>
parents:
73531
diff
changeset
|
5472 (autoload 'ada-point-and-xref "ada-xref" nil t) |
289cedd46cd8
Delete `eval-and-compile' around `require'.
Juanma Barranquero <lekktu@gmail.com>
parents:
73531
diff
changeset
|
5473 (autoload 'ada-reread-prj-file "ada-xref" nil t) |
289cedd46cd8
Delete `eval-and-compile' around `require'.
Juanma Barranquero <lekktu@gmail.com>
parents:
73531
diff
changeset
|
5474 (autoload 'ada-run-application "ada-xref" nil t) |
289cedd46cd8
Delete `eval-and-compile' around `require'.
Juanma Barranquero <lekktu@gmail.com>
parents:
73531
diff
changeset
|
5475 (autoload 'ada-set-default-project-file "ada-xref" nil t) |
289cedd46cd8
Delete `eval-and-compile' around `require'.
Juanma Barranquero <lekktu@gmail.com>
parents:
73531
diff
changeset
|
5476 (autoload 'ada-xref-goto-previous-reference "ada-xref" nil t) |
74002
5909c257c4ea
(ada-mode-version): Bump version.
Juanma Barranquero <lekktu@gmail.com>
parents:
73935
diff
changeset
|
5477 (autoload 'ada-set-main-compile-application "ada-xref" nil t) |
5909c257c4ea
(ada-mode-version): Bump version.
Juanma Barranquero <lekktu@gmail.com>
parents:
73935
diff
changeset
|
5478 (autoload 'ada-show-current-main "ada-xref" nil t) |
73922
289cedd46cd8
Delete `eval-and-compile' around `require'.
Juanma Barranquero <lekktu@gmail.com>
parents:
73531
diff
changeset
|
5479 |
289cedd46cd8
Delete `eval-and-compile' around `require'.
Juanma Barranquero <lekktu@gmail.com>
parents:
73531
diff
changeset
|
5480 (autoload 'ada-customize "ada-prj" nil t) |
289cedd46cd8
Delete `eval-and-compile' around `require'.
Juanma Barranquero <lekktu@gmail.com>
parents:
73531
diff
changeset
|
5481 (autoload 'ada-prj-edit "ada-prj" nil t) |
289cedd46cd8
Delete `eval-and-compile' around `require'.
Juanma Barranquero <lekktu@gmail.com>
parents:
73531
diff
changeset
|
5482 (autoload 'ada-prj-new "ada-prj" nil t) |
289cedd46cd8
Delete `eval-and-compile' around `require'.
Juanma Barranquero <lekktu@gmail.com>
parents:
73531
diff
changeset
|
5483 (autoload 'ada-prj-save "ada-prj" nil t) |
50736
b0ce71ab9c28
(ada-search-directories): Take into account ADA_INCLUDE_PATH for better
Juanma Barranquero <lekktu@gmail.com>
parents:
49598
diff
changeset
|
5484 |
b0ce71ab9c28
(ada-search-directories): Take into account ADA_INCLUDE_PATH for better
Juanma Barranquero <lekktu@gmail.com>
parents:
49598
diff
changeset
|
5485 (autoload 'ada-array "ada-stmt" nil t) |
b0ce71ab9c28
(ada-search-directories): Take into account ADA_INCLUDE_PATH for better
Juanma Barranquero <lekktu@gmail.com>
parents:
49598
diff
changeset
|
5486 (autoload 'ada-case "ada-stmt" nil t) |
b0ce71ab9c28
(ada-search-directories): Take into account ADA_INCLUDE_PATH for better
Juanma Barranquero <lekktu@gmail.com>
parents:
49598
diff
changeset
|
5487 (autoload 'ada-declare-block "ada-stmt" nil t) |
b0ce71ab9c28
(ada-search-directories): Take into account ADA_INCLUDE_PATH for better
Juanma Barranquero <lekktu@gmail.com>
parents:
49598
diff
changeset
|
5488 (autoload 'ada-else "ada-stmt" nil t) |
b0ce71ab9c28
(ada-search-directories): Take into account ADA_INCLUDE_PATH for better
Juanma Barranquero <lekktu@gmail.com>
parents:
49598
diff
changeset
|
5489 (autoload 'ada-elsif "ada-stmt" nil t) |
b0ce71ab9c28
(ada-search-directories): Take into account ADA_INCLUDE_PATH for better
Juanma Barranquero <lekktu@gmail.com>
parents:
49598
diff
changeset
|
5490 (autoload 'ada-exception "ada-stmt" nil t) |
b0ce71ab9c28
(ada-search-directories): Take into account ADA_INCLUDE_PATH for better
Juanma Barranquero <lekktu@gmail.com>
parents:
49598
diff
changeset
|
5491 (autoload 'ada-exception-block "ada-stmt" nil t) |
b0ce71ab9c28
(ada-search-directories): Take into account ADA_INCLUDE_PATH for better
Juanma Barranquero <lekktu@gmail.com>
parents:
49598
diff
changeset
|
5492 (autoload 'ada-exit "ada-stmt" nil t) |
b0ce71ab9c28
(ada-search-directories): Take into account ADA_INCLUDE_PATH for better
Juanma Barranquero <lekktu@gmail.com>
parents:
49598
diff
changeset
|
5493 (autoload 'ada-for-loop "ada-stmt" nil t) |
b0ce71ab9c28
(ada-search-directories): Take into account ADA_INCLUDE_PATH for better
Juanma Barranquero <lekktu@gmail.com>
parents:
49598
diff
changeset
|
5494 (autoload 'ada-function-spec "ada-stmt" nil t) |
b0ce71ab9c28
(ada-search-directories): Take into account ADA_INCLUDE_PATH for better
Juanma Barranquero <lekktu@gmail.com>
parents:
49598
diff
changeset
|
5495 (autoload 'ada-header "ada-stmt" nil t) |
b0ce71ab9c28
(ada-search-directories): Take into account ADA_INCLUDE_PATH for better
Juanma Barranquero <lekktu@gmail.com>
parents:
49598
diff
changeset
|
5496 (autoload 'ada-if "ada-stmt" nil t) |
b0ce71ab9c28
(ada-search-directories): Take into account ADA_INCLUDE_PATH for better
Juanma Barranquero <lekktu@gmail.com>
parents:
49598
diff
changeset
|
5497 (autoload 'ada-loop "ada-stmt" nil t) |
b0ce71ab9c28
(ada-search-directories): Take into account ADA_INCLUDE_PATH for better
Juanma Barranquero <lekktu@gmail.com>
parents:
49598
diff
changeset
|
5498 (autoload 'ada-package-body "ada-stmt" nil t) |
b0ce71ab9c28
(ada-search-directories): Take into account ADA_INCLUDE_PATH for better
Juanma Barranquero <lekktu@gmail.com>
parents:
49598
diff
changeset
|
5499 (autoload 'ada-package-spec "ada-stmt" nil t) |
b0ce71ab9c28
(ada-search-directories): Take into account ADA_INCLUDE_PATH for better
Juanma Barranquero <lekktu@gmail.com>
parents:
49598
diff
changeset
|
5500 (autoload 'ada-private "ada-stmt" nil t) |
b0ce71ab9c28
(ada-search-directories): Take into account ADA_INCLUDE_PATH for better
Juanma Barranquero <lekktu@gmail.com>
parents:
49598
diff
changeset
|
5501 (autoload 'ada-procedure-spec "ada-stmt" nil t) |
b0ce71ab9c28
(ada-search-directories): Take into account ADA_INCLUDE_PATH for better
Juanma Barranquero <lekktu@gmail.com>
parents:
49598
diff
changeset
|
5502 (autoload 'ada-record "ada-stmt" nil t) |
b0ce71ab9c28
(ada-search-directories): Take into account ADA_INCLUDE_PATH for better
Juanma Barranquero <lekktu@gmail.com>
parents:
49598
diff
changeset
|
5503 (autoload 'ada-subprogram-body "ada-stmt" nil t) |
b0ce71ab9c28
(ada-search-directories): Take into account ADA_INCLUDE_PATH for better
Juanma Barranquero <lekktu@gmail.com>
parents:
49598
diff
changeset
|
5504 (autoload 'ada-subtype "ada-stmt" nil t) |
b0ce71ab9c28
(ada-search-directories): Take into account ADA_INCLUDE_PATH for better
Juanma Barranquero <lekktu@gmail.com>
parents:
49598
diff
changeset
|
5505 (autoload 'ada-tabsize "ada-stmt" nil t) |
b0ce71ab9c28
(ada-search-directories): Take into account ADA_INCLUDE_PATH for better
Juanma Barranquero <lekktu@gmail.com>
parents:
49598
diff
changeset
|
5506 (autoload 'ada-task-body "ada-stmt" nil t) |
b0ce71ab9c28
(ada-search-directories): Take into account ADA_INCLUDE_PATH for better
Juanma Barranquero <lekktu@gmail.com>
parents:
49598
diff
changeset
|
5507 (autoload 'ada-task-spec "ada-stmt" nil t) |
b0ce71ab9c28
(ada-search-directories): Take into account ADA_INCLUDE_PATH for better
Juanma Barranquero <lekktu@gmail.com>
parents:
49598
diff
changeset
|
5508 (autoload 'ada-type "ada-stmt" nil t) |
b0ce71ab9c28
(ada-search-directories): Take into account ADA_INCLUDE_PATH for better
Juanma Barranquero <lekktu@gmail.com>
parents:
49598
diff
changeset
|
5509 (autoload 'ada-use "ada-stmt" nil t) |
b0ce71ab9c28
(ada-search-directories): Take into account ADA_INCLUDE_PATH for better
Juanma Barranquero <lekktu@gmail.com>
parents:
49598
diff
changeset
|
5510 (autoload 'ada-when "ada-stmt" nil t) |
b0ce71ab9c28
(ada-search-directories): Take into account ADA_INCLUDE_PATH for better
Juanma Barranquero <lekktu@gmail.com>
parents:
49598
diff
changeset
|
5511 (autoload 'ada-while-loop "ada-stmt" nil t) |
b0ce71ab9c28
(ada-search-directories): Take into account ADA_INCLUDE_PATH for better
Juanma Barranquero <lekktu@gmail.com>
parents:
49598
diff
changeset
|
5512 (autoload 'ada-with "ada-stmt" nil t) |
25903
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
5513 |
812005e9c20e
(ada-get-indent-*, ada-indent-current, ada-goto-*,
Gerd Moellmann <gerd@gnu.org>
parents:
25420
diff
changeset
|
5514 ;;; provide ourselves |
10705 | 5515 (provide 'ada-mode) |
5516 | |
78600
4f60c94dc647
Fix up comment style in header.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
78589
diff
changeset
|
5517 ;; arch-tag: 1b7d45ec-1698-43b5-8d4a-e479ea023270 |
10707 | 5518 ;;; ada-mode.el ends here |