From: Richard M. Stallman Date: Tue, 10 May 2005 09:12:40 +0000 (+0000) Subject: (ada-adjust-case-skeleton): Moved from ada-stmt.el. X-Git-Tag: ttn-vms-21-2-B4~412 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=4d9db685ef795001d85c5550bd36d993e0c9dde5;p=emacs.git (ada-adjust-case-skeleton): Moved from ada-stmt.el. (ada-mode): Add ada-adjust-case-skeleton to skeleton-end-hook. --- diff --git a/lisp/progmodes/ada-mode.el b/lisp/progmodes/ada-mode.el index 818e58dd891..d31978b5ec9 100644 --- a/lisp/progmodes/ada-mode.el +++ b/lisp/progmodes/ada-mode.el @@ -1364,6 +1364,11 @@ If you use ada-xref.el: (add-hook 'local-write-file-hooks (lambda () (untabify (point-min) (point-max)))))) + (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) + (run-hooks 'ada-mode-hook) ;; To be run after the hook, in case the user modified @@ -1393,6 +1398,13 @@ If you use ada-xref.el: (if ada-auto-case (ada-activate-keys-for-case))) +(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))))) ;; transient-mark-mode and mark-active are not defined in XEmacs (defun ada-region-selected ()