ocaml-opam / opam-user-setup

Simplify the configuration of editors for using OCaml tools
Other
81 stars 12 forks source link

tuareg bug on another switch #15

Open Drup opened 9 years ago

Drup commented 9 years ago

tuareg is on another switch. When I press ]

command-execute: Symbol's function definition is void: tuareg-electric-rb

The problem disappear if I install tuareg in the switch.

AltGr commented 9 years ago

Hm... in the from-a-different-switch case, we can't add the whole elisp dir to load-path as some files there aren't suitable, so I am doing the tuareg load somewhat manually:

  (provide 'tuareg_indent) ;; to prevent circular dependency
  (autoload 'tuareg-make-indentation-regexps "/home/lg/.opam/4.02.1/share/emacs/site-lisp/tuareg_indent"
    "Init indentation for OCaml" t nil)
  (autoload 'tuareg-mode "switch/share/emacs/site-lisp/tuareg" "Major mode for editing OCaml code" t nil)
  (autoload 'tuareg-run-ocaml "switch/share/emacs/site-lisp/tuareg" "Run an OCaml toplevel process" t nil)
  (autoload 'ocamldebug "switch/share/emacs/site-lisp/ocamldebug" "Run the OCaml debugger" t nil)

tuareg-electric-rb is defined in tuareg_indent. I thought tuareg-mode always used tuareg-make-indentation-regexps first at startup so it would properly load tuareg-indent, but maybe I was wrong.