aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStephen Leake2010-01-14 13:52:37 +0100
committerJuanma Barranquero2010-01-14 13:52:37 +0100
commitfb0d15459ca0a197330e6131526613d04a56c12a (patch)
tree43451bec7f3d8065903703ea05feb597b73d71c9
parent5c9434d0a0a6995089224a4bcb2286d13de46aec (diff)
downloademacs-fb0d15459ca0a197330e6131526613d04a56c12a.tar.gz
emacs-fb0d15459ca0a197330e6131526613d04a56c12a.zip
* 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.
-rw-r--r--lisp/ChangeLog7
-rw-r--r--lisp/progmodes/ada-mode.el23
2 files changed, 20 insertions, 10 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index fae0eb39051..1be10bb17cd 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,5 +1,12 @@
12010-01-14 Stephen Leake <stephen_leake@member.fsf.org> 12010-01-14 Stephen Leake <stephen_leake@member.fsf.org>
2 2
3 * progmodes/ada-mode.el: Deal with Ada 2005 "overriding" keyword.
4 (ada-subprog-start-re, ada-imenu-subprogram-menu-re): Add keyword.
5 (ada-get-current-indent, ada-imenu-generic-expression)
6 (ada-which-function): Check for it.
7
82010-01-14 Stephen Leake <stephen_leake@member.fsf.org>
9
3 * progmodes/ada-mode.el (ada-clean-buffer-before-saving): Make obsolete. 10 * progmodes/ada-mode.el (ada-clean-buffer-before-saving): Make obsolete.
4 (ada-mode): Don't obey `ada-clean-buffer-before-saving' anymore. 11 (ada-mode): Don't obey `ada-clean-buffer-before-saving' anymore.
5 12
diff --git a/lisp/progmodes/ada-mode.el b/lisp/progmodes/ada-mode.el
index e246118fae2..b25e54018fa 100644
--- a/lisp/progmodes/ada-mode.el
+++ b/lisp/progmodes/ada-mode.el
@@ -674,7 +674,7 @@ A new statement starts after these.")
674 674
675(defvar ada-subprog-start-re 675(defvar ada-subprog-start-re
676 (eval-when-compile 676 (eval-when-compile
677 (concat "\\<" (regexp-opt '("accept" "entry" "function" "package" "procedure" 677 (concat "\\<" (regexp-opt '("accept" "entry" "function" "overriding" "package" "procedure"
678 "protected" "task") t) "\\>")) 678 "protected" "task") t) "\\>"))
679 "Regexp for the start of a subprogram.") 679 "Regexp for the start of a subprogram.")
680 680
@@ -721,7 +721,7 @@ displaying the menu if point was on an identifier."
721(defconst ada-imenu-comment-re "\\([ \t]*--.*\\)?") 721(defconst ada-imenu-comment-re "\\([ \t]*--.*\\)?")
722 722
723(defconst ada-imenu-subprogram-menu-re 723(defconst ada-imenu-subprogram-menu-re
724 (concat "^[ \t]*\\(procedure\\|function\\)[ \t\n]+" 724 (concat "^[ \t]*\\(overriding[ \t]*\\)?\\(procedure\\|function\\)[ \t\n]+"
725 "\\(\\(\\sw\\|_\\)+\\)[ \t\n]*\\([ \t\n]\\|([^)]+)" 725 "\\(\\(\\sw\\|_\\)+\\)[ \t\n]*\\([ \t\n]\\|([^)]+)"
726 ada-imenu-comment-re 726 ada-imenu-comment-re
727 "\\)[ \t\n]*" 727 "\\)[ \t\n]*"
@@ -729,7 +729,7 @@ displaying the menu if point was on an identifier."
729 729
730(defvar ada-imenu-generic-expression 730(defvar ada-imenu-generic-expression
731 (list 731 (list
732 (list nil ada-imenu-subprogram-menu-re 2) 732 (list nil ada-imenu-subprogram-menu-re 3)
733 (list "*Specs*" 733 (list "*Specs*"
734 (concat 734 (concat
735 "^[ \t]*\\(procedure\\|function\\)[ \t\n]+\\(\\(\\sw\\|_\\)+\\)" 735 "^[ \t]*\\(procedure\\|function\\)[ \t\n]+\\(\\(\\sw\\|_\\)+\\)"
@@ -2477,7 +2477,7 @@ and the offset."
2477 (list (progn (back-to-indentation) (point)) 'ada-indent)) 2477 (list (progn (back-to-indentation) (point)) 'ada-indent))
2478 (save-excursion 2478 (save-excursion
2479 (ada-goto-stmt-start) 2479 (ada-goto-stmt-start)
2480 (if (looking-at "\\<package\\|procedure\\|function\\>") 2480 (if (looking-at "\\<overriding\\|package\\|procedure\\|function\\>")
2481 (list (progn (back-to-indentation) (point)) 0) 2481 (list (progn (back-to-indentation) (point)) 0)
2482 (list (progn (back-to-indentation) (point)) 'ada-indent))))) 2482 (list (progn (back-to-indentation) (point)) 'ada-indent)))))
2483 2483
@@ -2626,20 +2626,23 @@ and the offset."
2626 (looking-at "\\<\\(package\\|function\\|procedure\\)\\>")) 2626 (looking-at "\\<\\(package\\|function\\|procedure\\)\\>"))
2627 (save-excursion 2627 (save-excursion
2628 ;; Go up until we find either a generic section, or the end of the 2628 ;; Go up until we find either a generic section, or the end of the
2629 ;; previous subprogram/package 2629 ;; previous subprogram/package, or 'overriding' for this function/procedure
2630 (let (found) 2630 (let (found)
2631 (while (and (not found) 2631 (while (and (not found)
2632 (ada-search-ignore-string-comment 2632 (ada-search-ignore-string-comment
2633 "\\<\\(generic\\|end\\|begin\\|package\\|procedure\\|function\\)\\>" t)) 2633 "\\<\\(generic\\|end\\|begin\\|overriding\\|package\\|procedure\\|function\\)\\>" t))
2634 2634
2635 ;; avoid "with procedure"... in generic parts 2635 ;; avoid "with procedure"... in generic parts
2636 (save-excursion 2636 (save-excursion
2637 (forward-word -1) 2637 (forward-word -1)
2638 (setq found (not (looking-at "with")))))) 2638 (setq found (not (looking-at "with"))))))
2639 2639
2640 (if (looking-at "generic") 2640 (cond
2641 (list (progn (back-to-indentation) (point)) 0) 2641 ((looking-at "\\<generic\\|overriding\\>")
2642 (ada-indent-on-previous-lines nil orgpoint orgpoint)))) 2642 (list (progn (back-to-indentation) (point)) 0))
2643
2644 (t
2645 (ada-indent-on-previous-lines nil orgpoint orgpoint)))))
2643 2646
2644 ;;--------------------------------- 2647 ;;---------------------------------
2645 ;; label 2648 ;; label
@@ -5057,7 +5060,7 @@ Since the search can be long, the results are cached."
5057 5060
5058 ;; Get the function name, but not the properties, or this changes 5061 ;; Get the function name, but not the properties, or this changes
5059 ;; the face in the modeline on Emacs 21 5062 ;; the face in the modeline on Emacs 21
5060 (setq func-name (match-string-no-properties 2)) 5063 (setq func-name (match-string-no-properties 3))
5061 (if (and (not (ada-in-comment-p)) 5064 (if (and (not (ada-in-comment-p))
5062 (not (save-excursion 5065 (not (save-excursion
5063 (goto-char (match-end 0)) 5066 (goto-char (match-end 0))