company-irony causing file mode specification error

297 Views Asked by At

I have my ~/.emacs setup like this

; Package setup
(require 'package)
(add-to-list 'package-archives (cons "melpa" "https://melpa.org/packages/") t)

(package-initialize)

; Define all my packages as a list to make it easier to maintain
(setq pkg-list
      (list
       'evil
       'gruvbox-theme
       'powerline
       'use-package
       'flycheck
       'company
       'irony
       'company-irony
      )
)

; For all packages, install it if it's not already installed
(dolist (pkg pkg-list)
  (unless (package-installed-p pkg)
    (package-install pkg)))

; Enable evil-mode
(require 'evil)
(evil-mode 1)

; Gruvbox theme
(require 'gruvbox-theme)
(load-theme 'gruvbox-dark-hard t)

; Powerline theme
(require 'powerline)
(powerline-center-evil-theme)

; use-package
(require 'use-package)

(use-package company
  :hook ((c-mode . company-mode)
     (c++-mode . company-mode)
     (c-or-c++-mode . company-mode)))

(use-package irony
  :hook ((c-mode . irony-mode)
     (c++-mode . irony-mode)
     (c-or-c++-mode . irony-mode))
  :config
  (add-hook 'irony-mode-hook 'irony-cdb-autosetup-compile-options))

(use-package company-irony
  :hook irony-mode
  :config
  (require 'company)
  (add-to-list 'company-backends 'company-irony)
)

; Disable menubar and toolbar and scrollbar
(menu-bar-mode 0)
(tool-bar-mode 0)
(toggle-scroll-bar -1)

; disable splash screen
(setq inhibit-startup-message t)
(setq initial-scratch-message nil)

; disable adding newline to end of file upon saving
(setq require-final-newline nil)

; send backup fils to ~/.enacs subdir
(setq backup-directory-alist
      `((".*" . "~/.emacs/backups")))

; Make sure "custom" stuff goes elsewhere
(setq custom-file "~/.emacs.d/custom.el")
(load custom-file :noerror)

Upon loading a C/C++ file I get the following error in the minibuffer File mode specification error: (wrong-number-of-arguments (1 . 2) 0)

This error only occurs when opening a C/C++ file.

Through using the built-in emacs debugger I was able to track the error down to company-irony() but I can't figure out what is actually causing the error

Here is the debugger backtrace:

Debugger entered--Lisp error: (wrong-number-of-arguments (1 . 2) 0)
  company-irony()
  run-hooks(irony-mode-hook irony-mode-on-hook)
  irony-mode()
  run-hooks(change-major-mode-after-body-hook prog-mode-hook c-mode-common-hook c-mode-hook)
  apply(run-hooks (change-major-mode-after-body-hook prog-mode-hook c-mode-common-hook c-mode-hook))
  run-mode-hooks(c-mode-hook)
  c-mode()
  set-auto-mode-0(c-mode nil)
  set-auto-mode()
  normal-mode(t)
  after-find-file(nil t)
  find-file-noselect-1(#<buffer main.c> "~/Development/C/fibonacci/src/main.c" nil nil "~/Development/C/fibonacci/src/main.c" (6817014 2054))
  find-file-noselect("~/Development/C/fibonacci/src/main.c" nil nil t)
  find-file("~/Development/C/fibonacci/src/main.c" t)
  funcall-interactively(find-file "~/Development/C/fibonacci/src/main.c" t)
  call-interactively(find-file nil nil)
  command-execute(find-file)

Please note: I am new to Emacs and not particularly well-versed in Elisp

0

There are 0 best solutions below