From: Guillaume
Subject: interactive
Date: 
Message-ID: <1164458117.335816.112980@m7g2000cwm.googlegroups.com>
Hello,
to create a 2*2 tree with metapost, I tried to ceate un lisp function,
but I'm really beginning with emacs...
I don't really know how to use "interctive".
I tried something but it would'nt work : I'd like to have 10 input item
and to get the metapost code :

;;;;;;;;;;;;;;;;;;;;;

(defun meta-insert-matrix (A B C Dd E F pa pb pc pd pe pf)
  (interactive "nA : nB : nC : nDd : nE : nF :
                npa : npb : npc : npd : npe : npf : ")
(insert "
input /home/moi/Figures/Arbres_Graphes/rboxes;
input metaobj;
input newcourbes;
input TEX;

verbatimtex
%&latex
\documentclass[fourier]{Polymaths}
\begin{document}

etex

beginfig(1)
 setCurveDefaultOption("arrows")("draw");
  setObjectDefaultOption("Tree")("treemode")("D");
  setObjectDefaultOption("Tree")("vsep")(2cm);
  setObjectDefaultOption("Circle")("fillcolor")(blue);
  t[1]:=_T(Tcircle_(btex E etex) )(Tcircle_(btex A etex),Tcircle_(btex
B etex));
  t[2]:=_T(Tcircle_(btex F etex) )(Tcircle_(btex C etex),Tcircle_(btex
Dd etex));
  t:=_T(TC)(t[1],t[2]);

   Obj(t).c=origin;

   ObjLabel.Obj(t)(btex \small$ pe$ etex) "labpathid(1)",
"labdir(lft)","labcolor(blue)";
   ObjLabel.Obj(t)(btex \small$ pf$ etex) "labpathid(2)",
"labdir(rt)","labcolor(blue)";
ObjLabel.Obj(t[1])(btex \small$ pa$ etex) "labpathid(1)",
"labdir(lft)","labcolor(blue)";
   ObjLabel.Obj(t[1])(btex \small$ pb$ etex) "labpathid(2)",
"labdir(rt)","labcolor(blue)";
   ObjLabel.Obj(t[2])(btex \small$ pc$ etex) "labpathid(1)",
"labdir(lft)","labcolor(blue)";
   ObjLabel.Obj(t[2])(btex \small$ pd$ etex) "labpathid(2)",
"labdir(rt)","labcolor(blue)";

   draw_Obj(t);
endfig;
end
"))

;;;;;;;;;;;;;;;;;;;;;