You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I may just be doing it wrong, but is there no way of using :bind for a keymap like java-mode-map?
(use-package cc-mode
:bind (:map java-mode-map ;; :package cc-mode
("[tab]". indent-for-tab-command))
:config;; HACK `:bind' won't work for this for some reason;; (with-eval-after-load 'cc-mode;; (bind-key [tab] #'indent-for-tab-command java-mode-map))
)
as it stands here, this declaration does not throw any errors, but it also doesn't set the keybinding in the java-mode-map (M-x java-modeC-h k TAB -> c-indent-line-or-region).
I've tried various combinations of use-package emacs and use-package cc-mode with and without the :package cc-mode part enabled and if you use use-package emacs without :package ... it throws an error on startup: Symbol's value as variable is void: java-mode-map
The part marked with HACK does correctly set the keybinding, which seems odd to me because my understanding of the :bind keyword is that it would get expanded to that anyways. Is this an actual issue, or am I just doing it wrong?
The text was updated successfully, but these errors were encountered:
what do you get if you run it thru macroexpand?
I'm not the best at emacs-lisp by any means, but seing as use-package is a macro, it should help quite a lot
as a sidenote, the main developer should add something like "if possible, include the output/result of running macroexpand on the use-package call in question" to the issues how-to
here is what I got, cleaned up slightly(use-package creates a variable for use in error-logging it seems, i deleted the def an replaced it with the generic "use-package--warning")u
I may just be doing it wrong, but is there no way of using
:bind
for a keymap likejava-mode-map
?as it stands here, this declaration does not throw any errors, but it also doesn't set the keybinding in the
java-mode-map
(M-x java-mode
C-h k TAB
->c-indent-line-or-region
).I've tried various combinations of
use-package emacs
anduse-package cc-mode
with and without the:package cc-mode
part enabled and if you useuse-package emacs
without:package ...
it throws an error on startup:Symbol's value as variable is void: java-mode-map
The part marked with
HACK
does correctly set the keybinding, which seems odd to me because my understanding of the:bind
keyword is that it would get expanded to that anyways. Is this an actual issue, or am I just doing it wrong?The text was updated successfully, but these errors were encountered: