summaryrefslogtreecommitdiff
path: root/lisp/progmodes/ada-stmt.el
diff options
context:
space:
mode:
authorGerd Moellmann <gerd@gnu.org>2000-07-24 11:13:40 +0000
committerGerd Moellmann <gerd@gnu.org>2000-07-24 11:13:40 +0000
commitcf543c1c14b17005af6780f221c985220a85aa7f (patch)
treecdeb862a8ed06a56010c5a5dc8dc410362dd5757 /lisp/progmodes/ada-stmt.el
parent15ea3b67a762629a984d638b750f70141744158c (diff)
downloademacs-cf543c1c14b17005af6780f221c985220a85aa7f.tar.gz
(ada-stmt-add-to-ada-menu): Hide the menu if not in
Ada mode. This will allow us to display the Ada menu in any buffer we want (for project items). (ada-header-tmpl): Use ada-fill-comment-prefix to put the correct number of spaces in the header.
Diffstat (limited to 'lisp/progmodes/ada-stmt.el')
-rw-r--r--lisp/progmodes/ada-stmt.el39
1 files changed, 23 insertions, 16 deletions
diff --git a/lisp/progmodes/ada-stmt.el b/lisp/progmodes/ada-stmt.el
index f16bbf08cbf..a7981841c6c 100644
--- a/lisp/progmodes/ada-stmt.el
+++ b/lisp/progmodes/ada-stmt.el
@@ -2,7 +2,7 @@
;; Copyright(C) 1987, 1993-1994, 1996-1998, 1999 Free Software Foundation, Inc.
-;; Ada Core Technologies's version: $Revision: 1.10 $
+;; Ada Core Technologies's version: $Revision: 1.16 $
;; Authors: Daniel Pfeiffer, Markus Heritsch, Rolf Ebert <ebert@waporo.muc.de>
;; Maintainer: Rolf Ebert <ebert@waporo.muc.de>
@@ -64,6 +64,7 @@
(eval-when-compile
(condition-case nil (require 'skeleton)
(error nil)))
+
(require 'easymenu)
(defun ada-stmt-add-to-ada-menu ()
@@ -108,12 +109,17 @@
["Exit" ada-exit t]
["When" ada-when t])))
(if ada-xemacs
- (progn
- (add-to-list 'menu "Statements")
- (add-submenu '("Ada") menu))
+ (funcall (symbol-function 'add-submenu)
+ '("Ada") (append (list "Statements"
+ :included '(string= mode-name "Ada"))
+ menu))
(define-key-after (lookup-key ada-mode-map [menu-bar Ada]) [Statements]
- (cons "Statements" (easy-menu-create-menu "Statements" menu)) t))
+ (list 'menu-item
+ "Statements"
+ (easy-menu-create-menu "Statements" menu)
+ :visible '(string= mode-name "Ada"))
+ t))
))
@@ -236,7 +242,7 @@ Indent for the first line of code."
(save-excursion
(goto-char (point-min))
(if (fboundp 'make-header)
- (make-header)
+ (funcall (symbol-function 'make-header))
(ada-header-tmpl))))
@@ -244,21 +250,21 @@ Indent for the first line of code."
"Insert a comment block containing the module title, author, etc."
"[Description]: "
"-- -*- Mode: Ada -*-"
- "\n-- Filename : " (buffer-name)
- "\n-- Description : " str
- "\n-- Author : " (user-full-name)
- "\n-- Created On : " (current-time-string)
- "\n-- Last Modified By: ."
- "\n-- Last Modified On: ."
- "\n-- Update Count : 0"
- "\n-- Status : Unknown, Use with caution!"
+ "\n" ada-fill-comment-prefix "Filename : " (buffer-name)
+ "\n" ada-fill-comment-prefix "Description : " str
+ "\n" ada-fill-comment-prefix "Author : " (user-full-name)
+ "\n" ada-fill-comment-prefix "Created On : " (current-time-string)
+ "\n" ada-fill-comment-prefix "Last Modified By: ."
+ "\n" ada-fill-comment-prefix "Last Modified On: ."
+ "\n" ada-fill-comment-prefix "Update Count : 0"
+ "\n" ada-fill-comment-prefix "Status : Unknown, Use with caution!"
"\n")
(define-skeleton ada-display-comment
"Inserts three comment lines, making a display comment."
()
- "--\n-- " _ "\n--")
+ "--\n" ada-fill-comment-prefix _ "\n--")
(define-skeleton ada-if
@@ -573,9 +579,10 @@ Invoke right after `ada-function-spec' or `ada-procedure-spec'."
(save-excursion
(let ((aa-end (point)))
(ada-adjust-case-region
- (progn (goto-char beg) (forward-word -1) (point))
+ (progn (goto-char (symbol-value 'beg)) (forward-word -1) (point))
(goto-char aa-end))
)))
+
(add-hook 'ada-mode-hook '(lambda ()
(setq skeleton-further-elements
'((< '(backward-delete-char-untabify