When I byte compile an elisp file via emacs -batch -f batch-byte-compile I get Warning: load-theme called with 2 arguments, but accepts only 1. The code in question:

(load-theme 'solarized-light t)

The source in Emacs 25.1's custom.el: (defun load-theme (theme &optional no-confirm no-enable) ...

Similarly I get set-frame-font called with 3 arguments, but accepts only 1-2 when set-frame-font's help says: (set-frame-font FONT &optional KEEP-SIZE FRAMES)

Which is confused, the byte compiler or I; and why?

  • 2
    I created a one line file with your first example in it. It compiled without a hiccup. There must be something more going on here. I don't think anyone can help without a little more detail. – Harald Hanche-Olsen Oct 2 '16 at 16:46

A guess would be that you are byte-compiling in an older Emacs version, which does not support the additional arguments.

For example, if you byte-compile with Emacs 23 then you will get such warnings, because those args are not supported.

  • Nope; this is in Emacs 25.1. This was happening in Emacs 24 too and I just ignored it then. But as long as I upgraded / was pruning my emacs initialization I thought I'd ask. Given @harald's comment I guess I am going to have to dig deeper. – jwd630 Oct 2 '16 at 17:45
  • Do you see the bad behavior when you start Emacs using emacs -Q (no init file? If so, consider reporting a bug, providing a step-by-step recipe: M-x report-emacs -bug. If not, recursively bisect your init file to find the part that causes the problem. You can use command comment-region to comment out 1/2, then 3/4, 7/8,... of the file. Use C-u with the command to uncomment the region. – Drew Oct 2 '16 at 20:08
  • Well, this was happening in my init file, which through decades of habit I byte compile. – jwd630 Oct 3 '16 at 0:55
  • Actually in what my init file would normally contain, which through decades of habit I byte compile and keep in a separate file while my actual init file just loads that file.) I 'fixed' the issue by simply removing the problematic lines that were related to old, pre-custom cruft anyway.) If I discover the actual cause I'll post that here. – jwd630 Oct 3 '16 at 1:02
  • Bingo........... – Drew Oct 3 '16 at 3:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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