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


From: Juanma Barranquero
Subject: [Emacs-diffs] Changes to emacs/lisp/progmodes/ada-mode.el
Date: Thu, 16 Jun 2005 20:20:14 -0400

Index: emacs/lisp/progmodes/ada-mode.el
diff -c emacs/lisp/progmodes/ada-mode.el:1.64 
emacs/lisp/progmodes/ada-mode.el:1.65
*** emacs/lisp/progmodes/ada-mode.el:1.64       Tue Jun 14 15:23:26 2005
--- emacs/lisp/progmodes/ada-mode.el    Fri Jun 17 00:20:14 2005
***************
*** 31,39 ****
  ;;; 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-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
  ;;; features provided only by Gnat.
  ;;;
  ;;; Note: this mode will not work with Emacs 19. If you are on a VMS
--- 31,39 ----
  ;;; 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-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
  ;;; features provided only by Gnat.
  ;;;
  ;;; Note: this mode will not work with Emacs 19. If you are on a VMS
***************
*** 136,142 ****
  ;; this function is needed at compile time
  (eval-and-compile
    (defun ada-check-emacs-version (major minor &optional is-xemacs)
!     "Returns t if Emacs's version is greater or equal to MAJOR.MINOR.
  If IS-XEMACS is non-nil, check for XEmacs instead of Emacs."
      (let ((xemacs-running (or (string-match "Lucid"  emacs-version)
                                (string-match "XEmacs" emacs-version))))
--- 136,142 ----
  ;; this function is needed at compile time
  (eval-and-compile
    (defun ada-check-emacs-version (major minor &optional is-xemacs)
!     "Return t if Emacs's version is greater or equal to MAJOR.MINOR.
  If IS-XEMACS is non-nil, check for XEmacs instead of Emacs."
      (let ((xemacs-running (or (string-match "Lucid"  emacs-version)
                                (string-match "XEmacs" emacs-version))))
***************
*** 186,193 ****
    :type 'integer :group 'ada)
  
  (defcustom ada-continuation-indent ada-broken-indent
!   "*Number of columns to indent the continuation of broken lines in
! parenthesis.
  
  An example is :
     Func (Param1,
--- 186,192 ----
    :type 'integer :group 'ada)
  
  (defcustom ada-continuation-indent ada-broken-indent
!   "*Number of columns to indent the continuation of broken lines in 
parenthesis.
  
  An example is :
     Func (Param1,
***************
*** 212,221 ****
  when you call `ada-create-case-exception'.
  
  These files should contain one word per line, that gives the casing
! to be used for that word in Ada files. If the line starts with the
  character *, then the exception will be used for substrings that either
  start at the beginning of a word or after a _ character, and end either
! at the end of the word or at a _ character. Each line can be terminated by
  a comment."
    :type '(repeat (file))
    :group 'ada)
--- 211,220 ----
  when you call `ada-create-case-exception'.
  
  These files should contain one word per line, that gives the casing
! to be used for that word in Ada files.  If the line starts with the
  character *, then the exception will be used for substrings that either
  start at the beginning of a word or after a _ character, and end either
! at the end of the word or at a _ character.  Each line can be terminated by
  a comment."
    :type '(repeat (file))
    :group 'ada)
***************
*** 271,285 ****
  
  (defcustom ada-indent-comment-as-code t
    "*Non-nil means indent comment lines as code.
! nil means do not auto-indent comments."
    :type 'boolean :group 'ada)
  
  (defcustom ada-indent-handle-comment-special nil
!   "*Non-nil if comment lines should be handled specially inside
! parenthesis.
  By default, if the line that contains the open parenthesis has some
  text following it, then the following lines will be indented in the
! same column as this text. This will not be true if the first line is
  a comment and `ada-indent-handle-comment-special' is t.
  
  type A is
--- 270,283 ----
  
  (defcustom ada-indent-comment-as-code t
    "*Non-nil means indent comment lines as code.
! A nil value means do not auto-indent comments."
    :type 'boolean :group 'ada)
  
  (defcustom ada-indent-handle-comment-special nil
!   "*Non-nil if comment lines should be handled specially inside parenthesis.
  By default, if the line that contains the open parenthesis has some
  text following it, then the following lines will be indented in the
! same column as this text.  This will not be true if the first line is
  a comment and `ada-indent-handle-comment-special' is t.
  
  type A is
***************
*** 311,318 ****
  
  (defcustom ada-indent-renames ada-broken-indent
    "*Indentation for renames relative to the matching function statement.
! If ada-indent-return is null or negative, the indentation is done relative to
! the open parenthesis (if there is no parenthesis, ada-broken-indent is used).
  
  An example is:
     function A (B : Integer)
--- 309,316 ----
  
  (defcustom ada-indent-renames ada-broken-indent
    "*Indentation for renames relative to the matching function statement.
! If `ada-indent-return' is null or negative, the indentation is done relative 
to
! the open parenthesis (if there is no parenthesis, `ada-broken-indent' is 
used).
  
  An example is:
     function A (B : Integer)
***************
*** 322,329 ****
  
  (defcustom ada-indent-return 0
    "*Indentation for 'return' relative to the matching 'function' statement.
! If ada-indent-return is null or negative, the indentation is done relative to
! the open parenthesis (if there is no parenthesis, ada-broken-indent is used).
  
  An example is:
     function A (B : Integer)
--- 320,327 ----
  
  (defcustom ada-indent-return 0
    "*Indentation for 'return' relative to the matching 'function' statement.
! If `ada-indent-return' is null or negative, the indentation is done relative 
to
! the open parenthesis (if there is no parenthesis, `ada-broken-indent' is 
used).
  
  An example is:
     function A (B : Integer)
***************
*** 342,348 ****
  
  (defcustom ada-fill-comment-postfix " --"
    "*Text inserted at the end of each line when filling a comment paragraph.
! with `ada-fill-comment-paragraph-postfix'."
    :type 'string :group 'ada)
  
  (defcustom ada-label-indent -4
--- 340,346 ----
  
  (defcustom ada-fill-comment-postfix " --"
    "*Text inserted at the end of each line when filling a comment paragraph.
! Used by `ada-fill-comment-paragraph-postfix'."
    :type 'string :group 'ada)
  
  (defcustom ada-label-indent -4
***************
*** 377,383 ****
          '("/usr/adainclude" "/usr/local/adainclude"
            "/opt/gnu/adainclude"))
    "*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'."
    :type '(repeat (choice :tag "Directory"
--- 375,381 ----
          '("/usr/adainclude" "/usr/local/adainclude"
            "/opt/gnu/adainclude"))
    "*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'."
    :type '(repeat (choice :tag "Directory"
***************
*** 389,395 ****
    "Internal version of `ada-search-directories'.
  Its value is the concatenation of the search path as read in the project file
  and the standard runtime location, and the value of the user-defined
! ada-search-directories.")
  
  (defcustom ada-stmt-end-indent 0
    "*Number of columns to indent the end of a statement on a separate line.
--- 387,393 ----
    "Internal version of `ada-search-directories'.
  Its value is the concatenation of the search path as read in the project file
  and the standard runtime location, and the value of the user-defined
! `ada-search-directories'.")
  
  (defcustom ada-stmt-end-indent 0
    "*Number of columns to indent the end of a statement on a separate line.
***************
*** 402,408 ****
  (defcustom ada-tab-policy 'indent-auto
    "*Control the behavior of the TAB key.
  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."
    :type '(choice (const indent-auto)
--- 400,406 ----
  (defcustom ada-tab-policy 'indent-auto
    "*Control the behavior of the TAB key.
  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."
    :type '(choice (const indent-auto)
***************
*** 438,444 ****
    "*Name of the compiler to use.
  This will determine what features are made available through the ada-mode.
  The possible choices are :
! `gnat': Use Ada Core Technologies' Gnat compiler. Add some cross-referencing
      features
  `generic': Use a generic compiler"
    :type '(choice (const gnat)
--- 436,442 ----
    "*Name of the compiler to use.
  This will determine what features are made available through the ada-mode.
  The possible choices are :
! `gnat': Use Ada Core Technologies' Gnat compiler.  Add some cross-referencing
      features
  `generic': Use a generic compiler"
    :type '(choice (const gnat)
***************
*** 494,507 ****
  (defvar ada-case-exception-substring '()
    "Alist of substrings (entities) that have special casing.
  The substrings are detected for word constituant when the word
! is not itself in ada-case-exception, and only for substrings that
  either are at the beginning or end of the word, or start after '_'.")
  
  (defvar ada-lfd-binding nil
    "Variable to save key binding of LFD when casing is activated.")
  
  (defvar ada-other-file-alist nil
!   "Variable used by find-file to find the name of the other package.
  See `ff-other-file-alist'.")
  
  (defvar ada-align-list
--- 492,505 ----
  (defvar ada-case-exception-substring '()
    "Alist of substrings (entities) that have special casing.
  The substrings are detected for word constituant when the word
! is not itself in `ada-case-exception', and only for substrings that
  either are at the beginning or end of the word, or start after '_'.")
  
  (defvar ada-lfd-binding nil
    "Variable to save key binding of LFD when casing is activated.")
  
  (defvar ada-other-file-alist nil
!   "Variable used by `find-file' to find the name of the other package.
  See `ff-other-file-alist'.")
  
  (defvar ada-align-list
***************
*** 552,558 ****
     "type\\|"
     "when"
     "\\)\\>\\)")
!   "see the variable `align-region-separate' for more information.")
  
  ;;; ---- Below are the regexp used in this package for parsing
  
--- 550,556 ----
     "type\\|"
     "when"
     "\\)\\>\\)")
!   "See the variable `align-region-separate' for more information.")
  
  ;;; ---- Below are the regexp used in this package for parsing
  
***************
*** 631,637 ****
               '("end" "loop" "select" "begin" "case" "do"
                 "if" "task" "package" "record" "protected") t)
              "\\>"))
!   "Regexp used in ada-goto-matching-start.")
  
  (defvar ada-matching-decl-start-re
    (eval-when-compile
--- 629,635 ----
               '("end" "loop" "select" "begin" "case" "do"
                 "if" "task" "package" "record" "protected") t)
              "\\>"))
!   "Regexp used in `ada-goto-matching-start'.")
  
  (defvar ada-matching-decl-start-re
    (eval-when-compile
***************
*** 639,645 ****
              (regexp-opt
               '("is" "separate" "end" "declare" "if" "new" "begin" "generic" 
"when") t)
              "\\>"))
!   "Regexp used in ada-goto-matching-decl-start.")
  
  (defvar ada-loop-start-re
    "\\<\\(for\\|while\\|loop\\)\\>"
--- 637,643 ----
              (regexp-opt
               '("is" "separate" "end" "declare" "if" "new" "begin" "generic" 
"when") t)
              "\\>"))
!   "Regexp used in `ada-goto-matching-decl-start'.")
  
  (defvar ada-loop-start-re
    "\\<\\(for\\|while\\|loop\\)\\>"
***************
*** 662,668 ****
    "Position of point just before displaying the menu.
  This is a list (point buffer).
  Since `ada-popup-menu' moves the point where the user clicked, the region
! is modified. Therefore no command from the menu knows what the user selected
  before displaying the contextual menu.
  To get the original region, restore the point to this position before
  calling `region-end' and `region-beginning'.
--- 660,666 ----
    "Position of point just before displaying the menu.
  This is a list (point buffer).
  Since `ada-popup-menu' moves the point where the user clicked, the region
! is modified.  Therefore no command from the menu knows what the user selected
  before displaying the contextual menu.
  To get the original region, restore the point to this position before
  calling `region-end' and `region-beginning'.
***************
*** 717,723 ****
       "^[ \t]*protected[ \t]+\\(type[ \t]+\\)?\\(\\(body[ 
\t]+\\)?\\(\\sw\\|_\\)+\\)" 2)
     '("*Packages*" "^[ \t]*package[ \t]+\\(\\(body[ 
\t]+\\)?\\(\\sw\\|[_.]\\)+\\)" 1))
    "Imenu generic expression for Ada mode.
! See `imenu-generic-expression'. This variable will create several submenus for
  each type of entity that can be found in an Ada file.")
  
  
--- 715,721 ----
       "^[ \t]*protected[ \t]+\\(type[ \t]+\\)?\\(\\(body[ 
\t]+\\)?\\(\\sw\\|_\\)+\\)" 2)
     '("*Packages*" "^[ \t]*package[ \t]+\\(\\(body[ 
\t]+\\)?\\(\\sw\\|[_.]\\)+\\)" 1))
    "Imenu generic expression for Ada mode.
! See `imenu-generic-expression'.  This variable will create several submenus 
for
  each type of entity that can be found in an Ada file.")
  
  
***************
*** 733,741 ****
    )
  
  (defun ada-compile-goto-error (pos)
!   "Replaces `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:
    foo.adb:61:11:  [...] in call to size declared at foo.ads:11
  both file locations can be clicked on and jumped to."
--- 731,739 ----
    )
  
  (defun ada-compile-goto-error (pos)
!   "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:
    foo.adb:61:11:  [...] in call to size declared at foo.ads:11
  both file locations can be clicked on and jumped to."
***************
*** 953,972 ****
  ;;------------------------------------------------------------------
  
  (defsubst ada-in-comment-p (&optional parse-result)
!   "Returns t if inside a comment."
    (nth 4 (or parse-result
               (parse-partial-sexp
                (line-beginning-position) (point)))))
  
  (defsubst ada-in-string-p (&optional parse-result)
!   "Returns t if point is inside a string.
! If parse-result is non-nil, use is instead of calling parse-partial-sexp."
    (nth 3 (or parse-result
               (parse-partial-sexp
                (line-beginning-position) (point)))))
  
  (defsubst ada-in-string-or-comment-p (&optional parse-result)
!   "Returns t if inside a comment or string."
    (setq parse-result (or parse-result
                           (parse-partial-sexp
                            (line-beginning-position) (point))))
--- 951,970 ----
  ;;------------------------------------------------------------------
  
  (defsubst ada-in-comment-p (&optional parse-result)
!   "Return t if inside a comment."
    (nth 4 (or parse-result
               (parse-partial-sexp
                (line-beginning-position) (point)))))
  
  (defsubst ada-in-string-p (&optional parse-result)
!   "Return t if point is inside a string.
! If parse-result is non-nil, use is instead of calling `parse-partial-sexp'."
    (nth 3 (or parse-result
               (parse-partial-sexp
                (line-beginning-position) (point)))))
  
  (defsubst ada-in-string-or-comment-p (&optional parse-result)
!   "Return t if inside a comment or string."
    (setq parse-result (or parse-result
                           (parse-partial-sexp
                            (line-beginning-position) (point))))
***************
*** 994,1001 ****
    "Pops up a contextual menu, depending on where the user clicked.
  POSITION is the location the mouse was clicked on.
  Sets `ada-contextual-menu-last-point' to the current position before
! displaying the menu. When a function from the menu is called, the point is
! where the mouse button was clicked."
    (interactive "e")
  
    ;;  declare this as a local variable, so that the function called
--- 992,999 ----
    "Pops up a contextual menu, depending on where the user clicked.
  POSITION is the location the mouse was clicked on.
  Sets `ada-contextual-menu-last-point' to the current position before
! displaying the menu.  When a function from the menu is called, the
! point is where the mouse button was clicked."
    (interactive "e")
  
    ;;  declare this as a local variable, so that the function called
***************
*** 1035,1042 ****
    "Define SPEC and BODY as being valid extensions for Ada files.
  Going from body to spec with `ff-find-other-file' used these
  extensions.
! SPEC and BODY are two regular expressions that must match against the file
! name"
    (let* ((reg (concat (regexp-quote body) "$"))
           (tmp (assoc reg ada-other-file-alist)))
      (if tmp
--- 1033,1040 ----
    "Define SPEC and BODY as being valid extensions for Ada files.
  Going from body to spec with `ff-find-other-file' used these
  extensions.
! SPEC and BODY are two regular expressions that must match against
! the file name."
    (let* ((reg (concat (regexp-quote body) "$"))
           (tmp (assoc reg ada-other-file-alist)))
      (if tmp
***************
*** 1099,1105 ****
   Continue comment on next line                        
'\\[indent-new-comment-line]'
  
  If you use imenu.el:
!  Display index-menu of functions & procedures         '\\[imenu]'
  
  If you use find-file.el:
   Switch to other file (Body <-> Spec)                 '\\[ff-find-other-file]'
--- 1097,1103 ----
   Continue comment on next line                        
'\\[indent-new-comment-line]'
  
  If you use imenu.el:
!  Display index-menu of functions and procedures       '\\[imenu]'
  
  If you use find-file.el:
   Switch to other file (Body <-> Spec)                 '\\[ff-find-other-file]'
***************
*** 1408,1414 ****
  
  ;;  transient-mark-mode and mark-active are not defined in XEmacs
  (defun ada-region-selected ()
!   "t if a region has been selected by the user and is still active."
    (or (and (featurep 'xemacs) (funcall (symbol-function 'region-active-p)))
        (and (not (featurep 'xemacs))
           (symbol-value 'transient-mark-mode)
--- 1406,1412 ----
  
  ;;  transient-mark-mode and mark-active are not defined in XEmacs
  (defun ada-region-selected ()
!   "Return t if a region has been selected by the user and is still active."
    (or (and (featurep 'xemacs) (funcall (symbol-function 'region-active-p)))
        (and (not (featurep 'xemacs))
           (symbol-value 'transient-mark-mode)
***************
*** 1447,1453 ****
    )
  
  (defun ada-create-case-exception (&optional word)
!   "Defines WORD as an exception for the casing system.
  If WORD is not given, then the current word in the buffer is used instead.
  The new words is added to the first file in `ada-case-exception-file'.
  The standard casing rules will no longer apply to this word."
--- 1445,1451 ----
    )
  
  (defun ada-create-case-exception (&optional word)
!   "Define WORD as an exception for the casing system.
  If WORD is not given, then the current word in the buffer is used instead.
  The new words is added to the first file in `ada-case-exception-file'.
  The standard casing rules will no longer apply to this word."
***************
*** 1487,1496 ****
      ))
  
  (defun ada-create-case-exception-substring (&optional word)
!   "Defines the substring WORD as an exception for the casing system.
  If WORD is not given, then the current word in the buffer is used instead,
  or the selected region if any is active.
! The new words is added to the first file in `ada-case-exception-file'.
  When auto-casing a word, this substring will be special-cased, unless the
  word itself has a special casing."
    (interactive)
--- 1485,1494 ----
      ))
  
  (defun ada-create-case-exception-substring (&optional word)
!   "Define the substring WORD as an exception for the casing system.
  If WORD is not given, then the current word in the buffer is used instead,
  or the selected region if any is active.
! The new word is added to the first file in `ada-case-exception-file'.
  When auto-casing a word, this substring will be special-cased, unless the
  word itself has a special casing."
    (interactive)
***************
*** 1642,1648 ****
          (ada-adjust-case-substring))))))
  
  (defun ada-after-keyword-p ()
!   "Returns t if cursor is after a keyword that is not an attribute."
    (save-excursion
      (forward-word -1)
      (and (not (and (char-before)
--- 1640,1646 ----
          (ada-adjust-case-substring))))))
  
  (defun ada-after-keyword-p ()
!   "Return t if cursor is after a keyword that is not an attribute."
    (save-excursion
      (forward-word -1)
      (and (not (and (char-before)
***************
*** 1651,1657 ****
           (looking-at (concat ada-keywords "[^_]")))))
  
  (defun ada-adjust-case (&optional force-identifier)
!   "Adjust the case of the word before the just typed character.
  If FORCE-IDENTIFIER is non-nil then also adjust keyword as identifier."
    (if (not (bobp))
        (progn
--- 1649,1655 ----
           (looking-at (concat ada-keywords "[^_]")))))
  
  (defun ada-adjust-case (&optional force-identifier)
!   "Adjust the case of the word before the character just typed.
  If FORCE-IDENTIFIER is non-nil then also adjust keyword as identifier."
    (if (not (bobp))
        (progn
***************
*** 1682,1688 ****
  
  (defun ada-adjust-case-interactive (arg)
    "Adjust the case of the previous word, and process the character just typed.
! ARG is the prefix the user entered with \C-u."
    (interactive "P")
  
    (if ada-auto-case
--- 1680,1686 ----
  
  (defun ada-adjust-case-interactive (arg)
    "Adjust the case of the previous word, and process the character just typed.
! ARG is the prefix the user entered with \\[universal-argument]."
    (interactive "P")
  
    (if ada-auto-case
***************
*** 1729,1735 ****
      ))
  
  (defun ada-activate-keys-for-case ()
!   "Modifies the key bindings for all the keys that should readjust the 
casing."
    (interactive)
    ;; Save original key-bindings to allow swapping ret/lfd
    ;; when casing is activated.
--- 1727,1733 ----
      ))
  
  (defun ada-activate-keys-for-case ()
!   "Modify the key bindings for all the keys that should readjust the casing."
    (interactive)
    ;; Save original key-bindings to allow swapping ret/lfd
    ;; when casing is activated.
***************
*** 1763,1769 ****
          (delete-char 1)))))
  
  (defun ada-no-auto-case (&optional arg)
!   "Does nothing.
  This function can be used for the auto-casing variables in the 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
--- 1761,1767 ----
          (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
  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
***************
*** 1782,1789 ****
      (modify-syntax-entry ?_ "w")))
  
  (defun ada-adjust-case-region (from to)
!   "Adjusts the case of all words in the region between FROM and TO.
! Attention: This function might take very long for big regions !"
    (interactive "*r")
    (let ((begin nil)
          (end nil)
--- 1780,1787 ----
      (modify-syntax-entry ?_ "w")))
  
  (defun ada-adjust-case-region (from to)
!   "Adjust the case of all words in the region between FROM and TO.
! Attention: This function might take very long for big regions!"
    (interactive "*r")
    (let ((begin nil)
          (end nil)
***************
*** 1829,1835 ****
  
  (defun ada-adjust-case-buffer ()
    "Adjusts the case of all words in the whole buffer.
! ATTENTION: This function might take very long for big buffers !"
    (interactive "*")
    (ada-adjust-case-region (point-min) (point-max)))
  
--- 1827,1833 ----
  
  (defun ada-adjust-case-buffer ()
    "Adjusts the case of all words in the whole buffer.
! ATTENTION: This function might take very long for big buffers!"
    (interactive "*")
    (ada-adjust-case-region (point-min) (point-max)))
  
***************
*** 1851,1857 ****
  ;;--------------------------------------------------------------
  
  (defun ada-format-paramlist ()
!   "Reformats the parameter list point is in."
    (interactive)
    (let ((begin nil)
          (end nil)
--- 1849,1855 ----
  ;;--------------------------------------------------------------
  
  (defun ada-format-paramlist ()
!   "Reformat the parameter list point is in."
    (interactive)
    (let ((begin nil)
          (end nil)
***************
*** 1864,1870 ****
  
            ;; check if really inside parameter list
            (or (ada-in-paramlist-p)
!               (error "not in parameter list"))
  
            ;; find start of current parameter-list
            (ada-search-ignore-string-comment
--- 1862,1868 ----
  
            ;; check if really inside parameter list
            (or (ada-in-paramlist-p)
!               (error "Not in parameter list"))
  
            ;; find start of current parameter-list
            (ada-search-ignore-string-comment
***************
*** 1899,1905 ****
  
  (defun ada-scan-paramlist (begin end)
    "Scan the parameter list found in between BEGIN and END.
! Returns the equivalent internal parameter list."
    (let ((paramlist (list))
          (param (list))
          (notend t)
--- 1897,1903 ----
  
  (defun ada-scan-paramlist (begin end)
    "Scan the parameter list found in between BEGIN and END.
! Return the equivalent internal parameter list."
    (let ((paramlist (list))
          (param (list))
          (notend t)
***************
*** 1996,2002 ****
      (reverse paramlist)))
  
  (defun ada-insert-paramlist (paramlist)
!   "Inserts a formatted PARAMLIST in the buffer."
    (let ((i (length paramlist))
          (parlen 0)
          (typlen 0)
--- 1994,2000 ----
      (reverse paramlist)))
  
  (defun ada-insert-paramlist (paramlist)
!   "Insert a formatted PARAMLIST in the buffer."
    (let ((i (length paramlist))
          (parlen 0)
          (typlen 0)
***************
*** 2163,2169 ****
      (message "indenting ... done")))
  
  (defun ada-indent-newline-indent ()
!   "Indents the current line, inserts a newline and then indents the new line."
    (interactive "*")
    (ada-indent-current)
    (newline)
--- 2161,2167 ----
      (message "indenting ... done")))
  
  (defun ada-indent-newline-indent ()
!   "Indent the current line, insert a newline and then indent the new line."
    (interactive "*")
    (ada-indent-current)
    (newline)
***************
*** 2172,2185 ****
  (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."
    (interactive "*")
    (if ada-indent-after-return (ada-indent-current))
    (newline)
    (ada-indent-current))
  
  (defun ada-justified-indent-current ()
!   "Indent the current line and explains how the calculation was done."
    (interactive)
  
    (let ((cur-indent (ada-indent-current)))
--- 2170,2183 ----
  (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."
    (interactive "*")
    (if ada-indent-after-return (ada-indent-current))
    (newline)
    (ada-indent-current))
  
  (defun ada-justified-indent-current ()
!   "Indent the current line and explain how the calculation was done."
    (interactive)
  
    (let ((cur-indent (ada-indent-current)))
***************
*** 2223,2235 ****
    (kill-emacs 0))
  
  (defsubst ada-goto-previous-word ()
!   "Moves point to the beginning of the previous word of Ada code.
! Returns the new position of point or nil if not found."
    (ada-goto-next-word t))
  
  (defun ada-indent-current ()
    "Indent current line as Ada code.
! Returns the calculation that was done, including the reference point and the
  offset."
    (interactive)
    (let ((previous-syntax-table (syntax-table))
--- 2221,2233 ----
    (kill-emacs 0))
  
  (defsubst ada-goto-previous-word ()
!   "Move point to the beginning of the previous word of Ada code.
! Return the new position of point or nil if not found."
    (ada-goto-next-word t))
  
  (defun ada-indent-current ()
    "Indent current line as Ada code.
! Return the calculation that was done, including the reference point and the
  offset."
    (interactive)
    (let ((previous-syntax-table (syntax-table))
***************
*** 2804,2810 ****
      ))
  
  (defun ada-get-indent-open-paren ()
!   "Calculates the indentation when point is behind an unclosed parenthesis."
    (list (ada-in-open-paren-p) 0))
  
  (defun ada-get-indent-nochange ()
--- 2802,2808 ----
      ))
  
  (defun ada-get-indent-open-paren ()
!   "Calculate the indentation when point is behind an unclosed parenthesis."
    (list (ada-in-open-paren-p) 0))
  
  (defun ada-get-indent-nochange ()
***************
*** 2815,2821 ****
      (list (point) 0)))
  
  (defun ada-get-indent-paramlist ()
!   "Calculates the indentation when point is inside a parameter list."
    (save-excursion
      (ada-search-ignore-string-comment "[^ \t\n]" t nil t)
      (cond
--- 2813,2819 ----
      (list (point) 0)))
  
  (defun ada-get-indent-paramlist ()
!   "Calculate the indentation when point is inside a parameter list."
    (save-excursion
      (ada-search-ignore-string-comment "[^ \t\n]" t nil t)
      (cond
***************
*** 2843,2849 ****
        (list (point) 0)))))
  
  (defun ada-get-indent-end (orgpoint)
!   "Calculates the indentation when point is just before an end_statement.
  ORGPOINT is the limit position used in the calculation."
    (let ((defun-name nil)
          (indent nil))
--- 2841,2847 ----
        (list (point) 0)))))
  
  (defun ada-get-indent-end (orgpoint)
!   "Calculate the indentation when point is just before an end statement.
  ORGPOINT is the limit position used in the calculation."
    (let ((defun-name nil)
          (indent nil))
***************
*** 2909,2915 ****
              'ada-broken-indent))))
  
  (defun ada-get-indent-case (orgpoint)
!   "Calculates the indentation when point is just before a case statement.
  ORGPOINT is the limit position used in the calculation."
    (let ((match-cons nil)
          (opos (point)))
--- 2907,2913 ----
              'ada-broken-indent))))
  
  (defun ada-get-indent-case (orgpoint)
!   "Calculate the indentation when point is just before a case statement.
  ORGPOINT is the limit position used in the calculation."
    (let ((match-cons nil)
          (opos (point)))
***************
*** 2927,2933 ****
        (save-excursion
          (goto-char (car match-cons))
          (unless (ada-search-ignore-string-comment "when" t opos)
!           (error "missing 'when' between 'case' and '=>'"))
          (list (save-excursion (back-to-indentation) (point)) 'ada-indent)))
       ;;
       ;; case..is..when
--- 2925,2931 ----
        (save-excursion
          (goto-char (car match-cons))
          (unless (ada-search-ignore-string-comment "when" t opos)
!           (error "Missing 'when' between 'case' and '=>'"))
          (list (save-excursion (back-to-indentation) (point)) 'ada-indent)))
       ;;
       ;; case..is..when
***************
*** 2952,2958 ****
              'ada-broken-indent)))))
  
  (defun ada-get-indent-when (orgpoint)
!   "Calculates the indentation when point is just before a when statement.
  ORGPOINT is the limit position used in the calculation."
    (let ((cur-indent (save-excursion (back-to-indentation) (point))))
      (if (ada-search-ignore-string-comment "[ \t\n]*=>" nil orgpoint)
--- 2950,2956 ----
              'ada-broken-indent)))))
  
  (defun ada-get-indent-when (orgpoint)
!   "Calculate the indentation when point is just before a when statement.
  ORGPOINT is the limit position used in the calculation."
    (let ((cur-indent (save-excursion (back-to-indentation) (point))))
      (if (ada-search-ignore-string-comment "[ \t\n]*=>" nil orgpoint)
***************
*** 2960,2966 ****
        (list cur-indent 'ada-broken-indent))))
  
  (defun ada-get-indent-if (orgpoint)
!   "Calculates the indentation when point is just before an if statement.
  ORGPOINT is the limit position used in the calculation."
    (let ((cur-indent (save-excursion (back-to-indentation) (point)))
          (match-cons nil))
--- 2958,2964 ----
        (list cur-indent 'ada-broken-indent))))
  
  (defun ada-get-indent-if (orgpoint)
!   "Calculate the indentation when point is just before an if statement.
  ORGPOINT is the limit position used in the calculation."
    (let ((cur-indent (save-excursion (back-to-indentation) (point)))
          (match-cons nil))
***************
*** 2990,2996 ****
        (list cur-indent 'ada-broken-indent))))
  
  (defun ada-get-indent-block-start (orgpoint)
!   "Calculates the indentation when point is at the start of a block.
  ORGPOINT is the limit position used in the calculation."
    (let ((pos nil))
      (cond
--- 2988,2994 ----
        (list cur-indent 'ada-broken-indent))))
  
  (defun ada-get-indent-block-start (orgpoint)
!   "Calculate the indentation when point is at the start of a block.
  ORGPOINT is the limit position used in the calculation."
    (let ((pos nil))
      (cond
***************
*** 3023,3029 ****
        (list (save-excursion (back-to-indentation) (point)) 'ada-indent)))))
  
  (defun ada-get-indent-subprog (orgpoint)
!   "Calculates the indentation when point is just before a subprogram.
  ORGPOINT is the limit position used in the calculation."
    (let ((match-cons nil)
          (cur-indent (save-excursion (back-to-indentation) (point)))
--- 3021,3027 ----
        (list (save-excursion (back-to-indentation) (point)) 'ada-indent)))))
  
  (defun ada-get-indent-subprog (orgpoint)
!   "Calculate the indentation when point is just before a subprogram.
  ORGPOINT is the limit position used in the calculation."
    (let ((match-cons nil)
          (cur-indent (save-excursion (back-to-indentation) (point)))
***************
*** 3092,3098 ****
        (list cur-indent 'ada-broken-indent)))))
  
  (defun ada-get-indent-noindent (orgpoint)
!   "Calculates the indentation when point is just before a 'noindent stmt'.
  ORGPOINT is the limit position used in the calculation."
    (let ((label 0))
      (save-excursion
--- 3090,3096 ----
        (list cur-indent 'ada-broken-indent)))))
  
  (defun ada-get-indent-noindent (orgpoint)
!   "Calculate the indentation when point is just before a 'noindent stmt'.
  ORGPOINT is the limit position used in the calculation."
    (let ((label 0))
      (save-excursion
***************
*** 3146,3152 ****
                  'ada-broken-indent)))))))
  
  (defun ada-get-indent-label (orgpoint)
!   "Calculates the indentation when before a label or variable declaration.
  ORGPOINT is the limit position used in the calculation."
    (let ((match-cons nil)
          (cur-indent (save-excursion (back-to-indentation) (point))))
--- 3144,3150 ----
                  'ada-broken-indent)))))))
  
  (defun ada-get-indent-label (orgpoint)
!   "Calculate the indentation when before a label or variable declaration.
  ORGPOINT is the limit position used in the calculation."
    (let ((match-cons nil)
          (cur-indent (save-excursion (back-to-indentation) (point))))
***************
*** 3178,3184 ****
        (list cur-indent '(- ada-label-indent))))))
  
  (defun ada-get-indent-loop (orgpoint)
!   "Calculates the indentation when just before a loop or a for ... use.
  ORGPOINT is the limit position used in the calculation."
    (let ((match-cons nil)
          (pos (point))
--- 3176,3182 ----
        (list cur-indent '(- ada-label-indent))))))
  
  (defun ada-get-indent-loop (orgpoint)
!   "Calculate the indentation when just before a loop or a for ... use.
  ORGPOINT is the limit position used in the calculation."
    (let ((match-cons nil)
          (pos (point))
***************
*** 3290,3296 ****
                'ada-broken-indent))))))
  
  (defun ada-get-indent-type (orgpoint)
!   "Calculates the indentation when before a type statement.
  ORGPOINT is the limit position used in the calculation."
    (let ((match-dat nil))
      (cond
--- 3288,3294 ----
                'ada-broken-indent))))))
  
  (defun ada-get-indent-type (orgpoint)
!   "Calculate the indentation when before a type statement.
  ORGPOINT is the limit position used in the calculation."
    (let ((match-dat nil))
      (cond
***************
*** 3345,3352 ****
  ;; -----------------------------------------------------------
  
  (defun ada-goto-stmt-start ()
!   "Moves point to the beginning of the statement that point is in or after.
! Returns the new position of point.
  As a special case, if we are looking at a closing parenthesis, skip to the
  open parenthesis."
    (let ((match-dat nil)
--- 3343,3350 ----
  ;; -----------------------------------------------------------
  
  (defun ada-goto-stmt-start ()
!   "Move point to the beginning of the statement that point is in or after.
! Return the new position of point.
  As a special case, if we are looking at a closing parenthesis, skip to the
  open parenthesis."
    (let ((match-dat nil)
***************
*** 3391,3399 ****
  
  
  (defun ada-search-prev-end-stmt ()
!   "Moves point to previous end-statement.
! Returns a cons cell whose car is the beginning and whose cdr the end of the
! match."
    (let ((match-dat nil)
          (found nil))
  
--- 3389,3397 ----
  
  
  (defun ada-search-prev-end-stmt ()
!   "Move point to previous end statement.
! Return a cons cell whose car is the beginning and whose cdr
! is the end of the match."
    (let ((match-dat nil)
          (found nil))
  
***************
*** 3442,3448 ****
  
  
  (defun ada-goto-next-non-ws (&optional limit)
!   "Skips white spaces, newlines and comments to next non-ws character.
  Stop the search at LIMIT.
  Do not call this function from within a string."
    (unless limit
--- 3440,3446 ----
  
  
  (defun ada-goto-next-non-ws (&optional limit)
!   "Skip white spaces, newlines and comments to next non-ws character.
  Stop the search at LIMIT.
  Do not call this function from within a string."
    (unless limit
***************
*** 3460,3467 ****
  
  
  (defun ada-goto-stmt-end (&optional limit)
!   "Moves point to the end of the statement that point is in or before.
! Returns the new position of point or nil if not found.
  Stop the search at LIMIT."
    (if (ada-search-ignore-string-comment ada-end-stmt-re nil limit)
        (point)
--- 3458,3465 ----
  
  
  (defun ada-goto-stmt-end (&optional limit)
!   "Move point to the end of the statement that point is in or before.
! Return the new position of point or nil if not found.
  Stop the search at LIMIT."
    (if (ada-search-ignore-string-comment ada-end-stmt-re nil limit)
        (point)
***************
*** 3469,3477 ****
  
  
  (defun ada-goto-next-word (&optional backward)
!   "Moves point to the beginning of the next word of Ada code.
  If BACKWARD is non-nil, jump to the beginning of the previous word.
! Returns the new position of point or nil if not found."
    (let ((match-cons nil)
          (orgpoint (point))
          (old-syntax (char-to-string (char-syntax ?_))))
--- 3467,3475 ----
  
  
  (defun ada-goto-next-word (&optional backward)
!   "Move point to the beginning of the next word of Ada code.
  If BACKWARD is non-nil, jump to the beginning of the previous word.
! Return the new position of point or nil if not found."
    (let ((match-cons nil)
          (orgpoint (point))
          (old-syntax (char-to-string (char-syntax ?_))))
***************
*** 3499,3514 ****
  
  
  (defun ada-check-matching-start (keyword)
!   "Signals an error if matching block start is not KEYWORD.
  Moves point to the matching block start."
    (ada-goto-matching-start 0)
    (unless (looking-at (concat "\\<" keyword "\\>"))
!     (error "matching start is not '%s'" keyword)))
  
  
  (defun ada-check-defun-name (defun-name)
!   "Checks if the name of the matching defun really is DEFUN-NAME.
! Assumes point to be already positioned by 'ada-goto-matching-start'.
  Moves point to the beginning of the declaration."
  
    ;; named block without a `declare'
--- 3497,3512 ----
  
  
  (defun ada-check-matching-start (keyword)
!   "Signal an error if matching block start is not KEYWORD.
  Moves point to the matching block start."
    (ada-goto-matching-start 0)
    (unless (looking-at (concat "\\<" keyword "\\>"))
!     (error "Matching start is not '%s'" keyword)))
  
  
  (defun ada-check-defun-name (defun-name)
!   "Check if the name of the matching defun really is DEFUN-NAME.
! Assumes point to be already positioned by `ada-goto-matching-start'.
  Moves point to the beginning of the declaration."
  
    ;; named block without a `declare'
***************
*** 3547,3558 ****
        ;; should be looking-at the correct name
        ;;
        (unless (looking-at (concat "\\<" defun-name "\\>"))
!         (error "matching defun has different name: %s"
                 (buffer-substring (point)
                                   (progn (forward-sexp 1) (point))))))))
  
  (defun ada-goto-matching-decl-start (&optional noerror recursive)
!   "Moves point to the matching declaration start of the current 'begin'.
  If NOERROR is non-nil, it only returns nil if no match was found."
    (let ((nest-count 1)
  
--- 3545,3556 ----
        ;; should be looking-at the correct name
        ;;
        (unless (looking-at (concat "\\<" defun-name "\\>"))
!         (error "Matching defun has different name: %s"
                 (buffer-substring (point)
                                   (progn (forward-sexp 1) (point))))))))
  
  (defun ada-goto-matching-decl-start (&optional noerror recursive)
!   "Move point to the matching declaration start of the current 'begin'.
  If NOERROR is non-nil, it only returns nil if no match was found."
    (let ((nest-count 1)
  
***************
*** 3709,3721 ****
             (looking-at "declare\\|generic")))
          t
        (if noerror nil
!         (error "no matching proc/func/task/declare/package/protected")))
      ))
  
  (defun ada-goto-matching-start (&optional nest-level noerror gotothen)
!   "Moves point to the beginning of a block-start.
! Which block depends on the value of NEST-LEVEL, which defaults to zero. If
! NOERROR is non-nil, it only returns nil if no matching start was found.
  If GOTOTHEN is non-nil, point moves to the 'then' following 'if'."
    (let ((nest-count (if nest-level nest-level 0))
          (found nil)
--- 3707,3719 ----
             (looking-at "declare\\|generic")))
          t
        (if noerror nil
!         (error "No matching proc/func/task/declare/package/protected")))
      ))
  
  (defun ada-goto-matching-start (&optional nest-level noerror gotothen)
!   "Move point to the beginning of a block-start.
! Which block depends on the value of NEST-LEVEL, which defaults to zero.
! If NOERROR is non-nil, it only returns nil if no matching start was found.
  If GOTOTHEN is non-nil, point moves to the 'then' following 'if'."
    (let ((nest-count (if nest-level nest-level 0))
          (found nil)
***************
*** 3852,3867 ****
              (unless (ada-search-ignore-string-comment
                       "accept" t nil nil
                       'word-search-backward)
!               (error "missing 'accept' in front of 'do'"))))
            (point))
  
        (if noerror
            nil
!         (error "no matching start"))))))
  
  
  (defun ada-goto-matching-end (&optional nest-level noerror)
!   "Moves point to the end of a block.
  Which block depends on the value of NEST-LEVEL, which defaults to zero.
  If NOERROR is non-nil, it only returns nil if found no matching start."
    (let ((nest-count (or nest-level 0))
--- 3850,3865 ----
              (unless (ada-search-ignore-string-comment
                       "accept" t nil nil
                       'word-search-backward)
!               (error "Missing 'accept' in front of 'do'"))))
            (point))
  
        (if noerror
            nil
!         (error "No matching start"))))))
  
  
  (defun ada-goto-matching-end (&optional nest-level noerror)
!   "Move point to the end of a block.
  Which block depends on the value of NEST-LEVEL, which defaults to zero.
  If NOERROR is non-nil, it only returns nil if found no matching start."
    (let ((nest-count (or nest-level 0))
***************
*** 3963,3982 ****
          t
        (if noerror
            nil
!         (error "no matching end")))
      ))
  
  
  (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.
  The search stops at pos LIMIT.
! Point is moved at the beginning of the search-re."
    (let (found
          begin
          end
--- 3961,3980 ----
          t
        (if noerror
            nil
!         (error "No matching end")))
      ))
  
  
  (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.
  The search stops at pos LIMIT.
! Point is moved at the beginning of the SEARCH-RE."
    (let (found
          begin
          end
***************
*** 4061,4067 ****
  ;; -------------------------------------------------------
  
  (defun ada-in-decl-p ()
!   "Returns t if point is inside a declarative part.
  Assumes point to be at the end of a statement."
    (or (ada-in-paramlist-p)
        (save-excursion
--- 4059,4065 ----
  ;; -------------------------------------------------------
  
  (defun ada-in-decl-p ()
!   "Return t if point is inside a declarative part.
  Assumes point to be at the end of a statement."
    (or (ada-in-paramlist-p)
        (save-excursion
***************
*** 4069,4075 ****
  
  
  (defun ada-looking-at-semi-or ()
!   "Returns t if looking-at an 'or' following a semicolon."
    (save-excursion
      (and (looking-at "\\<or\\>")
           (progn
--- 4067,4073 ----
  
  
  (defun ada-looking-at-semi-or ()
!   "Return t if looking at an 'or' following a semicolon."
    (save-excursion
      (and (looking-at "\\<or\\>")
           (progn
***************
*** 4079,4085 ****
  
  
  (defun ada-looking-at-semi-private ()
!   "Returns t if looking at the start of a private section in a package.
  Returns nil if the private is part of the package name, as in
  'private package A is...' (this can only happen at top level)."
    (save-excursion
--- 4077,4083 ----
  
  
  (defun ada-looking-at-semi-private ()
!   "Return t if looking at the start of a private section in a package.
  Returns nil if the private is part of the package name, as in
  'private package A is...' (this can only happen at top level)."
    (save-excursion
***************
*** 4101,4107 ****
  
  
  (defun ada-in-paramlist-p ()
!   "Returns t if point is inside a parameter-list."
    (save-excursion
      (and
       (ada-search-ignore-string-comment "(\\|)" t nil t)
--- 4099,4105 ----
  
  
  (defun ada-in-paramlist-p ()
!   "Return t if point is inside a parameter-list."
    (save-excursion
      (and
       (ada-search-ignore-string-comment "(\\|)" t nil t)
***************
*** 4151,4157 ****
    result))
  
  (defun ada-in-open-paren-p ()
!   "Returns the position of the first non-ws behind the last unclosed
  parenthesis, or nil."
    (save-excursion
      (let ((parse (parse-partial-sexp
--- 4149,4155 ----
    result))
  
  (defun ada-in-open-paren-p ()
!   "Return the position of the first non-ws behind the last unclosed
  parenthesis, or nil."
    (save-excursion
      (let ((parse (parse-partial-sexp
***************
*** 4186,4211 ****
  (defun ada-tab ()
    "Do indenting or tabbing according to `ada-tab-policy'.
  In Transient Mark mode, if the mark is active, operate on the contents
! of the region.  Otherwise, operates only on the current line."
    (interactive)
    (cond ((eq ada-tab-policy 'indent-rigidly) (ada-tab-hard))
          ((eq ada-tab-policy 'indent-auto)
         (if (ada-region-selected)
               (ada-indent-region (region-beginning) (region-end))
             (ada-indent-current)))
!         ((eq ada-tab-policy 'always-tab) (error "not implemented"))
          ))
  
  (defun ada-untab (arg)
    "Delete leading indenting according to `ada-tab-policy'."
    (interactive "P")
    (cond ((eq ada-tab-policy 'indent-rigidly) (ada-untab-hard))
!         ((eq ada-tab-policy 'indent-auto) (error "not implemented"))
!         ((eq ada-tab-policy 'always-tab) (error "not implemented"))
          ))
  
  (defun ada-indent-current-function ()
!   "Ada mode version of the indent-line-function."
    (interactive "*")
    (let ((starting-point (point-marker)))
      (beginning-of-line)
--- 4184,4209 ----
  (defun ada-tab ()
    "Do indenting or tabbing according to `ada-tab-policy'.
  In Transient Mark mode, if the mark is active, operate on the contents
! of the region.  Otherwise, operate only on the current line."
    (interactive)
    (cond ((eq ada-tab-policy 'indent-rigidly) (ada-tab-hard))
          ((eq ada-tab-policy 'indent-auto)
         (if (ada-region-selected)
               (ada-indent-region (region-beginning) (region-end))
             (ada-indent-current)))
!         ((eq ada-tab-policy 'always-tab) (error "Not implemented"))
          ))
  
  (defun ada-untab (arg)
    "Delete leading indenting according to `ada-tab-policy'."
    (interactive "P")
    (cond ((eq ada-tab-policy 'indent-rigidly) (ada-untab-hard))
!         ((eq ada-tab-policy 'indent-auto) (error "Not implemented"))
!         ((eq ada-tab-policy 'always-tab) (error "Not implemented"))
          ))
  
  (defun ada-indent-current-function ()
!   "Ada mode version of the `indent-line-function'."
    (interactive "*")
    (let ((starting-point (point-marker)))
      (beginning-of-line)
***************
*** 4225,4231 ****
        (forward-char ada-indent)))
  
  (defun ada-untab-hard ()
!   "indent current line to previous tab stop."
    (interactive)
    (let  ((bol (save-excursion (progn (beginning-of-line) (point))))
           (eol (save-excursion (progn (end-of-line) (point)))))
--- 4223,4229 ----
        (forward-char ada-indent)))
  
  (defun ada-untab-hard ()
!   "Indent current line to previous tab stop."
    (interactive)
    (let  ((bol (save-excursion (progn (beginning-of-line) (point))))
           (eol (save-excursion (progn (end-of-line) (point)))))
***************
*** 4327,4333 ****
  ;; -------------------------------------------------------------
  
  (defun ada-move-to-start ()
!   "Moves point to the matching start of the current Ada structure."
    (interactive)
    (let ((pos (point))
          (previous-syntax-table (syntax-table)))
--- 4325,4331 ----
  ;; -------------------------------------------------------------
  
  (defun ada-move-to-start ()
!   "Move point to the matching start of the current Ada structure."
    (interactive)
    (let ((pos (point))
          (previous-syntax-table (syntax-table)))
***************
*** 4348,4354 ****
                      (or (looking-at "[ \t]*\\<end\\>")
                          (backward-word 1))
                      (or (looking-at "[ \t]*\\<end\\>")
!                         (error "not on end ...;")))
                    (ada-goto-matching-start 1)
                    (setq pos (point))
  
--- 4346,4352 ----
                      (or (looking-at "[ \t]*\\<end\\>")
                          (backward-word 1))
                      (or (looking-at "[ \t]*\\<end\\>")
!                         (error "Not on end ...;")))
                    (ada-goto-matching-start 1)
                    (setq pos (point))
  
***************
*** 4369,4375 ****
        (set-syntax-table previous-syntax-table))))
  
  (defun ada-move-to-end ()
!   "Moves point to the matching end of the block around point.
  Moves to 'begin' if in a declarative part."
    (interactive)
    (let ((pos (point))
--- 4367,4373 ----
        (set-syntax-table previous-syntax-table))))
  
  (defun ada-move-to-end ()
!   "Move point to the matching end of the block around point.
  Moves to 'begin' if in a declarative part."
    (interactive)
    (let ((pos (point))
***************
*** 4447,4453 ****
        (set-syntax-table previous-syntax-table))))
  
  (defun ada-next-procedure ()
!   "Moves point to next procedure."
    (interactive)
    (end-of-line)
    (if (re-search-forward ada-procedure-start-regexp nil t)
--- 4445,4451 ----
        (set-syntax-table previous-syntax-table))))
  
  (defun ada-next-procedure ()
!   "Move point to next procedure."
    (interactive)
    (end-of-line)
    (if (re-search-forward ada-procedure-start-regexp nil t)
***************
*** 4455,4461 ****
      (error "No more functions/procedures/tasks")))
  
  (defun ada-previous-procedure ()
!   "Moves point to previous procedure."
    (interactive)
    (beginning-of-line)
    (if (re-search-backward ada-procedure-start-regexp nil t)
--- 4453,4459 ----
      (error "No more functions/procedures/tasks")))
  
  (defun ada-previous-procedure ()
!   "Move point to previous procedure."
    (interactive)
    (beginning-of-line)
    (if (re-search-backward ada-procedure-start-regexp nil t)
***************
*** 4463,4469 ****
      (error "No more functions/procedures/tasks")))
  
  (defun ada-next-package ()
!   "Moves point to next package."
    (interactive)
    (end-of-line)
    (if (re-search-forward ada-package-start-regexp nil t)
--- 4461,4467 ----
      (error "No more functions/procedures/tasks")))
  
  (defun ada-next-package ()
!   "Move point to next package."
    (interactive)
    (end-of-line)
    (if (re-search-forward ada-package-start-regexp nil t)
***************
*** 4471,4477 ****
      (error "No more packages")))
  
  (defun ada-previous-package ()
!   "Moves point to previous package."
    (interactive)
    (beginning-of-line)
    (if (re-search-backward ada-package-start-regexp nil t)
--- 4469,4475 ----
      (error "No more packages")))
  
  (defun ada-previous-package ()
!   "Move point to previous package."
    (interactive)
    (beginning-of-line)
    (if (re-search-backward ada-package-start-regexp nil t)
***************
*** 4591,4597 ****
  
  
  (defun ada-create-menu ()
!   "Create the ada menu as shown in the menu bar."
    (let ((m '("Ada"
             ("Help"
              ["Ada Mode"               (info "ada-mode") t]
--- 4589,4595 ----
  
  
  (defun ada-create-menu ()
!   "Create the Ada menu as shown in the menu bar."
    (let ((m '("Ada"
             ("Help"
              ["Ada Mode"               (info "ada-mode") t]
***************
*** 4788,4815 ****
      (ada-indent-region beg end)))
  
  (defun ada-fill-comment-paragraph-justify ()
!   "Fills current comment paragraph and justifies each line as well."
    (interactive)
    (ada-fill-comment-paragraph 'full))
  
  (defun ada-fill-comment-paragraph-postfix ()
!   "Fills current comment paragraph and justifies each line as well.
  Adds `ada-fill-comment-postfix' at the end of each line."
    (interactive)
    (ada-fill-comment-paragraph 'full t))
  
  (defun ada-fill-comment-paragraph (&optional justify postfix)
!   "Fills the current comment paragraph.
  If JUSTIFY is non-nil, each line is justified as well.
! If POSTFIX and JUSTIFY are  non-nil, `ada-fill-comment-postfix' is appended
! to each filled and justified line.
  The paragraph is indented on the first line."
    (interactive "P")
  
    ;; check if inside comment or just in front a comment
    (if (and (not (ada-in-comment-p))
             (not (looking-at "[ \t]*--")))
!       (error "not inside comment"))
  
    (let* (indent from to
           (opos (point-marker))
--- 4786,4813 ----
      (ada-indent-region beg end)))
  
  (defun ada-fill-comment-paragraph-justify ()
!   "Fill current comment paragraph and justify each line as well."
    (interactive)
    (ada-fill-comment-paragraph 'full))
  
  (defun ada-fill-comment-paragraph-postfix ()
!   "Fill current comment paragraph and justify each line as well.
  Adds `ada-fill-comment-postfix' at the end of each line."
    (interactive)
    (ada-fill-comment-paragraph 'full t))
  
  (defun ada-fill-comment-paragraph (&optional justify postfix)
!   "Fill the current comment paragraph.
  If JUSTIFY is non-nil, each line is justified as well.
! If POSTFIX and JUSTIFY are non-nil, `ada-fill-comment-postfix' is appended
! to each line filled and justified.
  The paragraph is indented on the first line."
    (interactive "P")
  
    ;; check if inside comment or just in front a comment
    (if (and (not (ada-in-comment-p))
             (not (looking-at "[ \t]*--")))
!       (error "Not inside comment"))
  
    (let* (indent from to
           (opos (point-marker))
***************
*** 4920,4927 ****
  
  (defun ada-other-file-name ()
    "Return the name of the other file.
! The name returned is the body if current-buffer is the spec, or the spec
! otherwise."
  
    (let ((is-spec nil)
        (is-body nil)
--- 4918,4925 ----
  
  (defun ada-other-file-name ()
    "Return the name of the other file.
! The name returned is the body if `current-buffer' is the spec,
! or the spec otherwise."
  
    (let ((is-spec nil)
        (is-body nil)
***************
*** 4990,5004 ****
  
  
  (defvar ada-last-which-function-line -1
!   "Last on which ada-which-function was called")
  (defvar ada-last-which-function-subprog 0
!   "Last subprogram name returned by ada-which-function")
  (make-variable-buffer-local 'ada-last-which-function-subprog)
  (make-variable-buffer-local 'ada-last-which-function-line)
  
  
  (defun ada-which-function ()
!   "Returns the name of the function whose body the point is in.
  This function works even in the case of nested subprograms, whereas the
  standard Emacs function `which-function' does not.
  Since the search can be long, the results are cached."
--- 4988,5002 ----
  
  
  (defvar ada-last-which-function-line -1
!   "Last on which `ada-which-function' was called.")
  (defvar ada-last-which-function-subprog 0
!   "Last subprogram name returned by `ada-which-function'.")
  (make-variable-buffer-local 'ada-last-which-function-subprog)
  (make-variable-buffer-local 'ada-last-which-function-line)
  
  
  (defun ada-which-function ()
!   "Return the name of the function whose body the point is in.
  This function works even in the case of nested subprograms, whereas the
  standard Emacs function `which-function' does not.
  Since the search can be long, the results are cached."
***************
*** 5082,5089 ****
            (goto-char (point-min))))))
  
  (defun ada-get-body-name (&optional spec-name)
!   "Returns the file name for the body of SPEC-NAME.
! If SPEC-NAME is nil, returns the body for the current package.
  Returns nil if no body was found."
    (interactive)
  
--- 5080,5087 ----
            (goto-char (point-min))))))
  
  (defun ada-get-body-name (&optional spec-name)
!   "Return the file name for the body of SPEC-NAME.
! If SPEC-NAME is nil, return the body for the current package.
  Returns nil if no body was found."
    (interactive)
  
***************
*** 5230,5236 ****
  ;; ---------------------------------------------------------
  
  (defun ada-outline-level ()
!   "This is so that `current-column` DTRT in otherwise-hidden text"
    ;; patch from Dave Love <address@hidden>
    (let (buffer-invisibility-spec)
      (save-excursion
--- 5228,5234 ----
  ;; ---------------------------------------------------------
  
  (defun ada-outline-level ()
!   "This is so that `current-column' DTRT in otherwise-hidden text."
    ;; patch from Dave Love <address@hidden>
    (let (buffer-invisibility-spec)
      (save-excursion
***************
*** 5242,5251 ****
  ;; ---------------------------------------------------------
  
  (defun ada-narrow-to-defun (&optional arg)
!   "make text outside current subprogram invisible.
  The subprogram visible is the one that contains or follow point.
  Optional ARG is ignored.
! Use `M-x widen' to go back to the full visibility for the buffer"
  
    (interactive)
    (save-excursion
--- 5240,5249 ----
  ;; ---------------------------------------------------------
  
  (defun ada-narrow-to-defun (&optional arg)
!   "Make text outside current subprogram invisible.
  The subprogram visible is the one that contains or follow point.
  Optional ARG is ignored.
! Use `M-x widen' to go back to the full visibility for the buffer."
  
    (interactive)
    (save-excursion
***************
*** 5276,5283 ****
  
  (defun ada-gen-treat-proc (match)
    "Make dummy body of a procedure/function specification.
! MATCH is a cons cell containing the start and end location of the last search
! for ada-procedure-start-regexp."
    (goto-char (car match))
    (let (func-found procname functype)
      (cond
--- 5274,5281 ----
  
  (defun ada-gen-treat-proc (match)
    "Make dummy body of a procedure/function specification.
! MATCH is a cons cell containing the start and end locations of the last search
! for `ada-procedure-start-regexp'."
    (goto-char (car match))
    (let (func-found procname functype)
      (cond
***************
*** 5398,5404 ****
            (setq body-file (ada-get-body-name))
            (if body-file
                (find-file body-file)
!             (error "No body found for the package. Create it first"))
  
            (save-restriction
              (widen)
--- 5396,5402 ----
            (setq body-file (ada-get-body-name))
            (if body-file
                (find-file body-file)
!             (error "No body found for the package.  Create it first"))
  
            (save-restriction
              (widen)




reply via email to

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