 
 (add-hook 'opx2-js-mode-hook 'opx2-js-setup-auto-complete-mode)
 (add-hook 'js-evaluator-mode-hook 'opx2-js-setup-auto-complete-mode)
-
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;;;;; autocomplete configuration
-
-(require 'auto-complete-config)
-(ac-config-default)
-(add-to-list 'ac-modes 'opx2-js-mode)
-(add-to-list 'ac-modes 'js-evaluator-mode)
-(setq ac-use-menu-map t)
-(define-key ac-mode-map (read-kbd-macro "<backtab>") (lambda () (interactive) (ac-trigger-key-command t)))
-(add-to-list 'ac-dictionary-directories (fullpath-relative-to-current-file "../packages/ac-dict"))

;;;; (:require-patch "")
;;;; HISTORY :
;;;; $Log$
;;;; Revision 3.9  2015/05/06 16:24:01  mgautier
;;;; - fix auto-complete in js evaluator mode
;;;;


(ac-define-source "ojs-classes"
    '((candidates . ojs-classes-ac-candidates)
      (symbol . "c ")
      (requires . -1)))

(defvar *ojs-classes-candidates-cache* nil)

;; on reset le cache ds qu'on sauve
;;(ac-clear-variable-after-save '*ojs-classes-candidates-cache*)

;; reset du cache toutes les minutes
;;ac-clear-variable-every-minute '*ojs-functions-candidates-cache*)

(defun ojs-classes-ac-candidates ()
  *ojs-classes-candidates-cache*)

(defun ojs-classes-ac-init ()
  (or *ojs-classes-candidates-cache*
      (setq *ojs-classes-candidates-cache* (when (fi::lep-open-connection-p) 
					     (fi:eval-in-lisp "(when (fboundp 'jvs::list-all-js-classes) (jvs::list-all-js-classes \"[Oo][Pp][Xx][^0-9].*$\"))")))))  

;;; generic ojs dictionary 
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
