In fact there is another source of lag on osx, syntax highlighting.  

https://github.com/OCamlPro/typerex/issues/2#issuecomment-4537263

I just use ocaml's emacs-mode for that, see the full dump of my config below,

Best,

Daniel


;; Typerex mode
;; Loading TypeRex mode for OCaml files
(add-to-list 'load-path "/Users/dbuenzli/.emacs.d")
(add-to-list 'auto-mode-alist '("\\.ml[iylp]?" . typerex-mode))
(add-to-list 'interpreter-mode-alist '("ocamlrun" . typerex-mode))
(add-to-list 'interpreter-mode-alist '("ocaml" . typerex-mode))
(autoload 'typerex-mode "typerex" "Major mode for editing Caml code" t)

;; TypeRex mode configuration
(setq ocp-server-command "/usr/local/bin/ocp-wizard")
(setq-default indent-tabs-mode nil)
(setq ocp-auto-complete t)
;(setq ocp-theme "caml_like")
;(setq ocp-syntax-coloring t)

;; Work around slow syntax highligthing.
(setq ocp-syntax-coloring nil)
(setq load-path (cons "~/.emacs.d/caml-mode" load-path))
(if window-system (require 'caml-font))
(add-hook 'typerex-mode-hook 'caml-font-set-font-lock)

; OCaml identing style
;(setq typerex-in-indent 0)
(setq typerex-let-always-indent nil)
(setq typerex-with-indent 0)
(setq typerex-function-indent 0)
(setq typerex-fun-indent 0)
(setq typerex-type-indent 0)
(setq typerex-if-then-else-indent 0)














Le mardi, 8 mai 2012 à 13:10, Daniel Bünzli a écrit :

> > Is it just me or is there a significant lag when using TypeRex in Emacs?
> >  
> > This is particularly noticeable when deleting by using the backspace key.
>  
> Here, the lag was due to auto complete mode. Don't invoke it automatically. 
> That's what I have :  
>  
> (add-to-list 'load-path "/Users/dbuenzli/.emacs.d/auto-complete-mode")
> (require 'auto-complete-config)
> (add-to-list 'ac-dictionary-directories  
> "/Users/dbuenzli/.emacs.d/auto-complete-mode/ac-dict")
> (ac-config-default)
> (global-set-key (kbd "S-<tab>") 'auto-complete)
> (setq ac-auto-start nil)
> ;;;; I want immediate menu pop-up
> ;;(setq ac-auto-show-menu 0.)
> ;;;; Short delay before showing help
> ;;(setq ac-quick-help-delay 0.3)
> ;;;; Number of characters required to start (nil to disable)
> ;;(setq ac-auto-start 0)
>  
>  
>  
> Best,
>  
> Daniel
>  
> --  
> Caml-list mailing list. Subscription management and archives:
> https://sympa-roc.inria.fr/wws/info/caml-list
> Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
> Bug reports: http://caml.inria.fr/bin/caml-bugs





-- 
Caml-list mailing list.  Subscription management and archives:
https://sympa-roc.inria.fr/wws/info/caml-list
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
Bug reports: http://caml.inria.fr/bin/caml-bugs

Reply via email to