Closed gdkrmr closed 2 months ago
Thanks for this quick fix! I came across the same bug and before I noticed your PR, did a deep dive myself that led to a separate PR (#16366).
In brief, the issue is not that inferior-ess-r-mode-map
doesn't exist in general (it is defined in ess-r-mode.el
), the problem is that it doesn't exist when spacemacs/ess-bind-keys-for-inferior
is called.
Currently, spacemacs/ess-bind-keys-for-inferior
is called from within an :init
block for ess-site
here:
(with-eval-after-load 'ess-inf
(spacemacs/ess-bind-keys-for-inferior))
However, ess-site
is (implicitly) deferred, so it does not get loaded at startup. At some point, when the user tries to edit an R
file (or does most things ess
-related), the autoload system will cause ess-inf.el
to get loaded, which will fire off this code, but this can happen before ess-r-mode
has been loaded.
Nice! Thanks for taking the time and doing it right! Your PR should be merged.
R and related modes (R markdown, quarto mode, ...) were broken because spacemacs tried to assign a keybinding to
inferior-ess-r-mode-map
, which doesn't exist. I have done a quick fix by removing the assignment. In the R repl you cannot type<-
by pressingM--
any more, in a.R
file it still works.