Replace Lisp calls to delete-backward-char by delete-char.
[bpt/emacs.git] / lisp / progmodes / ada-mode.el
index 3694de2..227f202 100644 (file)
@@ -257,7 +257,7 @@ Note that indentation is calculated only if `ada-indent-comment-as-code' is t.
 
 For instance:
     A := 1;   --  A multi-line comment
-             --  aligned if ada-indent-align-comments is t"
+             --  aligned if `ada-indent-align-comments' is t"
   :type 'boolean :group 'ada)
 
 (defcustom ada-indent-comment-as-code t
@@ -1017,6 +1017,9 @@ If PARSE-RESULT is non-nil, use it instead of calling `parse-partial-sexp'."
                          (line-beginning-position) (point))))
   (or (ada-in-string-p parse-result) (ada-in-comment-p parse-result)))
 
+(defsubst ada-in-numeric-literal-p ()
+  "Return t if point is after a prefix of a numeric literal."
+  (looking-back "\\([0-9]+#[0-9a-fA-F_]+\\)"))
 
 ;;------------------------------------------------------------------
 ;; Contextual menus
@@ -1606,6 +1609,8 @@ If FORCE-IDENTIFIER is non-nil then also adjust keyword as identifier."
                 (eq (char-syntax (char-before)) ?w)
                 ;;  if in a string or a comment
                 (not (ada-in-string-or-comment-p))
+                ;;  if in a numeric literal
+                (not (ada-in-numeric-literal-p))
                 )
            (if (save-excursion
                  (forward-word -1)
@@ -1640,7 +1645,7 @@ ARG is the prefix the user entered with \\[universal-argument]."
                     (insert " ")
                     (ada-adjust-case)
                     ;; horrible dekludge
-                    (delete-backward-char 1)
+                    (delete-char -1)
                     ;; some special keys and their bindings
                     (cond
                      ((eq lastk ?\n)
@@ -4163,7 +4168,7 @@ Return nil if the private is part of the package name, as in
 
 
 (defun ada-in-paramlist-p ()
-  "Return t if point is inside a parameter-list."
+  "Return t if point is inside the parameter-list of a declaration, but not a subprogram call or aggregate."
   (save-excursion
     (and
      (ada-search-ignore-string-comment "(\\|)" t nil t)
@@ -4194,13 +4199,13 @@ Return nil if the private is part of the package name, as in
 
      ;; right keyword two words before parenthesis ?
      ;; Type is in this list because of discriminants
+     ;; pragma is not, because the syntax is that of a subprogram call.
      (looking-at (eval-when-compile
                   (concat "\\<\\("
                           "procedure\\|function\\|body\\|"
                           "task\\|entry\\|accept\\|"
                           "access[ \t]+procedure\\|"
                           "access[ \t]+function\\|"
-                          "pragma\\|"
                           "type\\)\\>"))))))
 
 (defun ada-search-ignore-complex-boolean (regexp backwardp)