Fixed.
[riece] / lisp / riece-develop.el
index 6bc766c..87d4de3 100644 (file)
@@ -1,6 +1,9 @@
 (defun riece-insert-struct-template (prefix struct)
   (interactive "sPrefix: 
 sStruct: ")
+  (if (and prefix
+          (not (string-match "-\\'" prefix)))
+      (setq prefix (concat prefix "-")))
   (let (attributes
        optional-attributes
        name
@@ -22,11 +25,12 @@ sStruct: ")
     (setq attributes (nreverse attributes)
          pointer (cons (vector "" nil nil nil)  attributes))
     (while (cdr pointer)
-      (when (aref (car (cdr pointer)) 1)
-       (setq optional-attributes (cons (car (cdr pointer))
-                                       optional-attributes))
-       (setcdr pointer (nthcdr 2 pointer)))
-      (setq pointer (cdr pointer)))
+      (if (aref (car (cdr pointer)) 1)
+         (progn
+           (setq optional-attributes (cons (car (cdr pointer))
+                                           optional-attributes))
+           (setcdr pointer (nthcdr 2 pointer)))
+       (setq pointer (cdr pointer))))
     (setq optional-attributes (nreverse optional-attributes)
          arglist (mapconcat (lambda (attribute)
                               (aref attribute 0))
@@ -38,7 +42,7 @@ sStruct: ")
                                         optional-attributes " "))))
     (setq strings (list (format "\
 \(defun %smake-%s (%s)
-  \"Make %s%s object.\"
+  \"Make %s%s object.\"
   (vector %s))"
                                prefix struct arglist
                                prefix struct