camlspotter avatar camlspotter committed 61596af Merge

merged with 4.00.0.2.0.1

Comments (0)

Files changed (13)

 0000000000000000000000000000000000000000 opam-4.00.0.2.0.1
 0000000000000000000000000000000000000000 opam-4.00.0.2.0.1
 4179d544038e0a2380632355aa85a8b9373ed183 opam-4.00.0.2.0.1
+4179d544038e0a2380632355aa85a8b9373ed183 opam-4.00.0.2.0.1
+0000000000000000000000000000000000000000 opam-4.00.0.2.0.1
 #######################################################################
 
 
-OCAMLDIR=$(PREFIX)/lib/ocaml/
+OCAMLDIR=$(shell ocamlc -where)
 include $(OCAMLDIR)/Makefile.config
 
 # Various commands and dir
   "OCamlSpotter: find the definition and type of variables."
   :group 'languages)
 
-(defcustom ocamlspot-command "OCAML-SOURCE-TREE/ocamlspot/ocamlspot"
+(defcustom ocamlspot-command "ocamlspot"
   "*The command which invokes ocamlspot."
   :type 'string :group 'ocamlspot)
 
   "*Turn on ocamlspot debug output."
   :type 'boolean :group 'ocamlspot)
 
+(defcustom ocamlspot-samewindow t
+  "Use current window to show the spot."
+  :type 'boolean :group 'ocamlspot)
+
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Constants
 
 ;; Buffer names
 ;; Open the file, if exists
 (defun ocamlspot-find-file-existing (path)
   (if (file-exists-p path)
-      (find-file-other-window path)
+      (if ocamlspot-samewindow
+          (find-file path)
+        (find-file-other-window path))
     (ocamlspot-message-add (format "ERROR: source file %s was not found" path))
     (error (format "ERROR: source file %s was not found" path))))
 
   (ocamlspot-message-display may-pop)
   (ocamlspot-delete-overlays))
 
-(defun ocamlspot-query (&optional args)
+(defun ocamlspot-query (&rest args)
   (interactive)
   (let ((sel-window (selected-window)))
   (save-selected-window
     (ocamlspot-message-init (buffer-file-name))
     (ocamlspot-type-init)
     (ocamlspot-delete-overlays-now)
-    (ocamlspot-query-at-cursor '("use" dir))
+    (ocamlspot-query-at-cursor (list "use" dir))
     (if (ocamlspot-find-tree)
 	(progn
 	 (ocamlspot-find-spot)

opam/ocamlspot.4.00.0.2.0.1/descr

 OCamlSpotter 2.x uses \*.cmt and \*.cmti files created by OCaml compiler 4.00.0 or newer with -bin-annot option.
 
 Unlike OCamlSpotter 1.x, OCamlSpotter 2.x is a standalone application. You NO LONGER need compiler patching. Just make, make install, and configure ocamlspot.el.
+
+In OPAM, ocamlspot.el and ocamlspot.vim is %{lib%}/ocamlspot .

opam/ocamlspot.4.00.0.2.0.1/opam

 opam-version: "1"
 maintainer: "jun.furuse@gmail.com"
 build: [
-  ["%{make}%" "all" "opt" "install" "BINDIR=%{bin}%" "EMACSDIR=%{lib}%/ocamlspot"]
+  ["%{make}%" "all" "opt" "install" "BINDIR=%{bin}%" "EMACSDIR=%{lib}%/ocamlspot" "PREFIX=%{prefix}%"]
+  ["cp" "ocamlspot.vim" "%{lib}%/ocamlspot"]
 ]
 remove: [
-  ["%{make}%" "uninstall" "BINDIR=%{bin}%"]
+  ["%{make}%" "uninstall" "BINDIR=%{bin}%" "PREFIX=%{prefix}%"]
   ["rm" "-rf" "%{lib}%/ocamlspot"]
 ]
-depends: ["compiler-libs"]
-ocaml-version: [= "4.00.0"]
+(* It is known to work with 4.00.1+dev3 too *)
+ocaml-version: [>= "4.00.0"]

opam/ocamlspot.4.00.0.2.0.1/url

-archive: "https://bitbucket.org/camlspotter/ocamlspot/get/opam-4.00.0.2.0.1.tar.gz"
+archive: "https://bitbucket.org/camlspotter/ocamlspot/get/4.00.0.2.0.1.tar.gz"

opam/template/descr

+OCamlSpotter - OCaml source browsing
+OCamlSpotter is a tool for OCaml source code browsing. 
+
+* You can search the definitions of names of values, functions, data types and modules.
+* Emacs and Vim helpers help your browsing via editors.
+* Definition search traverses module aliases and functor applications: if module M = N, OCamlSpotter automatically seeks the definition of M.x in N. Very helpful in the modern OCaml programming with lots of modules.
+
+OCamlSpotter 2.x uses \*.cmt and \*.cmti files created by OCaml compiler 4.00.0 or newer with -bin-annot option.
+
+Unlike OCamlSpotter 1.x, OCamlSpotter 2.x is a standalone application. You NO LONGER need compiler patching. Just make, make install, and configure ocamlspot.el.
+
+In OPAM, ocamlspot.el and ocamlspot.vim is %{lib%}/ocamlspot .

opam/template/opam

+opam-version: "1"
+maintainer: "jun.furuse@gmail.com"
+build: [
+  ["%{make}%" "all" "opt" "install" "BINDIR=%{bin}%" "EMACSDIR=%{lib}%/ocamlspot" "PREFIX=%{prefix}%"]
+  ["cp" "ocamlspot.vim" "%{lib}%/ocamlspot"]
+]
+remove: [
+  ["%{make}%" "uninstall" "BINDIR=%{bin}%" "PREFIX=%{prefix}%"]
+  ["rm" "-rf" "%{lib}%/ocamlspot"]
+]
+(* It is known to work with 4.00.1+dev3 too *)
+ocaml-version: [>= "4.00.0"]
 
   let aliases_of_include' no_value_is_not_in_ids sg ids =
     (* We cannot use kind directly since it does not distinguish normal values and primitives *)
-    Debug.format "@[<2>DEBUG alias: ids=[ @[%a@] ]@ + sg=[ @[%a@] ]@]@."
+    Debug.format "@[<2>DEBUG alias_of_include': ids=[ @[%a@] ]@ + sg=[ @[%a@] ]@]@."
       (Format.list ";@ " Ident.format) ids
       (Format.list ";@ " (fun ppf (k, id) -> Format.fprintf ppf "%s:%a" (Kind.name k) Ident.format id)) (List.map T.kident_of_sigitem sg);
     let must_be_empty, res = List.fold_left (fun (ids, res) sitem ->

tests/Makefile.targets

 include_sig.cmi \
 included.cmo \
 included_and_flat.cmo \
+included_const.cmo \
+included_const2.cmo \
 included_sig.cmi \
 included_sig2.cmo \
 included_value.cmo \
 override_x.cmo \
 packed.cmo \
 packed_alias.cmo \
+partial.cmo \
 pathname.cmo \
 perv.cmo \
+predef.cmo \
 primitive.cmo \
 recmodule.cmo \
 record.cmo \

tests/included_const.ml

+module A = struct
+  type t = (* T => *) T (* <= T *)
+end
+
+module F(X: sig end) = struct
+  include A
+end
+
+module FX =  F(struct end)
+
+module B = struct
+  include FX
+  let x = T
+end

tests/included_const2.ml

+open Included_const
+
+module FX =  F(struct end)
+
+module B = struct
+  include FX
+  let x = T (* ? T *) (* CR jfuruse: BUG here *)
+end
+let foo = 12345
+let bar = this_is_unbound
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.