Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(wrong-number-of-arguments (1 . 2) 8) #50

Closed
wakamenod opened this issue Nov 27, 2022 · 13 comments
Closed

(wrong-number-of-arguments (1 . 2) 8) #50

wakamenod opened this issue Nov 27, 2022 · 13 comments

Comments

@wakamenod
Copy link

wakamenod commented Nov 27, 2022

Hi, thanks for the great package.

I have a question about this error:

Debugger entered--Lisp error: (wrong-number-of-arguments (1 . 2) 8)
  #f(compiled-function (theme &optional doc) "Declare THEME to be a Custom theme.\nThe optional argument DOC is a doc string describing the theme.\n\nAny theme `foo' should be defined in a file called `foo-theme.el';\nsee `custom-make-theme-feature' for more information." #<bytecode 0x45107dcedbeed62>)(modus-operandi "Elegant, highly legible and customizable light the..." :background-mode 'light :kind 'color-scheme :family 'modus)
  (deftheme modus-operandi "Elegant, highly legible and customizable light the..." :background-mode 'light :kind 'color-scheme :family 'modus)
  (progn (unless (and (fboundp 'require-theme) load-file-name (equal (file-name-directory load-file-name) (expand-file-name "themes/" data-directory)) (require-theme 'modus-themes t)) (require 'modus-themes)) (deftheme modus-operandi "Elegant, highly legible and customizable light the..." :background-mode 'light :kind 'color-scheme :family 'modus) (modus-themes-theme modus-operandi) (provide-theme 'modus-operandi))
  eval((progn (unless (and (fboundp 'require-theme) load-file-name (equal (file-name-directory load-file-name) (expand-file-name "themes/" data-directory)) (require-theme 'modus-themes t)) (require 'modus-themes)) (deftheme modus-operandi "Elegant, highly legible and customizable light the..." :background-mode 'light :kind 'color-scheme :family 'modus) (modus-themes-theme modus-operandi) (provide-theme 'modus-operandi)) t)
  #f(compiled-function (&rest body) "Like `progn', but evaluates the body at compile time and at load time.\nIn interpreted code, this is entirely equivalent to `progn',\nexcept that the value of the expression may be (but is not\nnecessarily) computed at load time if eager macro expansion is\nenabled." #<bytecode 0x28f163835163fd9>)((unless (and (fboundp 'require-theme) load-file-name (equal (file-name-directory load-file-name) (expand-file-name "themes/" data-directory)) (require-theme 'modus-themes t)) (require 'modus-themes)) (deftheme modus-operandi "Elegant, highly legible and customizable light the..." :background-mode 'light :kind 'color-scheme :family 'modus) (modus-themes-theme modus-operandi) (provide-theme 'modus-operandi))
  (eval-and-compile (unless (and (fboundp 'require-theme) load-file-name (equal (file-name-directory load-file-name) (expand-file-name "themes/" data-directory)) (require-theme 'modus-themes t)) (require 'modus-themes)) (deftheme modus-operandi "Elegant, highly legible and customizable light the..." :background-mode 'light :kind 'color-scheme :family 'modus) (modus-themes-theme modus-operandi) (provide-theme 'modus-operandi))

which I encountered when I load the package.
Is there anything I can do to prevent this error?

Emacs Version

GNU Emacs 29.0.50 (build 1, x86_64-w64-mingw32)

OS

Windows 10

modus-them version

modus-themes-20221121.301

init.el

(use-package modus-themes
  :ensure
  :init
  ;; Add all your customizations prior to loading the themes
  (setq modus-themes-italic-constructs t
        modus-themes-bold-constructs nil
        modus-themes-region '(bg-only no-extend))

  ;; Load the theme files before enabling a theme
  (modus-themes-load-themes)
  :config
  ;; Load the theme of your choice:
  (modus-themes-load-vivendi) ;; OR (modus-themes-load-operandi)
  :bind ("<f5>" . modus-themes-toggle))

Others

Possibly related to this commit.

Thanks in advance.

@protesilaos
Copy link
Owner

Hello @wakamenod!

Can you please delete the .elc files of the themes in your elpa directory and then re-install the package?

@wakamenod
Copy link
Author

@protesilaos
Thanks for the reply!

I tired this:

  1. M-x find-file ~/.emacs.d/elpa/modus-themes-20221121.301
  2. delete modus-themes.elc
  3. M-x package-reinstall modus-themes

And then this error messages are written in Compile-Log buffer:


Compiling internal form(s) at Sun Nov 27 14:33:43 2022
Leaving directory ‘c:/Users/wakamenod/.emacs.d/elpa/modus-themes-20221121.301’

Compiling file c:/Users/wakamenod/.emacs.d/elpa/modus-themes-20221121.301/modus-operandi-theme.el at Sun Nov 27 14:33:43 2022
Entering directory ‘c:/Users/wakamenod/.emacs.d/elpa/modus-themes-20221121.301/’
modus-operandi-theme.el:55:1: Error: Wrong number of arguments: (1 . 2), 8

Compiling file c:/Users/wakamenod/.emacs.d/elpa/modus-themes-20221121.301/modus-themes.el at Sun Nov 27 14:33:43 2022

Compiling file c:/Users/wakamenod/.emacs.d/elpa/modus-themes-20221121.301/modus-vivendi-theme.el at Sun Nov 27 14:33:43 2022
modus-vivendi-theme.el:55:1: Error: Wrong number of arguments: (1 . 2), 8

@protesilaos
Copy link
Owner

Thanks for the reply!

You are welcome!

delete modus-themes.elc

Sorry for not clarifying this point: please delete all the .elc files. Those that remained are causing the trouble.

@wakamenod
Copy link
Author

Sorry, I was not sure about all the .elc files you meant.
So I deleted entire elpa directory, and re-install every packages, but still the same problem persists.

@protesilaos
Copy link
Owner

I see. Is your Emacs 29 a recent build from the Git repository? Perhaps you have an older version which does not include the changes that were made to deftheme.

On my end, re-installing the themes does not produce any error.

@wakamenod
Copy link
Author

wakamenod commented Nov 27, 2022

My Emacs version is GNU Emacs 29.0.50.

Although I didn't search what the latest version is,
I guess it's little behind from the latest 29, and that must be the catch.

Will upgrade my Emacs and try again !!

Thanks for the help, really appreciated it.

@protesilaos
Copy link
Owner

Very well! If you do M-x emacs-version it will mention the date it was built. This gives us a rough idea. There is a way to find the exact commit by checking the value of emacs-repository-version.

@wakamenod
Copy link
Author

If you do M-x emacs-version it will mention the date it was built.

Actually this gives me GNU Emacs 29.0.50 (build 1, x86_64-w64-mingw32) 🤔

There is a way to find the exact commit by checking the value of emacs-repository-version.

Oh, never knew that!

emacs-repository-version is a variable defined in version.el.

Value
"48d1e6e9d9217918b68daac9b23140bf8e36c2bf

Also...

emacs-repository-branch is a variable defined in version.el.

Value
"master"

@protesilaos
Copy link
Owner

Okay, I see that the commit you are using is fairly old:

commit 48d1e6e9d9217918b68daac9b23140bf8e36c2bf
Merge: 8ff1a9d00bf f38dfa56a0c
Author: Stefan Kangas <[email protected]>
Date:   Thu Dec 2 17:34:10 2021 +0100

    Merge from origin/emacs-28
    
    f38dfa56a0 ; Update loaddefs files.
    b3d4b18507 ; make change-history-commit
    334ff0232e * lisp/repeat.el: Use same logic for repeat-check-key and ...
    8230a47ecc * lisp/help.el (help--analyze-key): Prefer posn-set-point ...
    
    # Conflicts:
    #       lisp/ldefs-boot.el

If you can rebuild Emacs with a recent commit, the issue will most likely be resolved.

@wakamenod
Copy link
Author

@protesilaos
You are right i"m far behind from the latest....
Sorry my bad...

Closing this issue.

@protesilaos
Copy link
Owner

No worries! Though do tell me if a newer version actually fixes things.

@wakamenod
Copy link
Author

@protesilaos

Fix confirmed with the revision cdb1080ec38dd0f05130c923eee25a2329f57012

Sorry about all the fuss I made 😢

Thanks very much for your help.

@protesilaos
Copy link
Owner

You are welcome!

protesilaos added a commit that referenced this issue Nov 27, 2022
This reverts commit f1cf9a1.

The report in issue 50 on the GitHub mirror made me think that we
should not do this as it is backward incompatible:
<#50>.

Besides, the files already include theme properties in a different
way, per commit 5fee337.
protesilaos added a commit that referenced this issue Nov 27, 2022
This is for wakamenod's report on the GitHub mirror about the bug
caused by commit f1cf9a1:
<#50>.

I have since reverted the offending commit.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants