1

What does this error mean:

Warning (initialization): An error occurred while loading ‘/Users/brandomiranda/.emacs’:

Wrong number of arguments: (3 . 4), 2

To ensure normal operation, you should investigate and remove the
cause of the error in your initialization file.  Start Emacs with
the ‘--debug-init’ option to view a complete error backtrace. Disable showing Disable logging

and how do I fix it?

my ~/.emacs file

(meta_learning) brandomiranda~ ❯ cat .emacs
;; Open .v files with Proof General's Coq mode
(load "~/.emacs.d/lisp/PG/generic/proof-site")

(add-to-list 'load-path "~/.emacs.d/evil")
(require 'evil)
(evil-mode 1)

(eval-after-load "color-theme"
  '(progn
     (color-theme-initialize)
     (color-theme-dusk)
     (when (display-graphic-p)
       ;; settings for GUI emacs
       (add-to-list 'default-frame-alist '(background-color . "#282B35"))
       (add-to-list 'default-frame-alist '(foreground-color . "White"))
       (set-frame-font "Inconsolata 18" nil t))))
(custom-set-variables
 ;; custom-set-variables was added by Custom.
 ;; If you edit it by hand, you could mess it up, so be careful.
 ;; Your init file should contain only one such instance.
 ;; If there is more than one, they won't work right.
 '(ansi-color-faces-vector
   [default default default italic underline success warning error])
 '(ansi-color-names-vector
   ["#242424" "#e5786d" "#95e454" "#cae682" "#8ac6f2" "#333366" "#ccaa8f" "#f6f3e8"])
 '(custom-enabled-themes (quote (wheatgrass))))
(custom-set-faces
 ;; custom-set-faces was added by Custom.
 ;; If you edit it by hand, you could mess it up, so be careful.
 ;; Your init file should contain only one such instance.
 ;; If there is more than one, they won't work right.
 )

(load-file (let ((coding-system-for-read 'utf-8))
                (shell-command-to-string "agda-mode locate")))

but this only happens when I open emacs from terminal?

1
  • Quote the error backtrace in your question.
    – phils
    Commented Apr 14, 2022 at 21:44

1 Answer 1

1

It means that something in your init file invoked a function that expected 3 or 4 arguments, but it was passed only 2 args.

To find the culprit, bisect your init file: comment out 1/2, then 3/4, 7/8, 15/16,..., narrowing it by half each time. You can use command comment-region to comment out a selection of text (the region). And with a prefix arg the same command uncomments the region.

Once you find the bit of code in your init file that's responsible, you can post another question about why that code is problematic, if it's not obvious. The first step is finding what causes the problem. The second step is fixing it.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.