]> code.delx.au - gnu-emacs/blobdiff - lisp/progmodes/ada-mode.el
Remove incorrect uses of "modeline".
[gnu-emacs] / lisp / progmodes / ada-mode.el
index fe97b1e8a57804b722ae654c37e1bbe849c33140..1825098a55e048b262f93d438e23b8a273bc517a 100644 (file)
@@ -1,8 +1,6 @@
 ;;; ada-mode.el --- major-mode for editing Ada sources
 
-;; Copyright (C) 1994, 1995, 1997, 1998, 1999, 2000, 2001, 2002, 2003,
-;;   2004, 2005, 2006, 2007, 2008, 2009, 2010
-;;   Free Software Foundation, Inc.
+;; Copyright (C) 1994-1995, 1997-2012  Free Software Foundation, Inc.
 
 ;; Author: Rolf Ebert      <ebert@inf.enst.fr>
 ;;      Markus Heritsch <Markus.Heritsch@studbox.uni-stuttgart.de>
 ;; should be loaded before the ada-mode, which will then setup some variables
 ;; to improve the support for Ada code.
 ;; Here is the list of these modes:
-;;   `which-function-mode': Display the name of the subprogram the cursor is
-;;      in in the mode line.
+;;   `which-function-mode': Display in the mode line the name of the subprogram
+;;      the cursor is in.
 ;;   `outline-mode': Provides the capability to collapse or expand the code
 ;;      for specific language constructs, for instance if you want to hide the
 ;;      code corresponding to a subprogram
       version-string)))
 
 (defvar ada-mode-hook nil
-  "*List of functions to call when Ada mode is invoked.
+  "List of functions to call when Ada mode is invoked.
 This hook is automatically executed after the `ada-mode' is
 fully loaded.
 This is a good place to add Ada environment specific bindings.")
@@ -152,13 +150,13 @@ This is a good place to add Ada environment specific bindings.")
   :group 'languages)
 
 (defcustom ada-auto-case t
-  "*Non-nil means automatically change case of preceding word while typing.
+  "Non-nil means automatically change case of preceding word while typing.
 Casing is done according to `ada-case-keyword', `ada-case-identifier'
 and `ada-case-attribute'."
   :type 'boolean :group 'ada)
 
 (defcustom ada-broken-decl-indent 0
-  "*Number of columns to indent a broken declaration.
+  "Number of columns to indent a broken declaration.
 
 An example is :
   declare
@@ -167,7 +165,7 @@ An example is :
   :type 'integer :group 'ada)
 
 (defcustom ada-broken-indent 2
-  "*Number of columns to indent the continuation of a broken line.
+  "Number of columns to indent the continuation of a broken line.
 
 An example is :
    My_Var : My_Type := (Field1 =>
@@ -175,7 +173,7 @@ An example is :
   :type 'integer :group 'ada)
 
 (defcustom ada-continuation-indent ada-broken-indent
-  "*Number of columns to indent the continuation of broken lines in parenthesis.
+  "Number of columns to indent the continuation of broken lines in parenthesis.
 
 An example is :
    Func (Param1,
@@ -183,7 +181,7 @@ An example is :
   :type 'integer :group 'ada)
 
 (defcustom ada-case-attribute 'ada-capitalize-word
-  "*Function to call to adjust the case of Ada attributes.
+  "Function to call to adjust the case of Ada attributes.
 It may be `downcase-word', `upcase-word', `ada-loose-case-word',
 `ada-capitalize-word' or `ada-no-auto-case'."
   :type '(choice (const downcase-word)
@@ -195,7 +193,7 @@ It may be `downcase-word', `upcase-word', `ada-loose-case-word',
 
 (defcustom ada-case-exception-file
   (list (convert-standard-filename' "~/.emacs_case_exceptions"))
-  "*List of special casing exceptions dictionaries for identifiers.
+  "List of special casing exceptions dictionaries for identifiers.
 The first file is the one where new exceptions will be saved by Emacs
 when you call `ada-create-case-exception'.
 
@@ -209,7 +207,7 @@ by a comment."
   :group 'ada)
 
 (defcustom ada-case-keyword 'downcase-word
-  "*Function to call to adjust the case of an Ada keywords.
+  "Function to call to adjust the case of an Ada keywords.
 It may be `downcase-word', `upcase-word', `ada-loose-case-word' or
 `ada-capitalize-word'."
   :type '(choice (const downcase-word)
@@ -220,7 +218,7 @@ It may be `downcase-word', `upcase-word', `ada-loose-case-word' or
   :group 'ada)
 
 (defcustom ada-case-identifier 'ada-loose-case-word
-  "*Function to call to adjust the case of an Ada identifier.
+  "Function to call to adjust the case of an Ada identifier.
 It may be `downcase-word', `upcase-word', `ada-loose-case-word' or
 `ada-capitalize-word'."
   :type '(choice (const downcase-word)
@@ -231,7 +229,7 @@ It may be `downcase-word', `upcase-word', `ada-loose-case-word' or
   :group 'ada)
 
 (defcustom ada-clean-buffer-before-saving t
-  "*Non-nil means remove trailing spaces and untabify the buffer before saving."
+  "Non-nil means remove trailing spaces and untabify the buffer before saving."
   :type 'boolean :group 'ada)
 (make-obsolete-variable 'ada-clean-buffer-before-saving
                        "use the `write-file-functions' hook."
@@ -239,7 +237,7 @@ It may be `downcase-word', `upcase-word', `ada-loose-case-word' or
 
 
 (defcustom ada-indent 3
-  "*Size of Ada indentation.
+  "Size of Ada indentation.
 
 An example is :
 procedure Foo is
@@ -248,11 +246,11 @@ begin
   :type 'integer  :group 'ada)
 
 (defcustom ada-indent-after-return t
-  "*Non-nil means automatically indent after RET or LFD."
+  "Non-nil means automatically indent after RET or LFD."
   :type 'boolean :group 'ada)
 
 (defcustom ada-indent-align-comments t
-  "*Non-nil means align comments on previous line comments, if any.
+  "Non-nil means align comments on previous line comments, if any.
 If nil, indentation is calculated as usual.
 Note that indentation is calculated only if `ada-indent-comment-as-code' is t.
 
@@ -262,12 +260,12 @@ For instance:
   :type 'boolean :group 'ada)
 
 (defcustom ada-indent-comment-as-code t
-  "*Non-nil means indent comment lines as code.
+  "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.
+  "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
@@ -289,11 +287,11 @@ type A is
   :type 'boolean :group 'ada)
 
 (defcustom ada-indent-is-separate t
-  "*Non-nil means indent 'is separate' or 'is abstract' if on a single line."
+  "Non-nil means indent 'is separate' or 'is abstract' if on a single line."
   :type 'boolean :group 'ada)
 
 (defcustom ada-indent-record-rel-type 3
-  "*Indentation for 'record' relative to 'type' or 'use'.
+  "Indentation for 'record' relative to 'type' or 'use'.
 
 An example is:
    type A is
@@ -301,7 +299,7 @@ An example is:
   :type 'integer :group 'ada)
 
 (defcustom ada-indent-renames ada-broken-indent
-  "*Indentation for renames relative to the matching function statement.
+  "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).
 
@@ -312,7 +310,7 @@ An example is:
   :type 'integer :group 'ada)
 
 (defcustom ada-indent-return 0
-  "*Indentation for 'return' relative to the matching 'function' statement.
+  "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).
 
@@ -322,22 +320,22 @@ An example is:
   :type 'integer :group 'ada)
 
 (defcustom ada-indent-to-open-paren t
-  "*Non-nil means indent according to the innermost open parenthesis."
+  "Non-nil means indent according to the innermost open parenthesis."
   :type 'boolean :group 'ada)
 
 (defcustom ada-fill-comment-prefix "--  "
-  "*Text inserted in the first columns when filling a comment paragraph.
+  "Text inserted in the first columns when filling a comment paragraph.
 Note: if you modify this variable, you will have to invoke `ada-mode'
 again to take account of the new value."
   :type 'string :group 'ada)
 
 (defcustom ada-fill-comment-postfix " --"
-  "*Text inserted at the end of each line when filling a comment paragraph.
+  "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
-  "*Number of columns to indent a label.
+  "Number of columns to indent a label.
 
 An example is:
 procedure Foo is
@@ -348,15 +346,15 @@ This is also used for <<..>> labels"
   :type 'integer :group 'ada)
 
 (defcustom ada-language-version 'ada95
-  "*Ada language version; one of `ada83', `ada95', `ada2005'."
+  "Ada language version; one of `ada83', `ada95', `ada2005'."
   :type '(choice (const ada83) (const ada95) (const ada2005)) :group 'ada)
 
 (defcustom ada-move-to-declaration nil
-  "*Non-nil means `ada-move-to-start' moves 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]
-  "*Key used for binding the contextual menu.
+  "Key used for binding the contextual menu.
 If nil, no contextual menu is available."
   :type '(restricted-sexp :match-alternatives (stringp vectorp))
   :group 'ada)
@@ -366,7 +364,7 @@ If nil, no contextual menu is available."
          (split-string (or (getenv "ADA_INCLUDE_PATH") "") ":")
          '("/usr/adainclude" "/usr/local/adainclude"
            "/opt/gnu/adainclude"))
-  "*Default 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 `ada-search-directories-internal'."
   :type '(repeat (choice :tag "Directory"
@@ -381,7 +379,7 @@ 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.
+  "Number of columns to indent the end of a statement on a separate line.
 
 An example is:
    if A = B
@@ -389,7 +387,7 @@ An example is:
   :type 'integer :group 'ada)
 
 (defcustom ada-tab-policy 'indent-auto
-  "*Control the behavior of the TAB key.
+  "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.
@@ -400,7 +398,7 @@ Must be one of :
   :group 'ada)
 
 (defcustom ada-use-indent ada-broken-indent
-  "*Indentation for the lines in a 'use' statement.
+  "Indentation for the lines in a 'use' statement.
 
 An example is:
    use Ada.Text_IO,
@@ -408,7 +406,7 @@ An example is:
   :type 'integer :group 'ada)
 
 (defcustom ada-when-indent 3
-  "*Indentation for 'when' relative to 'exception' or 'case'.
+  "Indentation for 'when' relative to 'exception' or 'case'.
 
 An example is:
    case A is
@@ -416,7 +414,7 @@ An example is:
   :type 'integer :group 'ada)
 
 (defcustom ada-with-indent ada-broken-indent
-  "*Indentation for the lines in a 'with' statement.
+  "Indentation for the lines in a 'with' statement.
 
 An example is:
    with Ada.Text_IO,
@@ -424,7 +422,7 @@ An example is:
   :type 'integer :group 'ada)
 
 (defcustom ada-which-compiler 'gnat
-  "*Name of the compiler to use.
+  "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
@@ -461,6 +459,7 @@ The extensions should include a `.' if needed.")
 
 (defvar ada-mode-abbrev-table nil
   "Local abbrev table for Ada mode.")
+(define-abbrev-table 'ada-mode-abbrev-table ())
 
 (defvar ada-mode-syntax-table nil
   "Syntax table to be used for editing Ada source code.")
@@ -500,7 +499,7 @@ Used to define `ada-*-keywords.'"))
 
 (defvar ada-case-exception-substring '()
   "Alist of substrings (entities) that have special casing.
-The substrings are detected for word constituant when the word
+The substrings are detected for word constituent 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 '_'.")
 
@@ -827,7 +826,7 @@ the 4 file locations can be clicked on and jumped to."
 ;; to be considered as part of a word or not.
 ;; Some characters may have multiple meanings depending on the context:
 ;;  - ' is either the beginning of a constant character or an attribute
-;;  - # is either part of a based litteral or a gnatprep statement.
+;;  - # is either part of a based literal or a gnatprep statement.
 ;;  - " starts a string, but not if inside a constant character.
 ;;  - ( and ) should be ignored if inside a constant character.
 ;; Thus their syntax property is changed automatically, and we can still use
@@ -967,7 +966,7 @@ are treated as numbers instead of gnatprep comments."
     (unless modified
       (restore-buffer-modified-p nil))))
 
-(defun ada-after-change-function (beg end old-len)
+(defun ada-after-change-function (beg end _old-len)
   "Called when the region between BEG and END was changed in the buffer.
 OLD-LEN indicates what the length of the replaced text was."
   (save-excursion
@@ -1123,16 +1122,8 @@ the file name."
 (defvar ada-font-lock-syntactic-keywords) ; defined below
 
 ;;;###autoload
-(defun ada-mode ()
-  "Ada mode is the major mode for editing Ada code.
-\\{ada-mode-map}"
-
-  (interactive)
-  (kill-all-local-variables)
-
-  (set-syntax-table ada-mode-syntax-table)
-
-  (set (make-local-variable 'require-final-newline) mode-require-final-newline)
+(define-derived-mode ada-mode prog-mode "Ada"
+  "Ada mode is the major mode for editing Ada code."
 
   ;;  Set the paragraph delimiters so that one can select a whole block
   ;;  simply with M-h
@@ -1303,64 +1294,54 @@ the file name."
       (define-key ada-mode-map ada-popup-key 'ada-popup-menu))
 
   ;;  Support for Abbreviations (the user still need to "M-x abbrev-mode"
-  (define-abbrev-table 'ada-mode-abbrev-table ())
   (setq local-abbrev-table ada-mode-abbrev-table)
 
   ;;  Support for which-function mode
-  (make-local-variable 'which-func-functions)
-  (setq which-func-functions '(ada-which-function))
+  (set (make-local-variable 'which-func-functions) '(ada-which-function))
 
   ;;  Support for indent-new-comment-line (Especially for XEmacs)
   (set (make-local-variable 'comment-multi-line) nil)
 
   ;;  Support for add-log
-  (set (make-local-variable 'add-log-current-defun-function) 'ada-which-function)
-
-  (setq major-mode 'ada-mode
-       mode-name "Ada")
-
-  (use-local-map ada-mode-map)
+  (set (make-local-variable 'add-log-current-defun-function)
+       'ada-which-function)
 
   (easy-menu-add ada-mode-menu ada-mode-map)
 
-  (set-syntax-table ada-mode-syntax-table)
-
   (set (make-local-variable 'skeleton-further-elements)
        '((< '(backward-delete-char-untabify
              (min ada-indent (current-column))))))
   (add-hook 'skeleton-end-hook  'ada-adjust-case-skeleton nil t)
 
-  (run-mode-hooks 'ada-mode-hook)
-
   ;;  To be run after the hook, in case the user modified
   ;;  ada-fill-comment-prefix
-  ;; FIXME: if the user modified ada-fill-comment-prefix in his .emacs
-  ;; then it was already available before running the hook, and if he
-  ;; modifies it in the hook, he might as well modify comment-start instead.
-  (set (make-local-variable 'comment-start) (or ada-fill-comment-prefix "-- "))
-
-  ;;  Run this after the hook to give the users a chance to activate
-  ;;  font-lock-mode
-
-  (unless (or (eval-when-compile (fboundp 'syntax-propertize-via-font-lock))
-              (featurep 'xemacs))
-    (ada-initialize-syntax-table-properties)
-    (add-hook 'font-lock-mode-hook 'ada-handle-syntax-table-properties nil t))
-
-  ;; 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
-  ;; FIXME: it might even be set later on via file-local vars, no?
-  ;; so maybe ada-keywords should be set lazily.
-  (cond ((eq ada-language-version 'ada83)
-        (setq ada-keywords ada-83-keywords))
-       ((eq ada-language-version 'ada95)
-        (setq ada-keywords ada-95-keywords))
-       ((eq ada-language-version 'ada2005)
-        (setq ada-keywords ada-2005-keywords)))
-
-  (if ada-auto-case
-      (ada-activate-keys-for-case)))
+  (add-hook 'hack-local-variables-hook
+            (lambda ()
+              (set (make-local-variable 'comment-start)
+                   (or ada-fill-comment-prefix "-- "))
+
+              ;; Run this after the hook to give the users a chance
+              ;; to activate font-lock-mode.
+
+              (unless (or (eval-when-compile (fboundp 'syntax-propertize-via-font-lock))
+                          (featurep 'xemacs))
+                (ada-initialize-syntax-table-properties)
+                (add-hook 'font-lock-mode-hook
+                          'ada-handle-syntax-table-properties nil t))
+
+              ;; FIXME: ada-language-version might be set in the mode
+              ;; hook or it might even be set later on via file-local
+              ;; vars, so ada-keywords should be set lazily.
+              (cond ((eq ada-language-version 'ada83)
+                     (setq ada-keywords ada-83-keywords))
+                    ((eq ada-language-version 'ada95)
+                     (setq ada-keywords ada-95-keywords))
+                    ((eq ada-language-version 'ada2005)
+                     (setq ada-keywords ada-2005-keywords)))
+
+              (if ada-auto-case
+                  (ada-activate-keys-for-case)))
+            nil 'local))
 
 (defun ada-adjust-case-skeleton ()
   "Adjust the case of the text inserted by a skeleton."
@@ -1694,7 +1675,7 @@ ARG is the prefix the user entered with \\[universal-argument]."
          '( ?` ?_ ?# ?% ?& ?* ?( ?) ?- ?= ?+
                ?| ?\; ?: ?' ?\" ?< ?, ?. ?> ?/ ?\n 32 ?\r )))
 
-(defun ada-loose-case-word (&optional arg)
+(defun ada-loose-case-word (&optional _arg)
   "Upcase first letter and letters following `_' in the following word.
 No other letter is modified.
 ARG is ignored, and is there for compatibility with `capitalize-word' only."
@@ -1710,16 +1691,16 @@ ARG is ignored, and is there for compatibility with `capitalize-word' only."
        (insert-char (upcase (following-char)) 1)
        (delete-char 1)))))
 
-(defun ada-no-auto-case (&optional arg)
+(defun ada-no-auto-case (&optional _arg)
   "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
+adapt to unusual 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.
 See also `ada-auto-case' to disable auto casing altogether."
   nil)
 
-(defun ada-capitalize-word (&optional arg)
+(defun ada-capitalize-word (&optional _arg)
   "Upcase first letter and letters following '_', lower case other letters.
 ARG is ignored, and is there for compatibility with `capitalize-word' only."
   (interactive)
@@ -1792,7 +1773,7 @@ ATTENTION: This function might take very long for big buffers!"
 ;;    `ada-insert-paramlist'.
 ;; Both steps are called from `ada-format-paramlist'.
 ;; Note: Comments inside the parameter list are lost.
-;;       The syntax has to be correct, or the reformating will fail.
+;;       The syntax has to be correct, or the reformatting will fail.
 ;;--------------------------------------------------------------
 
 (defun ada-format-paramlist ()
@@ -2158,7 +2139,7 @@ command like:
 
   (while command-line-args-left
     (let ((source (car command-line-args-left)))
-      (message "Formating %s" source)
+      (message "Formatting %s" source)
       (find-file source)
       (ada-indent-region (point-min) (point-max))
       (ada-adjust-case-buffer)
@@ -3958,7 +3939,7 @@ If NOERROR is non-nil, it only returns nil if no matching start found."
        ;; processing them recursively avoids the need for any special
        ;; handling.
        ;; Nothing should be done if we have only the specs or a
-       ;; generic instantion.
+       ;; generic instantiation.
 
        ((and (looking-at "\\<procedure\\|function\\>"))
        (if first
@@ -4238,7 +4219,7 @@ of the region.  Otherwise, operate only on the current line."
        ((eq ada-tab-policy 'always-tab) (error "Not implemented"))
        ))
 
-(defun ada-untab (arg)
+(defun ada-untab (_arg)
   "Delete leading indenting according to `ada-tab-policy'."
   ;; FIXME: ARG is ignored
   (interactive "P")
@@ -4420,7 +4401,7 @@ Moves to 'begin' if in a declarative part."
           (ada-goto-matching-end 1))
 
          ;; on first line of subprogram body
-         ;; Do nothing for specs or generic instantion, since these are
+         ;; Do nothing for specs or generic instantiation, since these are
          ;; handled as the general case (find the enclosing block)
          ;; We also need to make sure that we ignore nested subprograms
          ((save-excursion
@@ -4632,7 +4613,7 @@ Moves to 'begin' if in a declarative part."
              ["Gdb Documentation"      (info "gdb")
               (eq ada-which-compiler 'gnat)]
              ["Ada95 Reference Manual" (info "arm95") t])
-            ("Options"  :included (eq major-mode 'ada-mode)
+            ("Options"  :included (derived-mode-p 'ada-mode)
              ["Auto Casing" (setq ada-auto-case (not ada-auto-case))
               :style toggle :selected ada-auto-case]
              ["Auto Indent After Return"
@@ -4669,7 +4650,7 @@ Moves to 'begin' if in a declarative part."
              ["Load..."      ada-set-default-project-file t]
              ["New..."       ada-prj-new                  t]
              ["Edit..."      ada-prj-edit                 t])
-            ("Goto"   :included (eq major-mode 'ada-mode)
+            ("Goto"   :included (derived-mode-p 'ada-mode)
              ["Goto Declaration/Body"   ada-goto-declaration
               (eq ada-which-compiler 'gnat)]
              ["Goto Body"               ada-goto-body
@@ -4698,7 +4679,7 @@ Moves to 'begin' if in a declarative part."
              ["-"                       nil                    nil]
              ["Other File"              ff-find-other-file     t]
              ["Other File Other Window" ada-ff-other-window    t])
-            ("Edit"   :included (eq major-mode 'ada-mode)
+            ("Edit"   :included (derived-mode-p 'ada-mode)
              ["Search File On Source Path"  ada-find-file                t]
              ["------"                      nil                          nil]
              ["Complete Identifier"         ada-complete-identifier      t]
@@ -4730,7 +4711,7 @@ Moves to 'begin' if in a declarative part."
              ["-----"                       nil                          nil]
              ["Narrow to subprogram"        ada-narrow-to-defun          t])
             ("Templates"
-             :included  (eq major-mode 'ada-mode)
+             :included  (derived-mode-p 'ada-mode)
              ["Header"          ada-header          t]
              ["-"               nil                 nil]
              ["Package Body"    ada-package-body    t]
@@ -4747,7 +4728,7 @@ Moves to 'begin' if in a declarative part."
              ["Entry family"    ada-entry-family    t]
              ["Select"          ada-select          t]
              ["Accept"          ada-accept          t]
-             ["Or accept"       ada-or-accep        t]
+             ["Or accept"       ada-or-accept       t]
              ["Or delay"        ada-or-delay        t]
              ["Or terminate"    ada-or-terminate    t]
              ["---"             nil                 nil]
@@ -5074,7 +5055,7 @@ Since the search can be long, the results are cached."
                    (re-search-backward ada-imenu-subprogram-menu-re nil t))
 
          ;; Get the function name, but not the properties, or this changes
-         ;; the face in the modeline on Emacs 21
+         ;; the face in the mode line on Emacs 21
          (setq func-name (match-string-no-properties 3))
          (if (and (not (ada-in-comment-p))
                   (not (save-excursion
@@ -5269,7 +5250,7 @@ Return nil if no body was found."
 ;;  Support for narrow-to-region
 ;; ---------------------------------------------------------
 
-(defun ada-narrow-to-defun (&optional arg)
+(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.