general is not working correctly for emacs-lisp-mode
rdbeni0 opened this issue · 1 comments
Hi, i have below configuration in my startup:
cfg-gen-emacs-lisp-mode.el :
(general-define-key
:states '(normal visual emacs)
:keymaps 'emacs-lisp-mode-map
:major-modes 'emacs-lisp-mode
:prefix ","
"c" '(emacs-lisp-native-compile-and-load :which-key "compile-and-load")
"e" '(:ignore t :which-key "eval-elisp")
"ee" '(eval-region :which-key "eval-region")
"eE" '(eval-buffer :which-key "eval-buffer")
"=" '(:ignore t :which-key "format")
"==" '(format-all-buffer :which-key "format-all-buffer")
"=b" '(format-all-buffer :which-key "format-all-buffer")
"=o" '(format-all-region :which-key "format-all-region")
"," '(ffap :which-key "ffap"))
and after fresh startup and when i open random *.el file, then keybindings are not working correctly (only evil keybindings are working when i am pressing ,).
I found ugly workaround which is fixing above issue:
(find-file (expand-file-name "elisp/cfg-general/cfg-gen-emacs-lisp-mode.el" user-emacs-directory))
(eval-buffer)
(kill-buffer)
So basically find+file and eval buffer are working great and after that i am able to see my declared keybindings as expected. Please note that this issue is only existing in emacs-lisp-mode. Other modes - are OK for similar syntax (and i dont need to use (find+file) and (eval-buffer)).
how can i avoid that ugly workaround to fix the issue?
I tried: (require 'elisp-mode) or load, but nothing is working. What exactly find-file is doing and why i am able to add correct keybindings only after that command?
Fixed.
It was strange bug with my config, i had
)
in bad place, somehere in earlier general.el config. When i cleaned all my
()
elisp brackets, then everything started working. So no issue for now.