* [Caml-list] q
@ 2004-01-05 20:00 Kamil Shakirov
2004-01-07 7:08 ` [Caml-list] Tuareg Christophe TROESTLER
0 siblings, 1 reply; 7+ messages in thread
From: Kamil Shakirov @ 2004-01-05 20:00 UTC (permalink / raw)
To: caml-list; +Cc: kamil
Hello List,
I use `tuareg' mode for editing my OCaml sources. I want to roll up
long functions in one line (`let'--definition). I usually place many
small auxiliary functions in a body of a main function,
for instance:
let complex_function arg1 arg2 ... =
let fun_aux1 arg1 arg2 ... =
bla bla bla
in
let fun_aux2 arg1 arg2 ... =
bla bla bla
in
let fun_aux3 arg1 ... =
bla bla bla
in
fun_aux3 arg2
(fun_aux2 (fun_aux arg1 arg2) arg1)
How can I do this? Is there any additional xemacs package for this
purpose? Thanks.
PS:
My xemacs version:
XEmacs 21.4 (patch 14) "Reasonable Discussion" (linux)
"Tuareg Version 1.41.1"
--
Kamil.
-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [Caml-list] Tuareg
2004-01-05 20:00 [Caml-list] q Kamil Shakirov
@ 2004-01-07 7:08 ` Christophe TROESTLER
2004-01-08 2:09 ` Kamil Shakirov
2004-01-08 2:18 ` Kamil Shakirov
0 siblings, 2 replies; 7+ messages in thread
From: Christophe TROESTLER @ 2004-01-07 7:08 UTC (permalink / raw)
To: kamils; +Cc: caml-list, kamil
On Mon, 05 Jan 2004, Kamil Shakirov <kamils@inbox.ru> wrote:
>
> let complex_function arg1 arg2 ... =
> let fun_aux1 arg1 arg2 ... =
> bla bla bla
> in
> [...]
> fun_aux3 arg2
> (fun_aux2 (fun_aux arg1 arg2) arg1)
Include in your ~/.emacs the following :
(add-hook 'tuareg-mode-hook
(function
(lambda ()
(setq tuareg-in-indent 0)
(setq tuareg-let-always-indent t)
(setq tuareg-let-indent 2)
(setq tuareg-with-indent 0)
(setq tuareg-function-indent 0)
(setq tuareg-fun-indent 0)
(setq tuareg-parse-indent 0)
(setq tuareg-parser-indent 0)
(setq tuareg-match-indent 0)
(setq tuareg-begin-indent 2)
)))
Happy new year!
ChriS
-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [Caml-list] Tuareg
2004-01-07 7:08 ` [Caml-list] Tuareg Christophe TROESTLER
@ 2004-01-08 2:09 ` Kamil Shakirov
2004-01-08 14:13 ` Albert Cohen
2004-01-08 2:18 ` Kamil Shakirov
1 sibling, 1 reply; 7+ messages in thread
From: Kamil Shakirov @ 2004-01-08 2:09 UTC (permalink / raw)
To: Christophe.Troestler; +Cc: caml-list
Hello Christophe,
Christophe TROESTLER <ipcastillon@prodigy.net.mx> writes:
>> let complex_function arg1 arg2 ... =
>> let fun_aux1 arg1 arg2 ... =
>> bla bla bla
>> in
>> [...]
>> fun_aux3 arg2
>> (fun_aux2 (fun_aux arg1 arg2) arg1)
>
> Include in your ~/.emacs the following :
>
> (add-hook 'tuareg-mode-hook
> (function
> (lambda ()
> (setq tuareg-in-indent 0)
> (setq tuareg-let-always-indent t)
> (setq tuareg-let-indent 2)
> (setq tuareg-with-indent 0)
> (setq tuareg-function-indent 0)
> (setq tuareg-fun-indent 0)
> (setq tuareg-parse-indent 0)
> (setq tuareg-parser-indent 0)
> (setq tuareg-match-indent 0)
> (setq tuareg-begin-indent 2)
> )))
I meant `folding' --- hiding parts of the edited program. Probably you
did not understand me because my english is not good. ;)
Anyway, thank you for your answer.
I have found similar minor edit mode (hideshow.el, hs-minor-mode for
block hiding and showing) but it is for c-mode. It would be nice
implement this in tuareg mode.
> Happy new year!
Thanks. Same to you. ;)
--
Kamil.
-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [Caml-list] Tuareg
2004-01-08 2:09 ` Kamil Shakirov
@ 2004-01-08 14:13 ` Albert Cohen
2004-01-08 14:46 ` Jérôme Marant
0 siblings, 1 reply; 7+ messages in thread
From: Albert Cohen @ 2004-01-08 14:13 UTC (permalink / raw)
To: Kamil Shakirov; +Cc: Christophe.Troestler, caml-list
On Thu, Jan 08, 2004 at 05:09:30AM +0300, Kamil Shakirov wrote:
> I meant `folding' --- hiding parts of the edited program. Probably you
> did not understand me because my english is not good. ;)
>
> Anyway, thank you for your answer.
>
> I have found similar minor edit mode (hideshow.el, hs-minor-mode for
> block hiding and showing) but it is for c-mode. It would be nice
> implement this in tuareg mode.
Thanks for the suggestion, I'll take a look to hideshow.el to see
if it can be customized and reused within Tuareg.
Albert
--
Albert Cohen http://www-rocq.inria.fr/~acohen
-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [Caml-list] Tuareg
2004-01-08 14:13 ` Albert Cohen
@ 2004-01-08 14:46 ` Jérôme Marant
2004-01-09 7:27 ` Kamil Shakirov
0 siblings, 1 reply; 7+ messages in thread
From: Jérôme Marant @ 2004-01-08 14:46 UTC (permalink / raw)
To: Albert Cohen; +Cc: caml-list
Quoting Albert Cohen <Albert.Cohen@inria.fr>:
> On Thu, Jan 08, 2004 at 05:09:30AM +0300, Kamil Shakirov wrote:
>
> > I meant `folding' --- hiding parts of the edited program. Probably you
> > did not understand me because my english is not good. ;)
> >
> > Anyway, thank you for your answer.
> >
> > I have found similar minor edit mode (hideshow.el, hs-minor-mode for
> > block hiding and showing) but it is for c-mode. It would be nice
> > implement this in tuareg mode.
>
> Thanks for the suggestion, I'll take a look to hideshow.el to see
> if it can be customized and reused within Tuareg.
There's also a folding.el mode around, which is not bad at all.
--
Jérôme Marant
-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [Caml-list] Tuareg
2004-01-08 14:46 ` Jérôme Marant
@ 2004-01-09 7:27 ` Kamil Shakirov
0 siblings, 0 replies; 7+ messages in thread
From: Kamil Shakirov @ 2004-01-09 7:27 UTC (permalink / raw)
To: Jérôme Marant; +Cc: caml-list
Hello JИrТme,
JИrТme Marant <jmarant@free.fr> writes:
>> > I meant `folding' --- hiding parts of the edited program. Probably you
>> > did not understand me because my english is not good. ;)
>> >
>> > Anyway, thank you for your answer.
>> >
>> > I have found similar minor edit mode (hideshow.el, hs-minor-mode for
>> > block hiding and showing) but it is for c-mode. It would be nice
>> > implement this in tuareg mode.
>>
>> Thanks for the suggestion, I'll take a look to hideshow.el to see
>> if it can be customized and reused within Tuareg.
>
> There's also a folding.el mode around, which is not bad at all.
I know about this minor mode. But I want to hide only a body of
function except a header (let binding).
This is note from the folding.el file:
;; Please note, that the maintainers do not recommend to use only
;; folding for you your code layout and navigation. Folding.el is on
;; its best when it can "chunk" large sections of code inside
;; folds. The larger the chunks, the more the usability of folding will
;; increase. Folding.el is not meant to hide individual functions: you
;; may be better served by hideshow.el or imenu.el (which can parse
;; the function indexes)
And I agree with above note.
This is my example code with special fold markers:
let foo a b c =
(* {{{ *)
List.iter (fun x -> x*a + x*b + x*c)
(* }}} *)
Folding mode works fine:
let foo a b c =
(* {{{ *) ...
But the code looks ugly. ;)
It would be nice if above code would look like this (when folding
mode is enabled):
let foo a b c = int -> int -> int -> int list -> int list
--
Kamil.
-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [Caml-list] Tuareg
2004-01-07 7:08 ` [Caml-list] Tuareg Christophe TROESTLER
2004-01-08 2:09 ` Kamil Shakirov
@ 2004-01-08 2:18 ` Kamil Shakirov
1 sibling, 0 replies; 7+ messages in thread
From: Kamil Shakirov @ 2004-01-08 2:18 UTC (permalink / raw)
To: Christophe.Troestler; +Cc: caml-list
Hello Christophe,
Christophe TROESTLER <ipcastillon@prodigy.net.mx> writes:
>> let complex_function arg1 arg2 ... =
>> let fun_aux1 arg1 arg2 ... =
>> bla bla bla
>> in
>> [...]
>> fun_aux3 arg2
>> (fun_aux2 (fun_aux arg1 arg2) arg1)
>
> Include in your ~/.emacs the following :
>
> (add-hook 'tuareg-mode-hook
> (function
> (lambda ()
> (setq tuareg-in-indent 0)
> (setq tuareg-let-always-indent t)
> (setq tuareg-let-indent 2)
> (setq tuareg-with-indent 0)
> (setq tuareg-function-indent 0)
> (setq tuareg-fun-indent 0)
> (setq tuareg-parse-indent 0)
> (setq tuareg-parser-indent 0)
> (setq tuareg-match-indent 0)
> (setq tuareg-begin-indent 2)
> )))
I meant `folding' --- hiding parts of the edited program. Probably you
did not understand me because my english is not good. ;)
Anyway, thank you for your answer.
I have found similar minor edit mode (hideshow.el, hs-minor-mode for
block hiding and showing) but it is for the c-mode. It would be nice
to implement this in the tuareg mode.
> Happy new year!
Thanks. Same to you. ;)
--
Kamil.
-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2004-01-09 7:21 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-01-05 20:00 [Caml-list] q Kamil Shakirov
2004-01-07 7:08 ` [Caml-list] Tuareg Christophe TROESTLER
2004-01-08 2:09 ` Kamil Shakirov
2004-01-08 14:13 ` Albert Cohen
2004-01-08 14:46 ` Jérôme Marant
2004-01-09 7:27 ` Kamil Shakirov
2004-01-08 2:18 ` Kamil Shakirov
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox