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: (3 . 3), 2" error #4

Closed
nameiwillforget opened this issue Jan 26, 2023 · 9 comments
Closed

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

nameiwillforget opened this issue Jan 26, 2023 · 9 comments

Comments

@nameiwillforget
Copy link

After creating the mu4easy-contexts in .emacs, I get the error "Wrong number of arguments: (3 . 3), 2" relating to the mu4easy-contexts-function. I've created two context-entries for accounts that I successfully synchronized with mbsync, though the error had already appeared when I had three contexts specified, the third being for a gmail account I couldn't synchronize. I've created all the folders specified in the readme, as some were not initialized because no mails were in them. I installed mu4easy through melpa.

@danielfleischer
Copy link
Owner

Let's start with the basics: what are the Emacs and mu4e versions? also, after specifying mu4easy-contexts customization, you need to either run (setq mu4e-contexts (mapcar #'eval mu4easy-contexts)) for them to be evaluated or just restart Emacs.

@nameiwillforget
Copy link
Author

Sorry, I thought if I reply to the mail directly, it would put it into GitHub automatically. Anyway, Emacs version is 28.2, mu4e is 1.8.13. The error comes when I restart emacs. I've tried now the command you sent, but it gives the error "setq: Symbol’s value as variable is void: mu4easy-contexts".

@danielfleischer
Copy link
Owner

It should work with email. Anyways, not sure what's wrong. Do you load the library? how do you call it in your config file?

@nameiwillforget
Copy link
Author

nameiwillforget commented Feb 3, 2023

The entire mu4easy-code currently in the file consists of the following:


(use-package mu4easy
  :ensure t
  :bind ("C-c u" . mu4e)
  :config (mu4easy-mode))

(defcustom mu4easy-contexts
        
       ((mu4easy-context
          :c-name  "gmx"
          :maildir "gmx"
          :mail    "***"
          :smtp    "mail.gmx.com")
        
        ,(mu4easy-context
          :c-name    "proton"
          :maildir   "proton"
          :mail      "***"
          :smtp      "127.0.0.1"
          :smtp-type ssl
          :smtp-port 1025)
        ))
        

@danielfleischer
Copy link
Owner

Ok, that's not the right way to define a custom variable that was already defined. Either do

(custom-set-variables '(mu4easy-contexts
                        '((mu4easy-context
                           :c-name  "gmx"
                           :maildir "gmx"
                           :mail    "***"
                           :smtp    "mail.gmx.com")
                          
                          (mu4easy-context
                           :c-name    "proton"
                           :maildir   "proton"
                           :mail      "***"
                           :smtp      "127.0.0.1"
                           :smtp-type ssl
                           :smtp-port 1025))))

Or use the :custom keyword of use-package:

(use-package mu4easy
  :ensure t
  :bind ("C-c u" . mu4e)
  :config (mu4easy-mode)
  :custom
  (mu4easy-contexts ((mu4easy-context
                      :c-name  "gmx"
                      :maildir "gmx"
                      :mail    "***"
                      :smtp    "mail.gmx.com")
                     
                     (mu4easy-context
                      :c-name    "proton"
                      :maildir   "proton"
                      :mail      "***"
                      :smtp      "127.0.0.1"
                      :smtp-type ssl
                      :smtp-port 1025))))

@danielfleischer
Copy link
Owner

Fixed the README thanks to your comment.

@nameiwillforget
Copy link
Author

nameiwillforget commented Feb 7, 2023

Thanks, but it still doesn't work. If I try the following configuration:

(use-package mu4easy
  :ensure t
  :bind ("C-c u" . mu4e)
  :config (mu4easy-mode))

(custom-set-variables '(mu4easy-contexts
                        '((mu4easy-context
                           :c-name  "gmx"
                           :maildir "gmx"
                           :mail    "***"
                           :smtp    "mail.gmx.com")
                          
                          (mu4easy-context
                           :c-name    "proton"
                           :maildir   "proton"
                           :mail      "***"
                           :smtp      "127.0.0.1"
                           :smtp-type ssl
                           :smtp-port 1025))))

and type C-c u, it doesn't start mu4easy-mode, and if I try to start it manually, it says

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

and if I try

(use-package mu4easy
  :ensure t
  :bind ("C-c u" . mu4e)
  :config (mu4easy-mode)
  :custom
  (mu4easy-contexts ((mu4easy-context
                      :c-name  "gmx"
                      :maildir "gmx"
                      :mail    "***"
                      :smtp    "mail.gmx.com")
                     
                     (mu4easy-context
                      :c-name    "proton"
                      :maildir   "proton"
                      :mail      "***"
                      :smtp      "127.0.0.1"
                      :smtp-type ssl
                      :smtp-port 1025))))

and try to start mu4easy-mode, I get

eval: Invalid function: (mu4easy-context :c-name "gmx" :maildir "gmx" :mail "***" :smtp "mail.gmx.com")

Interestingly, if I run mu4easy-update-mail-and-index, it does that. But if I try to change contexts in mu4e, it says no contexts are defined.

@danielfleischer
Copy link
Owner

Hi, try to add :demand t to the use-package command (e.g. after the :ensure t); there's some lazy loading here I need to solve. I might modify this in the future, but in the meantime this should fix it.

@danielfleischer
Copy link
Owner

Also try this:

(use-package mu4easy
  :ensure t
  :bind ("C-c u" . mu4e)
  :config (mu4easy-mode)
  :custom
  (mu4easy-contexts '((mu4easy-context
                      :c-name  "gmx"
                      :maildir "gmx"
                      :mail    "***"
                      :smtp    "mail.gmx.com")
                     
                     (mu4easy-context
                      :c-name    "proton"
                      :maildir   "proton"
                      :mail      "***"
                      :smtp      "127.0.0.1"
                      :smtp-type ssl
                      :smtp-port 1025))))

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