diff options
| author | Gerd Moellmann | 2000-07-24 11:13:40 +0000 |
|---|---|---|
| committer | Gerd Moellmann | 2000-07-24 11:13:40 +0000 |
| commit | cf543c1c14b17005af6780f221c985220a85aa7f (patch) | |
| tree | cdeb862a8ed06a56010c5a5dc8dc410362dd5757 | |
| parent | 15ea3b67a762629a984d638b750f70141744158c (diff) | |
| download | emacs-cf543c1c14b17005af6780f221c985220a85aa7f.tar.gz emacs-cf543c1c14b17005af6780f221c985220a85aa7f.zip | |
(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.
| -rw-r--r-- | lisp/progmodes/ada-stmt.el | 39 |
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 @@ | |||
| 2 | 2 | ||
| 3 | ;; Copyright(C) 1987, 1993-1994, 1996-1998, 1999 Free Software Foundation, Inc. | 3 | ;; Copyright(C) 1987, 1993-1994, 1996-1998, 1999 Free Software Foundation, Inc. |
| 4 | 4 | ||
| 5 | ;; Ada Core Technologies's version: $Revision: 1.10 $ | 5 | ;; Ada Core Technologies's version: $Revision: 1.16 $ |
| 6 | 6 | ||
| 7 | ;; Authors: Daniel Pfeiffer, Markus Heritsch, Rolf Ebert <ebert@waporo.muc.de> | 7 | ;; Authors: Daniel Pfeiffer, Markus Heritsch, Rolf Ebert <ebert@waporo.muc.de> |
| 8 | ;; Maintainer: Rolf Ebert <ebert@waporo.muc.de> | 8 | ;; Maintainer: Rolf Ebert <ebert@waporo.muc.de> |
| @@ -64,6 +64,7 @@ | |||
| 64 | (eval-when-compile | 64 | (eval-when-compile |
| 65 | (condition-case nil (require 'skeleton) | 65 | (condition-case nil (require 'skeleton) |
| 66 | (error nil))) | 66 | (error nil))) |
| 67 | |||
| 67 | (require 'easymenu) | 68 | (require 'easymenu) |
| 68 | 69 | ||
| 69 | (defun ada-stmt-add-to-ada-menu () | 70 | (defun ada-stmt-add-to-ada-menu () |
| @@ -108,12 +109,17 @@ | |||
| 108 | ["Exit" ada-exit t] | 109 | ["Exit" ada-exit t] |
| 109 | ["When" ada-when t]))) | 110 | ["When" ada-when t]))) |
| 110 | (if ada-xemacs | 111 | (if ada-xemacs |
| 111 | (progn | 112 | (funcall (symbol-function 'add-submenu) |
| 112 | (add-to-list 'menu "Statements") | 113 | '("Ada") (append (list "Statements" |
| 113 | (add-submenu '("Ada") menu)) | 114 | :included '(string= mode-name "Ada")) |
| 115 | menu)) | ||
| 114 | 116 | ||
| 115 | (define-key-after (lookup-key ada-mode-map [menu-bar Ada]) [Statements] | 117 | (define-key-after (lookup-key ada-mode-map [menu-bar Ada]) [Statements] |
| 116 | (cons "Statements" (easy-menu-create-menu "Statements" menu)) t)) | 118 | (list 'menu-item |
| 119 | "Statements" | ||
| 120 | (easy-menu-create-menu "Statements" menu) | ||
| 121 | :visible '(string= mode-name "Ada")) | ||
| 122 | t)) | ||
| 117 | )) | 123 | )) |
| 118 | 124 | ||
| 119 | 125 | ||
| @@ -236,7 +242,7 @@ Indent for the first line of code." | |||
| 236 | (save-excursion | 242 | (save-excursion |
| 237 | (goto-char (point-min)) | 243 | (goto-char (point-min)) |
| 238 | (if (fboundp 'make-header) | 244 | (if (fboundp 'make-header) |
| 239 | (make-header) | 245 | (funcall (symbol-function 'make-header)) |
| 240 | (ada-header-tmpl)))) | 246 | (ada-header-tmpl)))) |
| 241 | 247 | ||
| 242 | 248 | ||
| @@ -244,21 +250,21 @@ Indent for the first line of code." | |||
| 244 | "Insert a comment block containing the module title, author, etc." | 250 | "Insert a comment block containing the module title, author, etc." |
| 245 | "[Description]: " | 251 | "[Description]: " |
| 246 | "-- -*- Mode: Ada -*-" | 252 | "-- -*- Mode: Ada -*-" |
| 247 | "\n-- Filename : " (buffer-name) | 253 | "\n" ada-fill-comment-prefix "Filename : " (buffer-name) |
| 248 | "\n-- Description : " str | 254 | "\n" ada-fill-comment-prefix "Description : " str |
| 249 | "\n-- Author : " (user-full-name) | 255 | "\n" ada-fill-comment-prefix "Author : " (user-full-name) |
| 250 | "\n-- Created On : " (current-time-string) | 256 | "\n" ada-fill-comment-prefix "Created On : " (current-time-string) |
| 251 | "\n-- Last Modified By: ." | 257 | "\n" ada-fill-comment-prefix "Last Modified By: ." |
| 252 | "\n-- Last Modified On: ." | 258 | "\n" ada-fill-comment-prefix "Last Modified On: ." |
| 253 | "\n-- Update Count : 0" | 259 | "\n" ada-fill-comment-prefix "Update Count : 0" |
| 254 | "\n-- Status : Unknown, Use with caution!" | 260 | "\n" ada-fill-comment-prefix "Status : Unknown, Use with caution!" |
| 255 | "\n") | 261 | "\n") |
| 256 | 262 | ||
| 257 | 263 | ||
| 258 | (define-skeleton ada-display-comment | 264 | (define-skeleton ada-display-comment |
| 259 | "Inserts three comment lines, making a display comment." | 265 | "Inserts three comment lines, making a display comment." |
| 260 | () | 266 | () |
| 261 | "--\n-- " _ "\n--") | 267 | "--\n" ada-fill-comment-prefix _ "\n--") |
| 262 | 268 | ||
| 263 | 269 | ||
| 264 | (define-skeleton ada-if | 270 | (define-skeleton ada-if |
| @@ -573,9 +579,10 @@ Invoke right after `ada-function-spec' or `ada-procedure-spec'." | |||
| 573 | (save-excursion | 579 | (save-excursion |
| 574 | (let ((aa-end (point))) | 580 | (let ((aa-end (point))) |
| 575 | (ada-adjust-case-region | 581 | (ada-adjust-case-region |
| 576 | (progn (goto-char beg) (forward-word -1) (point)) | 582 | (progn (goto-char (symbol-value 'beg)) (forward-word -1) (point)) |
| 577 | (goto-char aa-end)) | 583 | (goto-char aa-end)) |
| 578 | ))) | 584 | ))) |
| 585 | |||
| 579 | (add-hook 'ada-mode-hook '(lambda () | 586 | (add-hook 'ada-mode-hook '(lambda () |
| 580 | (setq skeleton-further-elements | 587 | (setq skeleton-further-elements |
| 581 | '((< '(backward-delete-char-untabify | 588 | '((< '(backward-delete-char-untabify |