]> code.delx.au - gnu-emacs-elpa/blobdiff - packages/ada-mode/ada-skel.el
update ada-mode, wisi
[gnu-emacs-elpa] / packages / ada-mode / ada-skel.el
old mode 100755 (executable)
new mode 100644 (file)
index a6216c1..9544222
@@ -109,6 +109,10 @@ This could end in a token recognized by `ada-skel-expand'."
 
 )
 
+;; override ada-mode 4.01 autoloaded functions
+(define-obsolete-function-alias 'ada-header 'ada-skel-header "24.4"
+  "Insert a descriptive header at the top of the file.")
+
 ;;;;; Ada skeletons (alphabetical)
 
 (define-skeleton ada-skel-accept
@@ -145,7 +149,7 @@ This could end in a token recognized by `ada-skel-expand'."
 (define-skeleton ada-skel-for
   "Insert a for loop statement with an optional name (from `str')."
   ()
-  str & ":\n"
+  str & " :\n"
   "for " _ " loop\n"
   "end loop " str | -1 ";")
 
@@ -419,7 +423,7 @@ it is a name, and use the word before that as the token."
          (progn
            (ada-skel-expand)
            t)
-       ('error
+       (error
         ;; undo hook action if any
         (unless (or (eq 't pending-undo-list)
                     (= undo-len (length pending-undo-list)))
@@ -429,6 +433,15 @@ it is a name, and use the word before that as the token."
         (goto-char pos)
         nil)))))
 
+(defun ada-skel-next-placeholder ()
+  "Move point to after next placeholder."
+  (skip-syntax-forward "^!")
+  (skip-syntax-forward "w!"))
+
+(defun ada-skel-prev-placeholder ()
+  "Move point to after previous placeholder."
+  (skip-syntax-backward "^!"))
+
 (defun ada-skel-setup ()
   "Setup a buffer for ada-skel."
   (add-hook 'skeleton-end-hook 'ada-indent-statement nil t)
@@ -441,6 +454,8 @@ it is a name, and use the word before that as the token."
 (provide 'ada-skel)
 
 (setq ada-expand 'ada-skel-expand)
+(setq ada-next-placeholder 'ada-skel-next-placeholder)
+(setq ada-prev-placeholder 'ada-skel-prev-placeholder)
 
 (add-hook 'ada-mode-hook 'ada-skel-setup)