emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] Changes to emacs/lisp/progmodes/ada-mode.el,v


From: Juanma Barranquero
Subject: [Emacs-diffs] Changes to emacs/lisp/progmodes/ada-mode.el,v
Date: Sun, 29 Oct 2006 15:29:57 +0000

CVSROOT:        /cvsroot/emacs
Module name:    emacs
Changes by:     Juanma Barranquero <lektu>      06/10/29 15:29:57

Index: ada-mode.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/progmodes/ada-mode.el,v
retrieving revision 1.77
retrieving revision 1.78
diff -u -b -r1.77 -r1.78
--- ada-mode.el 19 Oct 2006 10:31:48 -0000      1.77
+++ ada-mode.el 29 Oct 2006 15:29:57 -0000      1.78
@@ -6,8 +6,7 @@
 ;; Author: Rolf Ebert      <address@hidden>
 ;;      Markus Heritsch <address@hidden>
 ;;      Emmanuel Briot  <address@hidden>
-;; Maintainer: Emmanuel Briot <address@hidden>
-;; Ada Core Technologies's version:   Revision: 1.188
+;; Maintainer: Stephen Leake <address@hidden>
 ;; Keywords: languages ada
 
 ;; This file is part of GNU Emacs.
@@ -30,7 +29,7 @@
 ;;; Commentary:
 ;;; This mode is a major mode for editing Ada83 and Ada95 source code.
 ;;; This is a major rewrite of the file packaged with Emacs-20.  The
-;;; ada-mode is composed of four lisp files, ada-mode.el, ada-xref.el,
+;;; ada-mode is composed of four Lisp files, ada-mode.el, ada-xref.el,
 ;;; ada-prj.el and ada-stmt.el. Only this file (ada-mode.el) is
 ;;; completely independent from the GNU Ada compiler Gnat, distributed
 ;;; by Ada Core Technologies. All the other files rely heavily on
@@ -79,14 +78,14 @@
 ;;; to his version.
 ;;;
 ;;; A complete rewrite for Emacs-20 / Gnat-3.11 has been done by Ada Core
-;;; Technologies. Please send bugs to  address@hidden
+;;; Technologies.
 
 ;;; Credits:
 ;;;   Many thanks to John McCabe <address@hidden> for sending so
 ;;;     many patches included in this package.
 ;;;   Christian Egli <address@hidden>:
 ;;;     ada-imenu-generic-expression
-;;;   Many thanks also to the following persons that have contributed one day
+;;;   Many thanks also to the following persons that have contributed
 ;;;   to the ada-mode
 ;;;     Philippe Waroquiers (PW) <address@hidden> in particular,
 ;;;     address@hidden (John Woodruff)
@@ -155,6 +154,14 @@
 ;;(if (not (ada-check-emacs-version 21 1))
 ;;    (require 'ada-support))
 
+(defun ada-mode-version ()
+  "Return Ada mode version."
+  (interactive)
+  (let ((version-string "3.5"))
+    (if (interactive-p)
+       (message version-string)
+      version-string)))
+
 (defvar ada-mode-hook nil
   "*List of functions to call when Ada mode is invoked.
 This hook is automatically executed after the `ada-mode' is
@@ -162,7 +169,7 @@
 This is a good place to add Ada environment specific bindings.")
 
 (defgroup ada nil
-  "Major mode for editing Ada source in Emacs."
+  "Major mode for editing and compiling Ada source in Emacs."
   :link '(custom-group-link :tag "Font Lock Faces group" font-lock-faces)
   :group 'languages)
 
@@ -178,7 +185,7 @@
 An example is :
   declare
      A,
-     >>>>>B : Integer;  --  from ada-broken-decl-indent"
+     >>>>>B : Integer;"
   :type 'integer :group 'ada)
 
 (defcustom ada-broken-indent 2
@@ -186,7 +193,7 @@
 
 An example is :
    My_Var : My_Type := (Field1 =>
-                        >>>>>>>>>Value);  -- from ada-broken-indent"
+                       >>>>>>>>>Value);"
   :type 'integer :group 'ada)
 
 (defcustom ada-continuation-indent ada-broken-indent
@@ -255,7 +262,7 @@
 An example is :
 procedure Foo is
 begin
->>>>>>>>>>null;  --  from ada-indent"
+>>>>>>>>>>null;"
   :type 'integer  :group 'ada)
 
 (defcustom ada-indent-after-return t
@@ -308,7 +315,7 @@
 
 An example is:
    type A is
-   >>>>>>>>>>>record    --  from ada-indent-record-rel-type"
+   >>>>>>>>>>>record"
   :type 'integer :group 'ada)
 
 (defcustom ada-indent-renames ada-broken-indent
@@ -318,8 +325,8 @@
 
 An example is:
    function A (B : Integer)
-       return C;      --  from ada-indent-return
-   >>>renames Foo;    --  from ada-indent-renames"
+       return C;
+   >>>renames Foo;"
   :type 'integer :group 'ada)
 
 (defcustom ada-indent-return 0
@@ -329,7 +336,7 @@
 
 An example is:
    function A (B : Integer)
-   >>>>>return C;       --  from ada-indent-return"
+   >>>>>return C;"
   :type 'integer :group 'ada)
 
 (defcustom ada-indent-to-open-paren t
@@ -353,7 +360,7 @@
 An example is:
 procedure Foo is
 begin
->>>>>>>>>>>>Label:  --  from ada-label-indent
+>>>>Label:
 
 This is also used for <<..>> labels"
   :type 'integer :group 'ada)
@@ -363,8 +370,7 @@
   :type '(choice (const ada83) (const ada95)) :group 'ada)
 
 (defcustom ada-move-to-declaration nil
-  "*Non-nil means `ada-move-to-start' moves point to the subprogram 
declaration,
-not to 'begin'."
+  "*Non-nil means `ada-move-to-start' moves to the subprogram declaration, not 
to 'begin'."
   :type 'boolean :group 'ada)
 
 (defcustom ada-popup-key '[down-mouse-3]
@@ -378,10 +384,9 @@
          (split-string (or (getenv "ADA_INCLUDE_PATH") "") ":")
          '("/usr/adainclude" "/usr/local/adainclude"
            "/opt/gnu/adainclude"))
-  "*List of directories to search for Ada files.
+  "*Default list of directories to search for Ada files.
 See the description for the `ff-search-directories' variable.  This variable
-is the initial value of this variable, and is copied and modified in
-`ada-search-directories-internal'."
+is the initial value of `ada-search-directories-internal'."
   :type '(repeat (choice :tag "Directory"
                          (const :tag "default" nil)
                          (directory :format "%v")))
@@ -398,7 +403,7 @@
 
 An example is:
    if A = B
-   >>>>>>>>>>>then   --  from ada-stmt-end-indent"
+   >>>>then"
   :type 'integer :group 'ada)
 
 (defcustom ada-tab-policy 'indent-auto
@@ -406,7 +411,7 @@
 Must be one of :
 `indent-rigidly' : always adds `ada-indent' blanks at the beginning of the 
line.
 `indent-auto'    : use indentation functions in this file.
-`always-tab'     : do indent-relative."
+`always-tab'     : do `indent-relative'."
   :type '(choice (const indent-auto)
                  (const indent-rigidly)
                  (const always-tab))
@@ -417,7 +422,7 @@
 
 An example is:
    use Ada.Text_IO,
-   >>>>>Ada.Numerics;    --  from ada-use-indent"
+   >>>>Ada.Numerics;"
   :type 'integer :group 'ada)
 
 (defcustom ada-when-indent 3
@@ -425,7 +430,7 @@
 
 An example is:
    case A is
-   >>>>>>>>when B =>     --  from ada-when-indent"
+   >>>>when B =>"
   :type 'integer :group 'ada)
 
 (defcustom ada-with-indent ada-broken-indent
@@ -433,7 +438,7 @@
 
 An example is:
    with Ada.Text_IO,
-   >>>>>Ada.Numerics;    --  from ada-with-indent"
+   >>>>Ada.Numerics;"
   :type 'integer :group 'ada)
 
 (defcustom ada-which-compiler 'gnat
@@ -511,7 +516,7 @@
       ("[^=]\\(\\s-+\\)=[^=]" 1 t)
       ("\\(\\s-*\\)use\\s-" 1)
       ("\\(\\s-*\\)--" 1))
-    "Ada support for align.el <= 2.2
+    "Ada support for align.el <= 2.2.
 This variable provides regular expressions on which to align different lines.
 See `align-mode-alist' for more information.")
 
@@ -738,9 +743,10 @@
   "Replace `compile-goto-error' from compile.el.
 If POS is on a file and line location, go to this position.  It adds
 to compile.el the capacity to go to a reference in an error message.
-For instance, on this line:
+For instance, on these lines:
   foo.adb:61:11:  [...] in call to size declared at foo.ads:11
-both file locations can be clicked on and jumped to."
+  foo.adb:61:11:  [...] in call to local declared at line 20
+the 4 file locations can be clicked on and jumped to."
   (interactive "d")
   (goto-char pos)
 
@@ -955,7 +961,8 @@
 ;;------------------------------------------------------------------
 
 (defsubst ada-in-comment-p (&optional parse-result)
-  "Return t if inside a comment."
+  "Return t if inside a comment.
+If PARSE-RESULT is non-nil, use it instead of calling `parse-partial-sexp'."
   (nth 4 (or parse-result
              (parse-partial-sexp
               (line-beginning-position) (point)))))
@@ -968,7 +975,8 @@
               (line-beginning-position) (point)))))
 
 (defsubst ada-in-string-or-comment-p (&optional parse-result)
-  "Return t if inside a comment or string."
+  "Return t if inside a comment or string.
+If PARSE-RESULT is non-nil, use it instead of calling `parse-partial-sexp'."
   (setq parse-result (or parse-result
                          (parse-partial-sexp
                           (line-beginning-position) (point))))
@@ -1366,7 +1374,7 @@
 
   ;; the following has to be done after running the ada-mode-hook
   ;; because users might want to set the values of these variable
-  ;; inside the hook (MH)
+  ;; inside the hook
 
   (cond ((eq ada-language-version 'ada83)
          (setq ada-keywords ada-83-keywords))
@@ -1408,10 +1416,8 @@
 ;;-----------------------------------------------------------------
 
 (defun ada-save-exceptions-to-file (file-name)
-  "Save the exception lists `ada-case-exception' and
-`ada-case-exception-substring' to the file FILE-NAME."
-
-  ;;  Save the list in the file
+  "Save the casing exception lists to the file FILE-NAME.
+Casing exception lists are `ada-case-exception' and 
`ada-case-exception-substring'."
   (find-file (expand-file-name file-name))
   (erase-buffer)
   (mapcar (lambda (x) (insert (car x) "\n"))
@@ -1741,8 +1747,8 @@
         (delete-char 1)))))
 
 (defun ada-no-auto-case (&optional arg)
-  "Do nothing.
-This function can be used for the auto-casing variables in the Ada mode, to
+  "Do nothing.  ARG is ignored.
+This function can be used for the auto-casing variables in Ada mode, to
 adapt to unusal auto-casing schemes.  Since it does nothing, you can for
 instance use it for `ada-case-identifier' if you don't want any special
 auto-casing for identifiers, whereas keywords have to be lower-cased.
@@ -2149,8 +2155,7 @@
 
 (defun ada-indent-newline-indent-conditional ()
   "Insert a newline and indent it.
-The original line is indented first if `ada-indent-after-return' is non-nil.
-This function is intended to be bound to the C-m and C-j keys."
+The original line is indented first if `ada-indent-after-return' is non-nil."
   (interactive "*")
   (if ada-indent-after-return (ada-indent-current))
   (newline)
@@ -3699,9 +3704,7 @@
         (found nil)
         (pos nil))
 
-    ;;
     ;; search backward for interesting keywords
-    ;;
     (while (and
             (not found)
             (ada-search-ignore-string-comment ada-matching-start-re t))
@@ -3711,9 +3714,7 @@
                      (forward-word -1)
                      (looking-at "\\<null\\>")))
         (progn
-          ;;
           ;; calculate nest-depth
-          ;;
           (cond
            ;; found block end => increase nest depth
            ((looking-at "end")
@@ -3724,9 +3725,7 @@
            ((looking-at "loop\\|select\\|record\\|case\\|if")
             (setq pos (point))
             (save-excursion
-              ;;
               ;; check if keyword follows 'end'
-              ;;
               (ada-goto-previous-word)
               (if (looking-at "\\<end\\>[ \t]*[^;]")
                   ;; it ends a block => increase nest depth
@@ -3798,7 +3797,6 @@
             (setq nest-count (1- nest-count)))) ; end of 'cond'
 
           ;; match is found, if nest-depth is zero
-          ;;
           (setq found (zerop nest-count))))) ; end of loop
 
     (if (bobp)
@@ -3948,12 +3946,12 @@
 (defun ada-search-ignore-string-comment
   (search-re &optional backward limit paramlists search-func)
   "Regexp-search for SEARCH-RE, ignoring comments, strings.
-If PARAMLISTS is nil, ignore parameter lists.  Returns a cons cell of
-begin and end of match data or nil, if not found.
-The search is done using SEARCH-FUNC, which should search backward if
-BACKWARD is non-nil, forward otherwise.  SEARCH-FUNC can be optimized
-in case we are searching for a constant string.
+Returns a cons cell of begin and end of match data or nil, if not found.
+If BACKWARD is non-nil, search backward; search forward otherwise.
 The search stops at pos LIMIT.
+If PARAMLISTS is nil, ignore parameter lists.
+The search is done using SEARCH-FUNC. SEARCH-FUNC can be optimized
+in case we are searching for a constant string.
 Point is moved at the beginning of the SEARCH-RE."
   (let (found
         begin
@@ -3961,6 +3959,7 @@
         parse-result
         (previous-syntax-table (syntax-table)))
 
+    ;; FIXME: need to pass BACKWARD to search-func!
     (unless search-func
       (setq search-func (if backward 're-search-backward 're-search-forward)))
 
@@ -4120,8 +4119,8 @@
                            "type\\)\\>"))))))
 
 (defun ada-search-ignore-complex-boolean (regexp backwardp)
-  "Like `ada-search-ignore-string-comment', except that it also ignores
-boolean expressions 'and then' and 'or else'."
+  "Search for REGEXP, ignoring comments, strings, 'and then', 'or else'.
+If BACKWARDP is non-nil, search backward; search forward otherwise."
   (let (result)
   (while (and (setq result (ada-search-ignore-string-comment regexp backwardp))
              (save-excursion (forward-word -1)
@@ -4129,7 +4128,8 @@
   result))
 
 (defun ada-in-open-paren-p ()
-  "Return the position of the first non-ws behind the last unclosed
+  "Non-nil if in an open parenthesis.
+Return value is the position of the first non-ws behind the last unclosed
 parenthesis, or nil."
   (save-excursion
     (let ((parse (parse-partial-sexp
@@ -4176,6 +4176,7 @@
 
 (defun ada-untab (arg)
   "Delete leading indenting according to `ada-tab-policy'."
+  ;; FIXME: ARG is ignored
   (interactive "P")
   (cond ((eq ada-tab-policy 'indent-rigidly) (ada-untab-hard))
         ((eq ada-tab-policy 'indent-auto) (error "Not implemented"))
@@ -4607,15 +4608,13 @@
               :included (string-match "gvd" ada-prj-default-debugger)])
             ["Customize"     (customize-group 'ada)
              :included (fboundp 'customize-group)]
-            ["Check file"    ada-check-current   (eq ada-which-compiler 'gnat)]
-            ["Compile file"  ada-compile-current (eq ada-which-compiler 'gnat)]
-            ["Build"         ada-compile-application
-             (eq ada-which-compiler 'gnat)]
+            ["Check file"    ada-check-current   t]
+            ["Compile file"  ada-compile-current t]
+            ["Build"         ada-compile-application t]
             ["Run"           ada-run-application     t]
             ["Debug"         ada-gdb-application (eq ada-which-compiler 'gnat)]
             ["------"        nil nil]
             ("Project"
-              :included (eq ada-which-compiler 'gnat)
              ["Load..."      ada-set-default-project-file t]
              ["New..."       ada-prj-new                  t]
              ["Edit..."      ada-prj-edit                 t])
@@ -4752,7 +4751,8 @@
           ))))
 
 (defun ada-uncomment-region (beg end &optional arg)
-  "Delete `comment-start' at the beginning of a line in the region."
+  "Uncomment region BEG .. END.
+ARG gives number of comment characters."
   (interactive "r\nP")
 
   ;;  This advice is not needed anymore with Emacs21. However, for older
@@ -4890,7 +4890,8 @@
 ;; Overriden when we work with GNAT, to use gnatkrunch
 (defun ada-make-filename-from-adaname (adaname)
   "Determine the filename in which ADANAME is found.
-This is a generic function, independent from any compiler."
+This matches the GNAT default naming convention, except for
+pre-defined units."
   (while (string-match "\\." adaname)
     (setq adaname (replace-match "-" t t adaname)))
   (downcase adaname)
@@ -5050,8 +5051,7 @@
        (ff-find-other-file t)))
 
 (defun ada-set-point-accordingly ()
-  "Move to the function declaration that was set by
-`ff-which-function-are-we-in'."
+  "Move to the function declaration that was set by 
`ff-which-function-are-we-in'."
   (if ff-function-name
       (progn
         (goto-char (point-min))




reply via email to

[Prev in Thread] Current Thread [Next in Thread]