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

Unbound variable: *GLOBAL-MAP*, Class named APPLICATION-MODE not found #67

Closed
LaloHao opened this issue Jan 19, 2018 · 4 comments
Closed

Comments

@LaloHao
Copy link

LaloHao commented Jan 19, 2018

I'm just playing around, am i missing something?

My ~/.next.d/init.lisp

(in-package :next)
(define-key *global-map* (kbd "Escape") 'evil-mode)

(defvar *evil-mode-map* (make-hash-table :test 'equalp))

(defun evil-mode ()
  (make-instance 'application-mode
                 :name "evil-mode"
                 :keymap *evil-mode-map*))

document-mode-map doesnt work either

@jmercouris
Copy link
Member

jmercouris commented Jan 19, 2018

Hi, I am sorry for the problems you are having! I hope we can figure it out together!

Firstly, I would just like to confirm, is your configuration being loaded at all? The config system has been updated to XDG specifications and should reside at ~/.config/next/init.lisp- or whatever xdg home for your account is

@LaloHao
Copy link
Author

LaloHao commented Jan 20, 2018

Thank you, i think the problem was with the binary, i had downloaded from the site, if i run from source i get no errors.

Now, i know this is another issue but can i ask why is my mode not working?

(in-package :next)

(defvar *evil-mode-map* (make-hash-table :test 'equalp))

(define-key *evil-mode-map* (kbd "k") 'scroll-up)
(define-key *evil-mode-map* (kbd "j") 'scroll-down)

(defclass evil-mode (mode) ())

(defun evil-mode ()
  (make-instance 'evil-mode
                 :name "Evil-mode"
                 :keymap *evil-mode-map*))

(define-key *global-map* (kbd "Escape") 'evil-mode)
(define-key *global-map* (kbd "S-e") 'evil-mode)

Neither does Escape or S-e activates the mode

@lehmacdj
Copy link
Contributor

You need to call 'add-or-switch-to-mode to enable the new mode. Just creating an instance isn't enough to switch to the new mode. I had some difficulty with switching modes when I was working on my evil-mode script as well, but eventually decided to just overwrite the function 'document-mode so that it would start out enabled.

@jmercouris
Copy link
Member

Yeah, this is an issue, I wanted to make something akin to auto-mode-alist for nEXT (https://www.emacswiki.org/emacs/AutoModeAlist), but that is further down the line, first have to complete the tasks in release 0.08 which will make nEXT much easier to extend

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants