/[emacs]/emacs/lisp/progmodes/ada-stmt.el
ViewVC logotype

Diff of /emacs/lisp/progmodes/ada-stmt.el

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.10 by pj, Mon Jul 16 07:46:48 2001 UTC revision 1.11 by monnier, Tue Apr 9 18:55:13 2002 UTC
# Line 1  Line 1 
1  ;;; ada-stmt.el --- an extension to Ada mode for inserting statement templates  ;;; ada-stmt.el --- an extension to Ada mode for inserting statement templates
2    
3  ;; Copyright(C) 1987, 1993, 1994, 1996, 1997, 1998, 1999  ;; Copyright(C) 1987, 93, 94, 96, 97, 98, 99, 2000
4  ;;   Free Software Foundation, Inc.  ;;   Free Software Foundation, Inc.
5    
6  ;; Ada Core Technologies's version:   $Revision$  ;; Ada Core Technologies's version:   $Revision$
7    
8  ;; This file is part of GNU Emacs.  ;; This file is part of GNU Emacs.
9    
# Line 13  Line 13 
13  ;; Rolf Ebert's version: 2.26  ;; Rolf Ebert's version: 2.26
14    
15  ;;; Commentary:  ;;; Commentary:
16    ;; This file is now automatically loaded from ada-mode.el, and creates a submenu
17  ;;  ;; in Ada/ on the menu bar.
 ;; put the following statement in your .emacs:  
 ;; (require 'ada-stmt)  
 ;;  
18    
19  ;;; History:  ;;; History:
20    
# Line 113  Line 110 
110                   ["When" ada-when t])))                   ["When" ada-when t])))
111      (if ada-xemacs      (if ada-xemacs
112          (funcall (symbol-function 'add-submenu)          (funcall (symbol-function 'add-submenu)
113                   '("Ada") (append (list "Statements"                   '("Ada") (append (list "Templates"
114                                          :included '(string= mode-name "Ada"))                                          :included '(string= mode-name "Ada"))
115                                    menu))                                    menu))
116    
117        (define-key-after (lookup-key ada-mode-map [menu-bar Ada]) [Statements]        (define-key-after (lookup-key ada-mode-map [menu-bar Ada]) [Templates]
118          (list 'menu-item          (list 'menu-item
119                "Statements"                "Templates"
120                (easy-menu-create-menu "Statements" menu)                (easy-menu-create-menu "Templates" menu)
121                :visible '(string= mode-name "Ada"))                :visible '(string= mode-name "Ada"))
122          t))))          t))))
123    
# Line 132  Line 129 
129    (save-excursion    (save-excursion
130      (let ((case-fold-search t))      (let ((case-fold-search t))
131        (if (re-search-backward ada-procedure-start-regexp nil t)        (if (re-search-backward ada-procedure-start-regexp nil t)
132            (buffer-substring (match-beginning 2) (match-end 2))            (buffer-substring (match-beginning 3) (match-end 3))
133          "NAME?"))))          "NAME?"))))
134    
135  (defvar ada-template-map  (defvar ada-template-map
# Line 236  Indent for the first line of code." Line 233  Indent for the first line of code."
233  (define-skeleton ada-exit  (define-skeleton ada-exit
234    "Insert an exit statement, prompting for loop name and condition."    "Insert an exit statement, prompting for loop name and condition."
235    "[name of loop to exit]: "    "[name of loop to exit]: "
236    "exit " str & ?\  (ada-exit-1) | -1 ?\;)    "exit " str & ?\ (ada-exit-1) | -1 ?\;)
237    
238  ;;;###autoload  ;;;###autoload
239  (defun ada-header ()  (defun ada-header ()
# Line 532  Invoke right after `ada-function-spec' o Line 529  Invoke right after `ada-function-spec' o
529    "[accept name]: "    "[accept name]: "
530    > "accept " str    > "accept " str
531    (ada-get-param)    (ada-get-param)
 ;;;  " (" ("[parameter_specification]: " str "; ") -2 ")"  
532    " do" \n    " do" \n
533    > _ \n    > _ \n
534    < "end " str ";" )    < "end " str ";" )
# Line 566  Invoke right after `ada-function-spec' o Line 562  Invoke right after `ada-function-spec' o
562    > "terminate;")    > "terminate;")
563    
564    
 ;; ----  
565  (defun ada-adjust-case-skeleton ()  (defun ada-adjust-case-skeleton ()
566    "Adjust the case of the text inserted by a skeleton."    "Adjust the case of the text inserted by a skeleton."
567    (save-excursion    (save-excursion

Legend:
Removed from v.1.10  
changed lines
  Added in v.1.11

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26