Closed jinwei233 closed 12 years ago
This would actually be an issue with auto-complete-mode. I'm going to see if there's an easy way to patch this in js3-mode or otherwise provide instructions.
@WeweTom I'm not sure if this would necessarily work, but did you try adding this to your .emacs:
(custom-add-frequent-value 'ac-modes 'js3-mode)
If that doesn't work, then this should do it:
(custom-set-variables '(ac-modes
'(emacs-lisp-mode lisp-interaction-mode
c-mode cc-mode c++-mode java-mode
perl-mode cperl-mode python-mode ruby-mode
ecmascript-mode javascript-mode js2-mode js3-mode php-mode css-mode
makefile-mode sh-mode fortran-mode f90-mode ada-mode
xml-mode sgml-mode)))
Since it's a defcustom, the value of ac-modes is easy to override, but it would be annoying if you had to specify the whole thing to change it. But as a limiting case, that's still better than editing the source of auto-complete.el
.
Verified: the above custom-set-variables
works. Remember to only have one custom-set-variables
declaration in your emacs config.
custom-add-frequent-value
and custom-set-variables
did not worked on my env but (add-to-list 'ac-modes 'js3-mode)
worked.
@take-cheeze Thanks for the update!
I tried all three and still can't see the "dropdown" or the completion that auto-complete provides in other major modes. Here's my configuration right now:
;; ---------------------------------------------------------------------- ;; Automatic completion, suggestions, and snippet expansion. ;;---------------------------------------------------------------------- ;; Directory paths. (setq goog/ac-dict-dir-local (concat config-dir "auto-complete/dict")) (setq goog/snippets-dir (concat config-dir "snippets"))
(require 'yasnippet) (setq yas/snippet-dirs '("~/.emacs.d/snippets")) (yas/initialize) (yas/load-directory "~/.emacs.d/snippets") (yas/global-mode 1)
(require 'auto-complete) (require 'auto-complete-config) (add-to-list 'ac-dictionary-directories goog/ac-dict-dir-local) (ac-config-default) (global-auto-complete-mode t) (setq ac-ignore-case 'smart) ;; (setq ac-use-fuzzy t) ;; (setq ac-fuzzy-enable t) ;; Don't use tab to cycle. It's irritating. (define-key ac-completing-map "\t" 'ac-complete) (setq-default ac-sources (add-to-list 'ac-sources 'ac-source-dictionary))
;; Additional modes that need to have autocomplete. (add-to-list 'ac-sources 'ac-source-yasnippet) (add-to-list 'ac-modes 'js3-mode)
What do you suggest I should do?
@gorakhargosh (setq-default ac-auto-start t)
is the only difference I can find.
when u use js3-mode , auto-complete-mode is defautl turned off so I changed auto-complete.el at line 187 FROM: ecmascript-mode javascript-mode js-mode js2-mode php-mode css-mode
TO: ecmascript-mode javascript-mode js-mode js2-mode js3-mode php-mode css-mode