caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [Caml-list] Taglet 1.2
@ 2003-08-27  6:17 Issac Trotts
  2003-08-27 11:20 ` Hendrik Tews
  0 siblings, 1 reply; 3+ messages in thread
From: Issac Trotts @ 2003-08-27  6:17 UTC (permalink / raw)
  To: caml-list

Here's another revision.  Enjoy!


Changes for version 1.2:

o Handling of .ml files having no .mli counterparts
o Handling of files containing no lines without slashes


 From the README:


Why write another tagger?
=========================


  Taglet makes a tag file that just lists all the .mli files, which
  reduces the number of redundant tags and helps you get the
  documentation you want more quickly without having to dig through a
  bunch of identical tags.


  With otags, if I want to look up List.map, I put my cursor over
  "map", press ctrl-], and look through a bunch of other map functions
  until I find the one I want.  With Taglet, I put my cursor over
  "List", press ctrl-], and am immediately in list.mli.  Then I search
  for "map" in list.mli.  Often, if the .mli file is short, I can find
  what I need without having to page down.


Why not just add Taglet's functionality to an existing tagger?
==============================================================


  Taglet is tiny and is useful alone, so it's nice to have it as a
  separate program.  I would like add its functionality to otags, but I
  haven't yet figured out how to do it.  Even if I do, Taglet will still
  be useful and easy to understand on its own.


Issac Trotts



-------------------
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] 3+ messages in thread

* Re: [Caml-list] Taglet 1.2
  2003-08-27  6:17 [Caml-list] Taglet 1.2 Issac Trotts
@ 2003-08-27 11:20 ` Hendrik Tews
  2003-08-27 17:40   ` Issac Trotts
  0 siblings, 1 reply; 3+ messages in thread
From: Hendrik Tews @ 2003-08-27 11:20 UTC (permalink / raw)
  To: caml-list

[-- Attachment #1: message body text --]
[-- Type: text/plain, Size: 949 bytes --]

Issac Trotts writes:

     Taglet makes a tag file that just lists all the .mli files, which
     reduces the number of redundant tags and helps you get the

I agree that the redundent tags for *mli files could be annoying.
However, with emacs I just hit M-, to cycle through all matching
tags. So maybe you only need a key binding for :tn<CR> ??

     I would like add its functionality to otags, but I
     haven't yet figured out how to do it.  Even if I do, Taglet will still
     be useful and easy to understand on its own.

Otags' architecture is a bit complicated, it does not really
invite the uninitiated for hacking. To add your wishes to otags
you have to:

- add an option to the driver in otags.ml
- arrange that the new option will passed to camlp4
- declare the option in one of the camlp4 modules 
- program your wishes

There is a patch below with the necessary changes. The name of
the option is -mli-only-module.

Bye,

Hendrik


[-- Attachment #2: patch --]
[-- Type: text/plain, Size: 3191 bytes --]

Index: otags.ml
===================================================================
RCS file: /sun/theorie/tews/Privat/Store/Otags/otags.ml,v
retrieving revision 1.1.1.6
diff -c -r1.1.1.6 otags.ml
*** otags.ml	27 Aug 2003 07:49:39 -0000	1.1.1.6
--- otags.ml	27 Aug 2003 08:23:42 -0000
***************
*** 36,42 ****
  end
  
  (* Parsing arguments *)
! let verbose, output, recursive, editor, targets, suffixes, camlp4, parsers, with_quotations = 
    let rverbose = ref false in
    let routput = ref "" in
    let rrecursive = ref false in
--- 36,42 ----
  end
  
  (* Parsing arguments *)
! let verbose, output, recursive, editor, targets, suffixes, camlp4, parsers, with_quotations, mli_only_module = 
    let rverbose = ref false in
    let routput = ref "" in
    let rrecursive = ref false in
***************
*** 53,58 ****
--- 53,60 ----
    
    let rquotation = ref false in
  
+   let rmli_only_module = ref false in
+ 
    let usage = [
      ("-v", Arg.Set rverbose, "            verbose, display debug messages");
      ("-o", Arg.String ((:=) routput), "<str>       output tags file (default: TAGS) (use - for standard output)");
***************
*** 66,71 ****
--- 68,75 ----
      ("-camlp4", Arg.String ((:=) rcamlp4), "<str>  camlp4 command (default: camlp4)");
      ("-pa", Arg.String add_parser, "<str>      add camlp4 parser (default: pa_o.cmo; pa_op.cmo)");
      ("-q", Arg.Set rquotation, "            accept quotations in input");
+     ("-mli-only-module", Arg.Set rmli_only_module, 
+      "            generate only the module tag for interfaces");
      ("-version", Arg.Unit print_version, "      display otags version number");
    ] in
    Arg.parse usage add_target "Available commands:";
***************
*** 81,91 ****
       else
          !routput in
    !rverbose, output, !rrecursive, !reditor, 
!   targets (), Suffix.contents (), !rcamlp4, parsers, !rquotation
  
  let camlp4_libs pr_tags = parsers @ [ pr_tags ]
  
! let camlp4_options () = if with_quotations then ["-with-quotations"] else []
  
  let debug prog args ofile =
    if verbose then begin
--- 85,99 ----
       else
          !routput in
    !rverbose, output, !rrecursive, !reditor, 
!   targets (), Suffix.contents (), !rcamlp4, parsers, !rquotation, 
!   !rmli_only_module
  
  let camlp4_libs pr_tags = parsers @ [ pr_tags ]
  
! let camlp4_options () = 
!   (if with_quotations then ["-with-quotations"] else [])
!   @
!   (if mli_only_module then ["-mli-only-module"] else [])
  
  let debug prog args ofile =
    if verbose then begin
Index: pr.ml
===================================================================
RCS file: /sun/theorie/tews/Privat/Store/Otags/pr.ml,v
retrieving revision 1.1.1.5
diff -c -r1.1.1.5 pr.ml
*** pr.ml	27 Aug 2003 07:49:39 -0000	1.1.1.5
--- pr.ml	27 Aug 2003 08:50:02 -0000
***************
*** 198,203 ****
--- 198,207 ----
  let _ = Plexer.no_quotations := true
  let _ = Pcaml.add_option "-with-quotations"
            (Arg.Clear Plexer.no_quotations) "Enable quotation parsing"
+ 
+ let _ = Pcaml.add_option "-mli-only-module"
+ 	  (Arg.Unit (fun () -> Pcaml.print_interf := (fun _ -> ())))
+ 	  "do not process interface content"
  
  end
  

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Caml-list] Taglet 1.2
  2003-08-27 11:20 ` Hendrik Tews
@ 2003-08-27 17:40   ` Issac Trotts
  0 siblings, 0 replies; 3+ messages in thread
From: Issac Trotts @ 2003-08-27 17:40 UTC (permalink / raw)
  To: Hendrik Tews, caml-list

Hendrik Tews wrote:

>I agree that the redundent tags for *mli files could be annoying.
>However, with emacs I just hit M-, to cycle through all matching
>tags. So maybe you only need a key binding for :tn<CR> ??
>
Well, I'm sure your idea will help, but I prefer to go directly to the 
file without having to cycle through anything.  It's a matter of taste.

>     I would like add its functionality to otags, but I
>     haven't yet figured out how to do it.  Even if I do, Taglet will still
>     be useful and easy to understand on its own.
>
>Otags' architecture is a bit complicated, it does not really
>invite the uninitiated for hacking. To add your wishes to otags
>you have to:
>
>- add an option to the driver in otags.ml
>- arrange that the new option will passed to camlp4
>- declare the option in one of the camlp4 modules 
>- program your wishes
>
>There is a patch below with the necessary changes. The name of
>the option is -mli-only-module.
>
>Bye,
>
>Hendrik
>

This is nice.  Thank you for this patch and the other one you sent.


- ijt




-------------------
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] 3+ messages in thread

end of thread, other threads:[~2003-08-27 17:43 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-08-27  6:17 [Caml-list] Taglet 1.2 Issac Trotts
2003-08-27 11:20 ` Hendrik Tews
2003-08-27 17:40   ` Issac Trotts

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).