X-Git-Url: https://code.delx.au/gnu-emacs/blobdiff_plain/1f3ddf11e81c4c707fe2f231d05012185b842403..f4ff3e5cc0e873be609cf6172386c56587a83f31:/lisp/progmodes/ada-stmt.el diff --git a/lisp/progmodes/ada-stmt.el b/lisp/progmodes/ada-stmt.el index 3262f41bb5..a881753a0a 100644 --- a/lisp/progmodes/ada-stmt.el +++ b/lisp/progmodes/ada-stmt.el @@ -1,14 +1,28 @@ ;;; ada-stmt.el --- an extension to Ada mode for inserting statement templates -;; Copyright(C) 1987, 93, 94, 96, 97, 98, 99, 2000 -;; Free Software Foundation, Inc. - -;; This file is part of GNU Emacs. +;; Copyright (C) 1987, 1993, 1994, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +;; 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. ;; Authors: Daniel Pfeiffer, Markus Heritsch, Rolf Ebert -;; Maintainer: Emmanuel Briot +;; Maintainer: Stephen Leake ;; Keywords: languages, ada -;; Rolf Ebert's version: 2.26 + +;; This file is part of GNU Emacs. + +;; GNU Emacs is free software; you can redistribute it and/or modify +;; it under the terms of the GNU General Public License as published by +;; the Free Software Foundation; either version 3, or (at your option) +;; any later version. + +;; GNU Emacs is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;; GNU General Public License for more details. + +;; You should have received a copy of the GNU General Public License +;; along with GNU Emacs; see the file COPYING. If not, write to the +;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +;; Boston, MA 02110-1301, USA. ;;; Commentary: ;; This file is now automatically loaded from ada-mode.el, and creates a submenu @@ -64,11 +78,11 @@ (require 'ada-mode) (defun ada-func-or-proc-name () - ;; Get the name of the current function or procedure." + "Return the name of the current function or procedure." (save-excursion (let ((case-fold-search t)) (if (re-search-backward ada-procedure-start-regexp nil t) - (buffer-substring (match-beginning 3) (match-end 3)) + (match-string 5) "NAME?")))) ;;; ---- statement skeletons ------------------------------------------ @@ -305,7 +319,7 @@ Invoke right after `ada-function-spec' or `ada-procedure-spec'." (backward-char 1) (forward-sexp 1))) (if (looking-at ";") - (delete-char 1))) + (delete-char 1))) " is" \n _ \n < "begin" \n @@ -446,42 +460,26 @@ Invoke right after `ada-function-spec' or `ada-procedure-spec'." (define-skeleton ada-or-accept - "Insert an or statement, prompting for the condition name." + "Insert an accept alternative, prompting for the condition name." () < "or\n" (ada-accept)) (define-skeleton ada-or-delay - "Insert a delay statement, prompting for the delay value." + "Insert a delay alternative, prompting for the delay value." "[delay value]: " < "or\n" > "delay " str ";") (define-skeleton ada-or-terminate - "Insert a terminate statement." + "Insert a terminate alternative." () < "or\n" > "terminate;") -(defun ada-adjust-case-skeleton () - "Adjust the case of the text inserted by a skeleton." - (save-excursion - (let ((aa-end (point))) - (ada-adjust-case-region - (progn (goto-char (symbol-value 'beg)) (forward-word -1) (point)) - (goto-char aa-end))))) - -(defun ada-stmt-mode-hook () - (set (make-local-variable 'skeleton-further-elements) - '((< '(backward-delete-char-untabify - (min ada-indent (current-column)))))) - (add-hook 'skeleton-end-hook 'ada-adjust-case-skeleton nil t)) - -(add-hook 'ada-mode-hook 'ada-stmt-mode-hook) - (provide 'ada-stmt) ;;; arch-tag: 94f51555-cc0e-44e5-8865-8788aae8ecd3