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

magit purpose defined by purpose-x-magit can cause error: Wrong number of arguments: (0 . 2), 3 #144

Closed
qleguennec opened this issue Mar 21, 2019 · 2 comments
Labels

Comments

@qleguennec
Copy link

The following configuration gives me the error: Wrong number of arguments: (0 . 2), 3 when I call switch-to-buffer or magit:

(use-package window-purpose
  :demand t
  :config
  (purpose-mode)
  (require 'window-purpose-x)

  (setq pop-up-frames t)
  (purpose-x-magit-single-on)
  (add-to-list 'purpose-special-action-sequences
	       '(magit
		 purpose-display-reuse-window-buffer
		 purpose-display-reuse-window-purpose
		 purpose-display-pop-up-frame)))

emacs version: 27.0.50

@bmag
Copy link
Owner

bmag commented Mar 21, 2019

When you put magit in purpose-special-action-sequences like this, because a function named magit exists, Purpose interprets it as a predicate functions and calls it with 3 arguments.

The problem here is in the purpose-x-magit extension - I should change it to define a Magit purpose instead of magit, then you can put Magit instead of magit. In the meantime you can replace magit with (lambda (purpose _buffer _alist) (eq purpose 'magit)).

I'm gonna change the title to reflect the bug (it is unrelated to Emacs version).

@bmag bmag changed the title Wrong number of arguments: (0 . 2), 3 on emacs 27 magit purpose defined by purpose-x-magit can cause error: Wrong number of arguments: (0 . 2), 3 Mar 21, 2019
@bmag bmag added the bug label Mar 21, 2019
@bmag
Copy link
Owner

bmag commented Mar 21, 2019

Should be fixed by 34b4d08. You will need to replace magit with Magit in purpose-special-action-sequences.

@bmag bmag closed this as completed Mar 21, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants