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

Fix wrong-number-of-arguments error #59

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

r0man
Copy link

@r0man r0man commented May 26, 2022

With Emacs 28 I'm seeing the following error when running the tests.

deferred error : (wrong-number-of-arguments #<subr start-process-shell-command> 4)

I believe this is because the start-process-shell-command function
is called with the command arguments as &rest parameters. This is the
function signature of start-process-shell-command, and it only takes
3 arguments, the name, buffer, and command. The command argument can
be a shell string like "ls -l" for example.

(defun start-process-shell-command (name buffer command) ...)

The start-process function on the other hand has &rest parameters
and can be called with a list of arguments.

(defun start-process (name buffer program &rest program-args) ...)

This PR fixes the issue by concatenating the command and it's argument
before calling out to deferred:process-buffer-gen, which is used in
both cases, when calling start-process-shell-command, and when
calling start-process.

With Emacs 28 I'm seeing the following error when running the tests.

```
deferred error : (wrong-number-of-arguments #<subr start-process-shell-command> 4)
```

I believe this is because the `start-process-shell-command` function
is called with the command arguments as &rest parameters. This is the
function signature of `start-process-shell-command`, and it only takes
3 arguments, the name, buffer, and command. The command argument can
be a shell string like "ls -l" for example.

```
(defun start-process-shell-command (name buffer command) ...)
```

The `start-process` function on the other hand has &rest parameters
and can be called with a list of arguments.

```
(defun start-process (name buffer program &rest program-args) ...)
```

This PR fixes the issue by concatenating the command and it's argument
before calling out to `deferred:process-buffer-gen`, which is used in
both cases, when calling `start-process-shell-command`, and when
calling `start-process`.
@edouardklein
Copy link

Hi,

I have been bitten by the same bug, and after debugging it I came up with mostly the same solution. I found this PR when trying to open one. I should have checked first :/

Anyway, I can vouch that the bug is real and the fix is good (thank you @r0man ).

One example of a package that expects these functions to work is michelson.el:
https://gitlab.com/tezos/tezos/-/blob/master/emacs/michelson-mode.el#L429

@kiwanami , if you could please be so kind as to please merge this, it would make maintaining my emacs config easier as I wouldn't have to carry a patch around.

Thanks in advance :)

Cheers.

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

Successfully merging this pull request may close these issues.

None yet

2 participants