`general-def` is not defined when used in `pre-` or `post-command-hook`
shadowrylander opened this issue · 1 comments
shadowrylander commented
Hello!
As in the title; I have a function hooked to the pre-
and post-command-hook
, with the following code:
(when (window-minibuffer-p)
(when (featurep 'general)
(if (or (derived-mode-p 'prog-mode)
(derived-mode-p 'text-mode))
(unless (lookup-key
general-override-mode-map
(naked "RET")) (define-key general-override-mode-map (naked "RET") 'newline-and-indent)) ;; (general-def :keymaps 'override "RET" 'newline-and-indent))
(when (lookup-key
general-override-mode-map
(naked "RET")) (define-key general-override-mode-map (naked "RET") nil) ;; (general-def :keymaps 'override "RET" nil)
))))
However, general-def
does not seem to work, stating that it is undefined. eval
does not seem to help, either, as when using return
in the minibuffer, a newline is entered instead of selecting the option. define-key
works fine, however.
Any help in solving this would be greatly appreciated!
shadowrylander commented
I have switched to the function general-define-key
instead, for the moment.