Skip to content

Commit efaee21

Browse files
fnussbaumsmile13241324
authored andcommitted
[compleseus] Fix dynamic changing of editing styles
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`. This commit also fixes a typo in spacemacs-bootstrap/packages.el.
1 parent d6ef2d2 commit efaee21

File tree

3 files changed

+1
-8
lines changed

3 files changed

+1
-8
lines changed

layers/+completion/compleseus/funcs.el

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -291,12 +291,6 @@ Note: this function relies on embark internals and might break upon embark updat
291291
'(spacemacs/compleseus-grep-change-to-wgrep-mode)))
292292
(embark-export)))
293293

294-
(defun spacemacs//set-initial-grep-state ()
295-
"Set the initial evil state for the grep buffers."
296-
(if (eq dotspacemacs-editing-style 'emacs)
297-
(evil-set-initial-state 'grep-mode 'emacs)
298-
(evil-set-initial-state 'grep-mode 'motion)))
299-
300294
(defun spacemacs/wgrep-finish-edit ()
301295
"Set back the default evil state when finishing editing."
302296
(interactive)

layers/+completion/compleseus/packages.el

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -435,7 +435,6 @@
435435
"w" 'spacemacs/compleseus-grep-change-to-wgrep-mode))
436436

437437
(defun compleseus/init-wgrep ()
438-
(add-hook 'spacemacs-editing-style-hook #'spacemacs//set-initial-grep-state)
439438
(evil-define-key 'normal wgrep-mode-map ",," #'spacemacs/wgrep-finish-edit)
440439
(evil-define-key 'normal wgrep-mode-map ",c" #'spacemacs/wgrep-finish-edit)
441440
(evil-define-key 'normal wgrep-mode-map ",a" #'spacemacs/wgrep-abort-changes)

layers/+distributions/spacemacs-bootstrap/packages.el

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -611,7 +611,7 @@ Press \\[which-key-toggle-persistent] to hide."
611611
(hybrid-mode -1)
612612
(spacemacs/declare-prefix "tEh" "hybrid (hybrid-mode)"))
613613
(holy-mode)
614-
(spacemacs/declare-prefix "tEe" "vim (evil-mode"))
614+
(spacemacs/declare-prefix "tEe" "vim (evil-mode)"))
615615
:off (progn (holy-mode -1)
616616
(spacemacs/declare-prefix "tEe" "emacs (holy-mode)"))
617617
:off-message "evil-mode enabled."

0 commit comments

Comments
 (0)