syl20bnr / spacemacs

A community-driven Emacs distribution - The best editor is neither Emacs nor Vim, it's Emacs *and* Vim!
http://spacemacs.org
GNU General Public License v3.0
23.56k stars 4.9k forks source link

[compleseus] Fix dynamic changing of editing styles #16421

Closed fnussbaum closed 1 month ago

fnussbaum commented 1 month ago

The function spacemacs//set-initial-grep-state is only called by the spacemacs-editing-style-hook but always throws an error because the hook is ran with an argument (the editing style switched to), but the function does not expect any arguments.

At first it seems like one should just add the missing argument, however, it is in fact not necessary to execute this function at all: grep-mode is derived from compilation-mode which is an element of evil-motion-state-modes. Moreover, when using (or temporarily toggling) the emacs editing style, evil-motion-state is overridden with evil-emacs-state by the advice holy-motion-to-emacs-state.