3
43
Fork
You've already forked opencode.el
16

Doesnt start because of 'evil-define-key' #10

Closed
opened 2026年01月16日 07:40:55 +01:00 by konrad1977 · 4 comments

I get an error: Invalid function: evil-define-key

(with-eval-after-load 'evil
(require 'evil-core))

(use-package opencode
:defer t
:after evil
:demand t
:vc (:url "https://codeberg.org/sczi/opencode.el" :rev :newest))

I am loading evil way before opencode.

I get an error: Invalid function: evil-define-key (with-eval-after-load 'evil (require 'evil-core)) (use-package opencode :defer t :after evil :demand t :vc (:url "https://codeberg.org/sczi/opencode.el" :rev :newest)) I am loading evil way before opencode.
Owner
Copy link

Thanks, so I was doing:

(with-eval-after-load 'evil
 (evil-define-key 'normal opencode-session-control-mode-map
 ...)

but for that to work the evil-define-key macro needs to be available at the time that file is compiled. I guess in doom emacs evil is already loaded when this package is compiled, but in a normal emacs setup with evil it isn't. I changed it to use evil-define-key* which is a function not a macro and it should work now.

Thanks, so I was doing: ``` (with-eval-after-load 'evil (evil-define-key 'normal opencode-session-control-mode-map ...) ``` but for that to work the evil-define-key macro needs to be available at the time that file is compiled. I guess in doom emacs evil is already loaded when this package is compiled, but in a normal emacs setup with evil it isn't. I changed it to use `evil-define-key*` which is a function not a macro and it should work now.

Now it says: Process opencode exited abnormally with code 127
opencode --version == 1.1.22

This is only visible in the "opencode-serve buffer, no debug backtrace when running the command while debug-on-error = t.

Now it says: Process opencode exited abnormally with code 127 opencode --version == 1.1.22 This is only visible in the "*opencode-serve* buffer, no debug backtrace when running the command while debug-on-error = t.
Owner
Copy link

In 62e8262 I added:

  • insert the output of running opencode into the *opencode-serve* buffer until it sees the server is listening ok
  • add process sentinal to opencode process, so if it exits with error, we raise an error in emacs, and pop open the *opencode-serve*buffer where it should now show the error message why the command fails

does that at least show you now why it's failing?

In 62e8262 I added: - insert the output of running opencode into the `*opencode-serve*` buffer until it sees the server is listening ok - add process sentinal to opencode process, so if it exits with error, we raise an error in emacs, and pop open the `*opencode-serve*`buffer where it should now show the error message why the command fails does that at least show you now why it's failing?
Owner
Copy link

I'm cleaning up old issues, so closing this, but if you're still getting errors please reopen and I'm happy to help debug.

I'm cleaning up old issues, so closing this, but if you're still getting errors please reopen and I'm happy to help debug.
Sign in to join this conversation.
No Branch/Tag specified
main
No results found.
Labels
Clear labels
No items
No labels
Milestone
Clear milestone
No items
No milestone
Projects
Clear projects
No items
No project
Assignees
Clear assignees
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
sczi/opencode.el#10
Reference in a new issue
sczi/opencode.el
No description provided.
Delete branch "%!s()"

Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?