Commits

Anonymous committed 4fa870c

Work on build-make-customize.

Comments (0)

Files changed (1)

         (build-make-customize build-make-alist)
 	))
     (set-buffer buffer)
-    (insert "(setq build-make-alist (quote")
-;;;     (cl-prettyprint (nreverse build-make-alist))
-    (cl-prettyprint build-make-alist)
-    (insert "))\n")
+;;;     (insert "(setq build-make-alist (quote")
+;;; ;;;     (cl-prettyprint (nreverse build-make-alist))
+;;;     (cl-prettyprint build-make-alist)
+;;;     (insert "))\n")
     (toggle-read-only 1)))
 
 (defun build-make-process-target-doc (targets doc a-list)
 	    (append (list (list name value)) (cdr (assoc 'macros a-list))))))
 
 (defun build-make-customize (a-list)
+  (princ "
+(provide 'build-make)\n
+(setq build-make-options nil)\n
+(defun sym-to-opt (sym)
+  (substring (symbol-name sym) 11))\n
+(defun build-set-value (sym val)
+  (setq build-make-options 
+	(acons (sym-to-opt sym) val
+	       build-make-options))
+  (set-default sym val))\n")		;
+  (princ (format "(defgroup build-make nil\n"))
+  (princ (format "  \"build-make options.\"\n"))
+  (princ "  :group 'build)\n\n")
   (mapcar 
-   (lambda (cat)
-     (princ (format "(defgroup build-make-%s nil\n" (first cat)))
-     (princ (format "  \"%s options.\"\n" (first cat)))
-     (princ "  :group 'build-make)\n\n")
-     (list (first cat)
-	   (mapcar
-	    (lambda (opt)
-	      (cond
-	       ((or (member "TYPE[,TYPE]..." (second opt))
-		    (and (member "TYPE" (second opt))
-			 (string-match
-			  "list\\s-+of"
-			  (apply 'concat (fourth opt)))))
-		(build-make-types cat opt)
-		)
-	       ((member "TYPE" (second opt))
-		(build-make-type cat opt)
-		)
-	       ((member "FLAGS" (second opt))
-		(build-make-string cat opt)
-		)
-	       ((member "XXXX" (second opt))
-		(build-make-file cat opt)
-		)
-	       ((member "VALUE" (second opt))
-		(build-make-string cat opt)
-		)
-	       ((member "DIR" (second opt))
-		(build-make-dir cat opt)
-		)
-	       ((member "LIB" (second opt))
-		(build-make-file cat opt)
-		)
-	       ((member "PATH" (second opt))
-		(build-make-path cat opt)
-		)
-	       ((or (null (second opt))
-		    (subsetp (second opt)
-			     '("no" "yes") :test 'string-equal))
-		(build-make-type cat opt)
-		)
-	       (t
-		)
-	       ))
-	    (delete-duplicates
-	     (cdr cat) :from-end t
-	     :test (lambda (a b)
-		     (string=
-		      (first a) (first b)))))))
-   a-list))
+   (lambda (macro)
+     (build-make-string (first macro) (second macro))
+     )
+   (rest (assoc 'macros a-list))))
+
+(defun build-make-string (name val)
+  (princ (format "(defcustom build-make-%s\n" name))
+  (princ (format "  %S\n" val))
+  (princ (format "  \"macro %s\"\n" name))
+  (princ (format "  :group \'build-make\n"))
+;;;   (princ "  :type '(string)\n")
+  (princ "  :type 'string\n")
+  (princ "  :set 'build-set-value)\n")
+  (princ "\n"))
 
 (provide 'build)