emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] /srv/bzr/emacs/trunk r99325: * progmodes/ada-mode.el: Deal


From: Juanma Barranquero
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r99325: * progmodes/ada-mode.el: Deal with Ada 2005 "overriding" keyword.
Date: Thu, 14 Jan 2010 13:52:37 +0100
User-agent: Bazaar (2.0.2)

------------------------------------------------------------
revno: 99325
author: Stephen Leake <address@hidden>
committer: Juanma Barranquero <address@hidden>
branch nick: trunk
timestamp: Thu 2010-01-14 13:52:37 +0100
message:
  * progmodes/ada-mode.el: Deal with Ada 2005 "overriding" keyword.
    (ada-subprog-start-re, ada-imenu-subprogram-menu-re): Add keyword.
    (ada-get-current-indent, ada-imenu-generic-expression)
    (ada-which-function): Check for it.
modified:
  lisp/ChangeLog
  lisp/progmodes/ada-mode.el
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2010-01-14 12:36:14 +0000
+++ b/lisp/ChangeLog    2010-01-14 12:52:37 +0000
@@ -1,5 +1,12 @@
 2010-01-14  Stephen Leake  <address@hidden>
 
+       * progmodes/ada-mode.el: Deal with Ada 2005 "overriding" keyword.
+       (ada-subprog-start-re, ada-imenu-subprogram-menu-re): Add keyword.
+       (ada-get-current-indent, ada-imenu-generic-expression)
+       (ada-which-function): Check for it.
+
+2010-01-14  Stephen Leake  <address@hidden>
+
        * progmodes/ada-mode.el (ada-clean-buffer-before-saving): Make obsolete.
        (ada-mode): Don't obey `ada-clean-buffer-before-saving' anymore.
 

=== modified file 'lisp/progmodes/ada-mode.el'
--- a/lisp/progmodes/ada-mode.el        2010-01-14 12:36:14 +0000
+++ b/lisp/progmodes/ada-mode.el        2010-01-14 12:52:37 +0000
@@ -674,7 +674,7 @@
 
 (defvar ada-subprog-start-re
   (eval-when-compile
-    (concat "\\<" (regexp-opt '("accept" "entry" "function" "package" 
"procedure"
+    (concat "\\<" (regexp-opt '("accept" "entry" "function" "overriding" 
"package" "procedure"
                                "protected" "task") t) "\\>"))
   "Regexp for the start of a subprogram.")
 
@@ -721,7 +721,7 @@
 (defconst ada-imenu-comment-re "\\([ \t]*--.*\\)?")
 
 (defconst ada-imenu-subprogram-menu-re
-  (concat "^[ \t]*\\(procedure\\|function\\)[ \t\n]+"
+  (concat "^[ \t]*\\(overriding[ \t]*\\)?\\(procedure\\|function\\)[ \t\n]+"
          "\\(\\(\\sw\\|_\\)+\\)[ \t\n]*\\([ \t\n]\\|([^)]+)"
          ada-imenu-comment-re
          "\\)[ \t\n]*"
@@ -729,7 +729,7 @@
 
 (defvar ada-imenu-generic-expression
   (list
-   (list nil ada-imenu-subprogram-menu-re 2)
+   (list nil ada-imenu-subprogram-menu-re 3)
    (list "*Specs*"
         (concat
          "^[ \t]*\\(procedure\\|function\\)[ \t\n]+\\(\\(\\sw\\|_\\)+\\)"
@@ -2477,7 +2477,7 @@
            (list (progn (back-to-indentation) (point)) 'ada-indent))
        (save-excursion
          (ada-goto-stmt-start)
-         (if (looking-at "\\<package\\|procedure\\|function\\>")
+         (if (looking-at "\\<overriding\\|package\\|procedure\\|function\\>")
              (list (progn (back-to-indentation) (point)) 0)
            (list (progn (back-to-indentation) (point)) 'ada-indent)))))
 
@@ -2626,20 +2626,23 @@
           (looking-at "\\<\\(package\\|function\\|procedure\\)\\>"))
       (save-excursion
        ;;  Go up until we find either a generic section, or the end of the
-       ;;  previous subprogram/package
+       ;;  previous subprogram/package, or 'overriding' for this 
function/procedure
        (let (found)
          (while (and (not found)
                      (ada-search-ignore-string-comment
-            
"\\<\\(generic\\|end\\|begin\\|package\\|procedure\\|function\\)\\>" t))
+            
"\\<\\(generic\\|end\\|begin\\|overriding\\|package\\|procedure\\|function\\)\\>"
 t))
 
            ;;  avoid "with procedure"... in generic parts
            (save-excursion
              (forward-word -1)
              (setq found (not (looking-at "with"))))))
 
-       (if (looking-at "generic")
-           (list (progn (back-to-indentation) (point)) 0)
-         (ada-indent-on-previous-lines nil orgpoint orgpoint))))
+       (cond
+        ((looking-at "\\<generic\\|overriding\\>")
+         (list (progn (back-to-indentation) (point)) 0))
+
+        (t
+         (ada-indent-on-previous-lines nil orgpoint orgpoint)))))
 
      ;;---------------------------------
      ;; label
@@ -5057,7 +5060,7 @@
 
          ;; Get the function name, but not the properties, or this changes
          ;; the face in the modeline on Emacs 21
-         (setq func-name (match-string-no-properties 2))
+         (setq func-name (match-string-no-properties 3))
          (if (and (not (ada-in-comment-p))
                   (not (save-excursion
                          (goto-char (match-end 0))


reply via email to

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