From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id PAA06489; Tue, 5 Feb 2002 15:13:55 +0100 (MET) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id PAA06186 for ; Tue, 5 Feb 2002 15:13:54 +0100 (MET) Received: from mel-rto6.wanadoo.fr (smtp-out-6.wanadoo.fr [193.252.19.25]) by concorde.inria.fr (8.11.1/8.11.1) with ESMTP id g15EDqH20982 for ; Tue, 5 Feb 2002 15:13:52 +0100 (MET) Received: from mel-rta9.wanadoo.fr (193.252.19.69) by mel-rto6.wanadoo.fr; 5 Feb 2002 15:13:50 +0100 Received: from debian (80.8.75.62) by mel-rta9.wanadoo.fr; 5 Feb 2002 15:13:25 +0100 Received: from moi by debian with local (Exim 3.34 #1 (Debian)) id 16Y6M6-0001u1-00 for ; Tue, 05 Feb 2002 15:13:54 +0100 To: caml-list@inria.fr Subject: Re: [Caml-list] pretty-printing with camlp4 References: <20020205121705.GC25187@chopin.ai.univie.ac.at> <20020205140322.D23898@verdot.inria.fr> From: Remi VANICAT Date: 05 Feb 2002 15:13:54 +0100 In-Reply-To: <20020205140322.D23898@verdot.inria.fr> Message-ID: <87pu3kdnj1.dlv@wanadoo.fr> User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.1 MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Transfer-Encoding: 8bit Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk Daniel de Rauglaudre writes: > Hi, > > On Tue, Feb 05, 2002 at 01:17:05PM +0100, Markus Mottl wrote: > > > I would like to adapt pretty-printing of OCaml-sources with camlp4 to > > match my style. What would be the best way to go about this? Just copy > > e.g. camlp4/etc/pr_o.ml and change it to my needs? > > You can do that indeed, but my pretty printer is badly written, it is > probably difficult to understand. I should rewrite it using Format one > day, but it is a big work. by the way, if you have the file spretty_option.ml : -- begin of file -- value set_dt x = Spretty.dt.val := x ; value set_tol x = Spretty.tol.val := x ; value set_sp st = Spretty.sp.val := Token.eval_char st ; Pcaml.add_option "-dt" (Arg.Int set_dt) "change dt value"; Pcaml.add_option "-tol" (Arg.Int set_tol) "change tol value"; Pcaml.add_option "-sp" (Arg.String set_sp) "change sp value"; -- end of file -- (compile with : ocamlc -I +camlp4 -pp camlp4r -c spretty_option.ml ) then camlp4 will have 3 new option : -dt -tol and -sp that will change some pretty printer action : - tol seem to change the way you indent in a long application - dt is the default indentation - sp is the space char (not sure it may be useful to change it) (just try). -- Rémi Vanicat vanicat@labri.u-bordeaux.fr http://dept-info.labri.u-bordeaux.fr/~vanicat ------------------- Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/ To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr