title: Emacs - Company: An error occurred in auto-begin Invalid function
body: <p>I'm working in a fresh configuration of GNU Emacs 24.3.1. I want to use emacs-eclim with company. Company works correctly, but if I open a java file, it stops working correctly, yelling this error message:
  </p>
  
  <pre><code>Company: An error occurred in auto-begin 
  Invalid function: (java-mode javascript-mode js-mode ruby-mode php-mode c-mode c++-mode)
  </code></pre>
  
  <p>my Emacs configuration:
  </p>
  
  <pre><code>(require 'iso-transl)
  (require 'recentf)
  (require 'recentf-ext)
  (require 'eclim)
  (require 'company-emacs-eclim)
  (require 'eclimd)
  </code></pre>
  
  <p>and my hooks:
  </p>
  
  <pre><code>(add-hook 'after-init-hook
        (lambda ()
           (iswitchb-mode)
           (helm-mode 1)
           (auto-indent-global-mode)
           (toggle-diredp-find-file-reuse-dir 1)
           (recentf-mode 1)
           (global-flycheck-mode)
           (auto-indent-global-mode)
           (autopair-global-mode)
           (projectile-global-mode)
           (global-pretty-mode)
           (global-eclim-mode)
           (global-company-mode t)
           (yas-global-mode 1)))
  
  (add-hook 'java-mode-hook
        (lambda ()
          (company-emacs-eclim-setup)
          (help-at-pt-set-timer)
          ))
  </code></pre>
  
  <p>These are the packages I have installed, via the Emacs package manager:</p>
  
  <p>ace-jump-mode, auto-indent-mode, autopair, company, dash, dired+, emacs-eclim, epl, f, flycheck, fringe-helper, helm, helm-company, helm-flycheck, helm-projectile-all, hexrgb, java-snippets, javadoc-lookup, multi-term, multiple-cursors, pkg-info, powerline, pretty-mode, projectile, recentf-ext, s, sublime-themes, visual-regexp, visual-regexp-steroids, and  yasnippet.</p>
  
  <p>Here is the debug information from Emacs:
  </p>
  
  <pre><code>Debugger entered--Lisp error: (invalid-function (java-mode javascript-mode js-mode ruby-mode php-mode c-mode c++-mode))
    (java-mode javascript-mode js-mode ruby-mode php-mode c-mode c++-mode)(128)
    eclim-completion-start()
    (let ((start (eclim-completion-start))) (if start (progn (buffer-substring-no-properties start (point)))))
    (cond ((eql command (quote interactive)) (company-begin-backend (quote company-emacs-eclim))) ((eql command (quote prefix)) (let ((start (eclim-completion-start))) (if start (progn (buffer-substring-no-properties start (point)))))) ((eql command (quote candidates)) (company-emacs-eclim--candidates arg)) ((eql command (quote annotation)) (company-emacs-eclim--annotation arg)) ((eql command (quote meta)) (eclim--completion-documentation (concat arg (company-emacs-eclim--annotation arg)))) ((eql command (quote no-cache)) (equal arg "")) ((eql command (quote ignore-case)) t) ((eql command (quote sorted)) t) ((eql command (quote post-completion)) (let ((ann (company-emacs-eclim--annotation arg))) (if ann (progn (insert ann))) (eclim--completion-action))))
    company-emacs-eclim(prefix)
    #[0 "\n\203   [LONG STRING THAT CANNOT BE COPY]
    company--begin-new()
    company-begin()
    #[0 "\300 \207" [company-begin] 1 "\n\n(fn)"]()
    company-auto-begin()
    company-manual-begin()
    company-complete-common()
    call-interactively(company-complete-common record nil)
    command-execute(company-complete-common record)
    execute-extended-command(nil "company-complete-common")
    call-interactively(execute-extended-command nil nil)
  </code></pre>